summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-10-14 12:52:12 +0200
committerVladimir Glazunov <vg@openoffice.org>2010-10-14 12:52:12 +0200
commit7d4814bb93a75943282167707e69588969145d1f (patch)
tree11f9877bc345b315afacc264a1b1984802934e27 /reportdesign
parent8aea3d9e83a58b23bd2d350d6a8fc16c494b426b (diff)
parent65dc8ada712a15d43e01e11b8e378b7044feb4d4 (diff)
#i10000# changes from OOO330 m10
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx20
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx4
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx38
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx1
-rw-r--r--reportdesign/source/ui/inspection/DataProviderHandler.cxx21
5 files changed, 31 insertions, 53 deletions
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 2299fff10f98..7d1cdbc6db30 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -1221,20 +1221,12 @@ void OOle2Obj::initializeChart( const uno::Reference< frame::XModel>& _xModel)
OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
pRptModel->GetUndoEnv().AddElement(lcl_getDataProvider(xObj));
- uno::Sequence< beans::PropertyValue > aArgs( 4 );
- aArgs[0] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
- uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) ), beans::PropertyState_DIRECT_VALUE );
- aArgs[1] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("HasCategories"), -1,
- uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
- aArgs[2] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
- uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
- aArgs[3] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("DataRowSource"), -1,
- uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
- xReceiver->setArguments( aArgs );
+ ::comphelper::NamedValueCollection aArgs;
+ aArgs.put( "CellRangeRepresentation", uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "all" ) ) ) );
+ aArgs.put( "HasCategories", uno::makeAny( sal_True ) );
+ aArgs.put( "FirstCellAsLabel", uno::makeAny( sal_True ) );
+ aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) );
+ xReceiver->setArguments( aArgs.getPropertyValues() );
if( xChartModel.is() )
xChartModel->unlockControllers();
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index d3a557c3ff6b..be664b5694e1 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -349,14 +349,14 @@ void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any >
if ( xDataProvider.is() )
{
m_aColumns.realloc(1);
- uno::Sequence< uno::Sequence< ::rtl::OUString > > aColumnNames = xDataProvider->getComplexColumnDescriptions();
+ uno::Sequence< ::rtl::OUString > aColumnNames = xDataProvider->getColumnDescriptions();
for(sal_Int32 i = 0 ; i < aColumnNames.getLength();++i)
{
if ( aColumnNames[i].getLength() )
{
sal_Int32 nCount = m_aColumns.getLength();
m_aColumns.realloc(nCount+1);
- m_aColumns[nCount] = aColumnNames[i][0];
+ m_aColumns[nCount] = aColumnNames[i];
}
}
}
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index c92eecc1084d..92ee79509dea 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -37,6 +37,7 @@
#include <comphelper/sequence.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/documentconstants.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlement.hxx>
@@ -56,8 +57,9 @@ using namespace ::xmloff::token;
::rtl::OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,const xmloff::token::XMLTokenEnum& _eAttribute);
-ImportDocumentHandler::ImportDocumentHandler(uno::Reference< uno::XComponentContext > const & context) :
- m_xContext(context)
+ImportDocumentHandler::ImportDocumentHandler(uno::Reference< uno::XComponentContext > const & context)
+ :m_bImportedChart( false )
+ ,m_xContext(context)
{
}
// -----------------------------------------------------------------------------
@@ -121,35 +123,24 @@ void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException,
{
m_xDelegatee->endDocument();
uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW);
- if ( xReceiver.is() )
+ if ( xReceiver.is() && m_bImportedChart )
{
// this fills the chart again
- uno::Sequence< beans::PropertyValue > aArgs( 4 );
- aArgs[0] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
- uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) ), beans::PropertyState_DIRECT_VALUE );
- aArgs[1] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("HasCategories"), -1,
- uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
- aArgs[2] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
- uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
- aArgs[3] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("DataRowSource"), -1,
- uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
+ ::comphelper::NamedValueCollection aArgs;
+ aArgs.put( "CellRangeRepresentation", ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) );
+ aArgs.put( "HasCategories", uno::makeAny( sal_True ) );
+ aArgs.put( "FirstCellAsLabel", uno::makeAny( sal_True ) );
+ aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) );
uno::Reference< chart::XComplexDescriptionAccess > xDataProvider(m_xModel->getDataProvider(),uno::UNO_QUERY);
if ( xDataProvider.is() )
{
- aArgs.realloc(5);
- uno::Sequence< uno::Sequence< ::rtl::OUString > > aColumnNames = xDataProvider->getComplexColumnDescriptions();
- aArgs[4] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("ComplexColumnDescriptions"), -1,
- uno::makeAny( aColumnNames ), beans::PropertyState_DIRECT_VALUE );
+ const uno::Sequence< ::rtl::OUString > aColumnNames = xDataProvider->getColumnDescriptions();
+ aArgs.put( "ColumnDescriptions", uno::makeAny( aColumnNames ) );
}
- xReceiver->attachDataProvider(m_xDatabaseDataProvider.get());
- xReceiver->setArguments( aArgs );
+ xReceiver->attachDataProvider( m_xDatabaseDataProvider.get() );
+ xReceiver->setArguments( aArgs.getPropertyValues() );
}
}
@@ -204,6 +195,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName
}
m_xDelegatee->startElement(lcl_createAttribute(XML_NP_OFFICE,XML_CHART),NULL);
bExport = false;
+ m_bImportedChart = true;
}
else if ( _sName.equalsAscii("rpt:master-detail-field") )
{
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
index 3f0fdebfc111..579a1b79b231 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
@@ -85,6 +85,7 @@ private:
virtual ~ImportDocumentHandler();
::osl::Mutex m_aMutex;
+ bool m_bImportedChart;
::std::vector< ::rtl::OUString> m_aMasterFields;
::std::vector< ::rtl::OUString> m_aDetailFields;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aArguments;
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index 57e293994741..d62a9443d490 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -27,6 +27,7 @@
#include "precompiled_reportdesign.hxx"
#include "DataProviderHandler.hxx"
#include <com/sun/star/lang/XInitialization.hpp>
+#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/property.hxx>
#include <comphelper/types.hxx>
@@ -469,21 +470,13 @@ void SAL_CALL DataProviderHandler::actuatingPropertyChanged(const ::rtl::OUStrin
sal_Bool bModified = xReport->isModified();
// this fills the chart again
- uno::Sequence< beans::PropertyValue > aArgs( 4 );
- aArgs[0] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
- uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) ), beans::PropertyState_DIRECT_VALUE );
- aArgs[1] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("HasCategories"), -1,
- uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
- aArgs[2] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
- uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
- aArgs[3] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("DataRowSource"), -1,
- uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
+ ::comphelper::NamedValueCollection aArgs;
+ aArgs.put( "CellRangeRepresentation", uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "all" ) ) ) );
+ aArgs.put( "HasCategories", uno::makeAny( sal_True ) );
+ aArgs.put( "FirstCellAsLabel", uno::makeAny( sal_True ) );
+ aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) );
uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xChartModel,uno::UNO_QUERY_THROW);
- xReceiver->setArguments( aArgs );
+ xReceiver->setArguments( aArgs.getPropertyValues() );
if ( !bModified )
xReport->setModified(sal_False);
} // if ( NewValue != OldValue )