summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx29
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx1
3 files changed, 19 insertions, 14 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index a79dea71193c..603f54bd3f6c 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -563,8 +563,7 @@ namespace
}
catch(uno::Exception& ex)
{
- (void)ex;
- OSL_ASSERT(0);
+ DBG_UNHANDLED_EXCEPTION();
}
}
void SAL_CALL FactoryLoader::onTerminated()
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 4cf7c9c5abc9..930c7cb8ad12 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -33,6 +33,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/ChartDataRowSource.hpp>
#include <com/sun/star/reflection/XProxyFactory.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <comphelper/sequence.hxx>
@@ -59,7 +60,6 @@ using namespace ::xmloff::token;
ImportDocumentHandler::ImportDocumentHandler(uno::Reference< uno::XComponentContext > const & context) :
m_xContext(context)
- ,m_bOnlyOnce(true)
{
}
// -----------------------------------------------------------------------------
@@ -124,7 +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() )
+ {
xReceiver->attachDataProvider(m_xDatabaseDataProvider.get());
+ // 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 );
+ xReceiver->setArguments( aArgs );
+ }
}
void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & _xAttrList) throw (uno::RuntimeException, xml::sax::SAXException)
@@ -257,16 +274,6 @@ void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName
}
} // for(;pArgIter != pArgEnd;++pArgIter)
- if ( m_bOnlyOnce )
- {
- try
- {
- m_xDatabaseDataProvider->createDataSource(m_aArguments);
- m_bOnlyOnce = false;
- }
- catch(uno::Exception)
- {}
- } // if ( m_bOnlyOnce )
SvXMLAttributeList* pList = new SvXMLAttributeList();
xNewAttribs = pList;
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
index 068fac8cb5f9..69772a71674d 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
@@ -100,7 +100,6 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider;
::std::auto_ptr<SvXMLTokenMap> m_pReportElemTokenMap;
- bool m_bOnlyOnce;
};
// -----------------------------------------------------------------------------
} // namespace rptxml