diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-08 10:48:42 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-01-15 09:56:01 +0200 |
commit | f6c759a6e5ead55b857e5d4898aa423b7616e816 (patch) | |
tree | 793c94be22721662151e26cedb2faff94f6c18e2 /chart2/source/tools | |
parent | 2fe852386c9450014f84910b0a282d684f40b56a (diff) |
fdo#46808, Adapt chart2::data::LabeledDataSequence UNO service to new style
Change-Id: I98bfbc8e143b9ad9d486f97380186fde9b4423ec
Diffstat (limited to 'chart2/source/tools')
-rw-r--r-- | chart2/source/tools/StatisticsHelper.cxx | 28 |
1 files changed, 12 insertions, 16 deletions
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( |