summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-08 10:48:42 +0200
committerNoel Grandin <noel@peralex.com>2013-01-15 09:56:01 +0200
commitf6c759a6e5ead55b857e5d4898aa423b7616e816 (patch)
tree793c94be22721662151e26cedb2faff94f6c18e2 /chart2
parent2fe852386c9450014f84910b0a282d684f40b56a (diff)
fdo#46808, Adapt chart2::data::LabeledDataSequence UNO service to new style
Change-Id: I98bfbc8e143b9ad9d486f97380186fde9b4423ec
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/inc/LabeledDataSequence.hxx10
-rw-r--r--chart2/source/tools/StatisticsHelper.cxx28
2 files changed, 16 insertions, 22 deletions
diff --git a/chart2/source/inc/LabeledDataSequence.hxx b/chart2/source/inc/LabeledDataSequence.hxx
index fe338dda1b6d..59c9b169319d 100644
--- a/chart2/source/inc/LabeledDataSequence.hxx
+++ b/chart2/source/inc/LabeledDataSequence.hxx
@@ -21,9 +21,9 @@
#include "ServiceMacros.hxx"
#include "MutexContainer.hxx"
#include <comphelper/uno3.hxx>
-#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/implbase2.hxx>
-#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
+#include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -34,10 +34,8 @@ namespace chart
namespace impl
{
-typedef cppu::WeakImplHelper4<
- ::com::sun::star::chart2::data::XLabeledDataSequence,
- ::com::sun::star::util::XCloneable,
- ::com::sun::star::util::XModifyBroadcaster,
+typedef cppu::WeakImplHelper2<
+ ::com::sun::star::chart2::data::XLabeledDataSequence2,
::com::sun::star::lang::XServiceInfo >
LabeledDataSequence_Base;
}
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index 73db0a2499d8..fd6282d02551 100644
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
@@ -26,8 +26,7 @@
#include <rtl/ustrbuf.hxx>
#include <comphelper/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
+#include <com/sun/star/chart2/data/LabeledDataSequence.hpp>
#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
@@ -130,22 +129,19 @@ void lcl_addSequenceToDataSource(
const OUString & rRole )
{
Reference< chart2::data::XDataSink > xSink( xDataSource, uno::UNO_QUERY );
- Reference< lang::XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- if( ! ( xFact.is() && xSink.is() ))
+ Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ if( ! xSink.is() )
return;
- Reference< chart2::data::XLabeledDataSequence > xLSeq(
- xFact->createInstance( C2U("com.sun.star.chart2.data.LabeledDataSequence")), uno::UNO_QUERY );
- if( xLSeq.is())
- {
- lcl_setRole( xNewSequence, rRole );
- xLSeq->setValues( xNewSequence );
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences(
- xDataSource->getDataSequences());
- aSequences.realloc( aSequences.getLength() + 1 );
- aSequences[ aSequences.getLength() - 1 ] = xLSeq;
- xSink->setData( aSequences );
- }
+ Reference< chart2::data::XLabeledDataSequence > xLSeq( chart2::data::LabeledDataSequence::create(xContext), uno::UNO_QUERY_THROW );
+
+ lcl_setRole( xNewSequence, rRole );
+ xLSeq->setValues( xNewSequence );
+ Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences(
+ xDataSource->getDataSequences());
+ aSequences.realloc( aSequences.getLength() + 1 );
+ aSequences[ aSequences.getLength() - 1 ] = xLSeq;
+ xSink->setData( aSequences );
}
void lcl_setXMLRangePropertyAtDataSequence(