summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-07-09 14:49:18 +0200
committerOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-07-09 14:49:18 +0200
commit06611b0b7584e21c9b876c20d35850e8fefcf093 (patch)
treeb99c9d1493ea667063c1f2db63a3372791bb06a3 /reportdesign
parent2141676620130121da7590eda02a235199f527d8 (diff)
dba33g: #i112213# handle chart import for columns
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx14
2 files changed, 15 insertions, 1 deletions
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index e86e46221e50..3fa6b42e625b 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -289,7 +289,9 @@ void SAL_CALL ExportDocumentHandler::endElement(const ::rtl::OUString & _sName)
void SAL_CALL ExportDocumentHandler::characters(const ::rtl::OUString & aChars) throw (uno::RuntimeException, xml::sax::SAXException)
{
if ( !(m_bTableRowsStarted || m_bFirstRowExported) )
+ {
m_xDelegatee->characters(aChars);
+ }
else if ( m_bExportChar )
{
static const ::rtl::OUString s_sZero(RTL_CONSTASCII_USTRINGPARAM("0"));
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 4adbd142d4c8..c92eecc1084d 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/chart2/data/DatabaseDataProvider.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
+#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/reflection/XProxyFactory.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
@@ -122,7 +123,6 @@ void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException,
uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW);
if ( xReceiver.is() )
{
- xReceiver->attachDataProvider(m_xDatabaseDataProvider.get());
// this fills the chart again
uno::Sequence< beans::PropertyValue > aArgs( 4 );
aArgs[0] = beans::PropertyValue(
@@ -137,6 +137,18 @@ void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException,
aArgs[3] = beans::PropertyValue(
::rtl::OUString::createFromAscii("DataRowSource"), -1,
uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
+
+ 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 );
+ }
+ xReceiver->attachDataProvider(m_xDatabaseDataProvider.get());
+
xReceiver->setArguments( aArgs );
}
}