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 /xmloff | |
parent | 2fe852386c9450014f84910b0a282d684f40b56a (diff) |
fdo#46808, Adapt chart2::data::LabeledDataSequence UNO service to new style
Change-Id: I98bfbc8e143b9ad9d486f97380186fde9b4423ec
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLPlotAreaContext.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLSeries2Context.cxx | 14 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLTools.cxx | 13 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLTools.hxx | 4 |
4 files changed, 18 insertions, 20 deletions
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 8d10bf134e2d..2028d5e63e7e 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -50,6 +50,7 @@ #include <com/sun/star/chart2/data/XDataSink.hpp> #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp> +#include <com/sun/star/chart2/data/LabeledDataSequence.hpp> #include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> #include <com/sun/star/chart2/RelativePosition.hpp> @@ -994,10 +995,10 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume xSeqProp->setPropertyValue("Role", uno::makeAny( aRole )); - Reference< lang::XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); + Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - Reference< chart2::data::XLabeledDataSequence > xLabelSeq( - xFact->createInstance("com.sun.star.chart2.data.LabeledDataSequence"), uno::UNO_QUERY ); + Reference< chart2::data::XLabeledDataSequence > xLabelSeq( chart2::data::LabeledDataSequence::create(xContext), + uno::UNO_QUERY_THROW ); xLabelSeq->setValues( xNewSequence ); diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index 2764efc8ebf8..07dd9e2284ac 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -204,12 +204,12 @@ void lcl_insertErrorBarLSequencesToMap( } } -Reference< chart2::data::XLabeledDataSequence > lcl_createAndAddSequenceToSeries( const rtl::OUString& rRole +Reference< chart2::data::XLabeledDataSequence2 > lcl_createAndAddSequenceToSeries( const rtl::OUString& rRole , const rtl::OUString& rRange , const Reference< chart2::XChartDocument >& xChartDoc , const Reference< chart2::XDataSeries >& xSeries ) { - Reference< chart2::data::XLabeledDataSequence > xLabeledSeq; + Reference< chart2::data::XLabeledDataSequence2 > xLabeledSeq; Reference< chart2::data::XDataSource > xSeriesSource( xSeries,uno::UNO_QUERY ); Reference< chart2::data::XDataSink > xSeriesSink( xSeries, uno::UNO_QUERY ); @@ -231,7 +231,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_createAndAddSequenceToSeries Sequence< Reference< chart2::data::XLabeledDataSequence > > aOldSeq( xSeriesSource->getDataSequences()); sal_Int32 nOldCount = aOldSeq.getLength(); Sequence< Reference< chart2::data::XLabeledDataSequence > > aNewSeq( nOldCount + 1 ); - aNewSeq[0]=xLabeledSeq; + aNewSeq[0] = Reference< chart2::data::XLabeledDataSequence >(xLabeledSeq, uno::UNO_QUERY_THROW); for( sal_Int32 nN=0; nN<nOldCount; nN++ ) aNewSeq[nN+1] = aOldSeq[nN]; xSeriesSink->setData( aNewSeq ); @@ -385,8 +385,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib sal_Int32 nCoordinateSystemIndex = 0;//so far we can only import one coordinate system m_xSeries.set( mrImportHelper.GetNewDataSeries( mxNewDoc, nCoordinateSystemIndex, maSeriesChartTypeName, ! mrGlobalChartTypeUsedBySeries )); - Reference< chart2::data::XLabeledDataSequence > xLabeledSeq( - SchXMLTools::GetNewLabeledDataSequence()); + Reference< chart2::data::XLabeledDataSequence > xLabeledSeq( SchXMLTools::GetNewLabeledDataSequence(), uno::UNO_QUERY_THROW ); if( bIsCandleStick ) { @@ -595,14 +594,15 @@ void SchXMLSeries2Context::EndElement() for( std::vector< DomainInfo >::reverse_iterator aIt( aDomainInfos.rbegin() ); aIt!= aDomainInfos.rend(); ++aIt ) { DomainInfo aDomainInfo( *aIt ); - Reference< chart2::data::XLabeledDataSequence > xLabeledSeq = + Reference< chart2::data::XLabeledDataSequence2 > xLabeledSeq = lcl_createAndAddSequenceToSeries( aDomainInfo.aRole, aDomainInfo.aRange, mxNewDoc, m_xSeries ); if( xLabeledSeq.is() ) { // register for setting local data if external data provider is not present mrLSequencesPerIndex.insert( tSchXMLLSequencesPerIndex::value_type( - tSchXMLIndexWithPart( aDomainInfo.nIndexForLocalData, SCH_XML_PART_VALUES ), xLabeledSeq )); + tSchXMLIndexWithPart( aDomainInfo.nIndexForLocalData, SCH_XML_PART_VALUES ), + Reference< chart2::data::XLabeledDataSequence >(xLabeledSeq, uno::UNO_QUERY_THROW) )); } } diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 974a6c57b17e..db3a7f8290eb 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/chart2/data/LabeledDataSequence.hpp> #include <com/sun/star/chart2/data/XDataProvider.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp> @@ -350,14 +351,10 @@ XMLTokenEnum getTokenByChartType( return eResult; } -Reference< chart2::data::XLabeledDataSequence > GetNewLabeledDataSequence() +Reference< chart2::data::XLabeledDataSequence2 > GetNewLabeledDataSequence() { - Reference< uno::XComponentContext > xContext( - comphelper::getProcessComponentContext() ); - Reference< chart2::data::XLabeledDataSequence > xResult( - xContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.chart2.data.LabeledDataSequence", xContext ), - uno::UNO_QUERY_THROW ); + Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); + Reference< chart2::data::XLabeledDataSequence2 > xResult = chart2::data::LabeledDataSequence::create(xContext); return xResult; } @@ -443,7 +440,7 @@ void CreateCategories( { chart2::ScaleData aData( xAxis->getScaleData()); uno::Reference< chart2::data::XLabeledDataSequence > xLabeledSeq( - GetNewLabeledDataSequence()); + GetNewLabeledDataSequence(), uno::UNO_QUERY_THROW); try { OUString aConvertedRange( rRangeAddress ); diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx index d76abd9c7ce2..5273f23a4c24 100644 --- a/xmloff/source/chart/SchXMLTools.hxx +++ b/xmloff/source/chart/SchXMLTools.hxx @@ -24,6 +24,7 @@ #include "transporttypes.hxx" #include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp> namespace com { namespace sun { namespace star { namespace chart2 { @@ -31,7 +32,6 @@ namespace com { namespace sun { namespace star { class XRegressionCurve; namespace data { class XDataProvider; - class XLabeledDataSequence; } } }}} @@ -78,7 +78,7 @@ namespace SchXMLTools ::rtl::OUString GetNewChartTypeName( const ::rtl::OUString & rOldChartTypeName ); ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::data::XLabeledDataSequence > GetNewLabeledDataSequence(); + ::com::sun::star::chart2::data::XLabeledDataSequence2 > GetNewLabeledDataSequence(); ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > CreateDataSequence( const ::rtl::OUString& rRange, |