summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2010-10-13 11:26:25 +0200
committerJan Holesovsky <kendy@suse.cz>2010-10-13 11:26:25 +0200
commit23105b53eb5e009d92c32c6eb83b9fd3dff0a01b (patch)
tree39e88bb08910000881046fb576049ac6378fd12f /reportdesign
parent6450d1a7f5a6cab445a1b53c93f3c010d771c3a5 (diff)
parent65dc8ada712a15d43e01e11b8e378b7044feb4d4 (diff)
Merge commit 'ooo/OOO330_m10'
Conflicts: dbaccess/source/core/api/RowSetCache.cxx dbaccess/source/core/misc/DatabaseDataProvider.cxx
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 4449cfd6144e..9e7a83a5b557 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -1222,20 +1222,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 1e81fd20e426..9abb4056108b 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -350,14 +350,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 ac068df47975..a61c4b21928b 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -38,6 +38,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>
@@ -57,8 +58,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)
{
}
// -----------------------------------------------------------------------------
@@ -122,35 +124,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() );
}
}
@@ -205,6 +196,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 232f18c285ed..42c1b5a13e0f 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -28,6 +28,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>
@@ -470,21 +471,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 )