diff options
-rw-r--r-- | chart2/source/inc/LabeledDataSequence.hxx | 10 | ||||
-rw-r--r-- | chart2/source/tools/StatisticsHelper.cxx | 28 | ||||
-rw-r--r-- | offapi/UnoApi_offapi.mk | 3 | ||||
-rw-r--r-- | offapi/com/sun/star/chart2/data/LabeledDataSequence.idl | 31 | ||||
-rw-r--r-- | offapi/com/sun/star/chart2/data/XLabeledDataSequence2.idl | 76 | ||||
-rw-r--r-- | oox/inc/oox/drawingml/chart/converterbase.hxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/chart/converterbase.cxx | 6 | ||||
-rw-r--r-- | oox/source/drawingml/chart/seriesconverter.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/inc/xlchart.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 5 | ||||
-rw-r--r-- | sw/inc/unochart.hxx | 8 | ||||
-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 |
16 files changed, 132 insertions, 83 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( diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 8a5266157ab6..a8d540a6879a 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -62,6 +62,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/tree,\ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2/data,\ DatabaseDataProvider \ + LabeledDataSequence \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/configuration,\ ReadOnlyAccess \ @@ -546,7 +547,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/chart2/ DataSequence \ DataSink \ DataSource \ - LabeledDataSequence \ RangeHighlighter \ RangeHighlightListener \ TabularDataProviderArguments \ @@ -1975,6 +1975,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/chart2/data,\ XDataSource \ XDatabaseDataProvider \ XLabeledDataSequence \ + XLabeledDataSequence2 \ XNumericalDataSequence \ XRangeHighlighter \ XRangeXMLConversion \ diff --git a/offapi/com/sun/star/chart2/data/LabeledDataSequence.idl b/offapi/com/sun/star/chart2/data/LabeledDataSequence.idl index c7b701c9b0a4..58d78598a595 100644 --- a/offapi/com/sun/star/chart2/data/LabeledDataSequence.idl +++ b/offapi/com/sun/star/chart2/data/LabeledDataSequence.idl @@ -19,9 +19,7 @@ #ifndef com_sun_star_chart2_data_LabeledDataSequence_idl #define com_sun_star_chart2_data_LabeledDataSequence_idl -#include <com/sun/star/util/XCloneable.idl> -#include <com/sun/star/util/XModifyBroadcaster.idl> -#include <com/sun/star/chart2/data/XLabeledDataSequence.idl> +#include <com/sun/star/chart2/data/XLabeledDataSequence2.idl> module com { @@ -37,32 +35,7 @@ module data /** describes a container for a sequence pair of value-sequences, one for a label and one for the associated data. */ -service LabeledDataSequence -{ - /** provides read- and write-access to the underlying data. - */ - interface XLabeledDataSequence; - - /** is used to broadcast when the sequence for labels or values - change their identity, or their content changes. - - <p>The LabeledDataSequence should add itself at its - XDataSequences for values and labels, and forward any change - events coming from there.</p> - */ - interface com::sun::star::util::XModifyBroadcaster; - - /** Allows creating copies of data sequences. If this interface - is not supported, the same object will be shared if used by - multiple objects. - - <p>If a <type>LabeledDataSequence</type> is cloned, it has to - query its contents for the - <type scope="com::sun::star::util">XCloneable</type> interface - and use it if available.</p> - */ - [optional] interface ::com::sun::star::util::XCloneable; -}; +service LabeledDataSequence : XLabeledDataSequence2; } ; // data } ; // chart2 diff --git a/offapi/com/sun/star/chart2/data/XLabeledDataSequence2.idl b/offapi/com/sun/star/chart2/data/XLabeledDataSequence2.idl new file mode 100644 index 000000000000..40e6ab4d8264 --- /dev/null +++ b/offapi/com/sun/star/chart2/data/XLabeledDataSequence2.idl @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef com_sun_star_chart2_data_XLabeledDataSequence2_idl +#define com_sun_star_chart2_data_XLabeledDataSequence2_idl + +#include <com/sun/star/util/XCloneable.idl> +#include <com/sun/star/util/XModifyBroadcaster.idl> +#include <com/sun/star/chart2/data/XLabeledDataSequence.idl> + +module com +{ +module sun +{ +module star +{ +module chart2 +{ +module data +{ + +/** + @since LibreOffice 4.1 + */ +interface XLabeledDataSequence2 +{ + /** provides read- and write-access to the underlying data. + */ + interface XLabeledDataSequence; + + /** is used to broadcast when the sequence for labels or values + change their identity, or their content changes. + + <p>The LabeledDataSequence should add itself at its + XDataSequences for values and labels, and forward any change + events coming from there.</p> + */ + interface com::sun::star::util::XModifyBroadcaster; + + /** Allows creating copies of data sequences. If this interface + is not supported, the same object will be shared if used by + multiple objects. + + <p>If a <type>LabeledDataSequence</type> is cloned, it has to + query its contents for the + <type scope="com::sun::star::util">XCloneable</type> interface + and use it if available.</p> + */ + interface ::com::sun::star::util::XCloneable; +}; + +} ; // data +} ; // chart2 +} ; // com +} ; // sun +} ; // star + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx index 7d71441abd67..8ee81d40a678 100644 --- a/oox/inc/oox/drawingml/chart/converterbase.hxx +++ b/oox/inc/oox/drawingml/chart/converterbase.hxx @@ -68,6 +68,8 @@ public: /** Creates an instance for the passed service name, using the process service factory. */ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createInstance( const ::rtl::OUString& rServiceName ) const; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + getComponentContext() const; protected: /** Returns the filter object of the imported/exported document. */ diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index e8714b9c19e3..65d813d307c2 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -33,6 +33,7 @@ #include "basegfx/numeric/ftools.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/theme.hxx" +#include <comphelper/processfactory.hxx> namespace oox { namespace drawingml { @@ -240,6 +241,11 @@ Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceN return xInt; } +Reference< XComponentContext > ConverterRoot::getComponentContext() const +{ + return comphelper::getComponentContext(mxData->mrFilter.getServiceFactory()); +} + XmlFilterBase& ConverterRoot::getFilter() const { return mxData->mrFilter; diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index adfe078c0766..3cc38d018926 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/chart2/XRegressionCurve.hpp> #include <com/sun/star/chart2/XRegressionCurveContainer.hpp> #include <com/sun/star/chart2/data/XDataSink.hpp> +#include <com/sun/star/chart2/data/LabeledDataSequence.hpp> #include <basegfx/numeric/ftools.hxx> #include "oox/drawingml/chart/datasourceconverter.hxx" #include "oox/drawingml/chart/seriesmodel.hxx" @@ -83,7 +84,7 @@ Reference< XLabeledDataSequence > lclCreateLabeledDataSequence( Reference< XLabeledDataSequence > xLabeledSeq; if( xValueSeq.is() || xTitleSeq.is() ) { - xLabeledSeq.set( rParent.createInstance( "com.sun.star.chart2.data.LabeledDataSequence" ), UNO_QUERY ); + xLabeledSeq.set( LabeledDataSequence::create(rParent.getComponentContext()), UNO_QUERY ); if( xLabeledSeq.is() ) { xLabeledSeq->setValues( xValueSeq ); diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 8310deb2f7dc..63c9c433a9f5 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -56,6 +56,7 @@ #include <com/sun/star/chart2/TickmarkStyle.hpp> #include <com/sun/star/chart2/RelativePosition.hpp> #include <com/sun/star/chart2/RelativeSize.hpp> +#include <com/sun/star/chart2/data/LabeledDataSequence.hpp> #include <com/sun/star/chart/DataLabelPlacement.hpp> #include <com/sun/star/chart/ErrorBarStyle.hpp> #include <com/sun/star/chart/MissingValueTreatment.hpp> @@ -124,6 +125,7 @@ using ::com::sun::star::chart2::data::XDataReceiver; using ::com::sun::star::chart2::data::XDataSequence; using ::com::sun::star::chart2::data::XDataSink; using ::com::sun::star::chart2::data::XLabeledDataSequence; +using ::com::sun::star::chart2::data::LabeledDataSequence; using ::formula::FormulaToken; using ::formula::StackVar; @@ -718,7 +720,7 @@ Reference< XLabeledDataSequence > lclCreateLabeledDataSequence( // create the labeled data sequence, if values or title are present Reference< XLabeledDataSequence > xLabeledSeq; if( xValueSeq.is() || xTitleSeq.is() ) - xLabeledSeq.set( ScfApiHelper::CreateInstance( SERVICE_CHART2_LABELEDDATASEQ ), UNO_QUERY ); + xLabeledSeq.set( LabeledDataSequence::create(comphelper::getProcessComponentContext()), UNO_QUERY ); if( xLabeledSeq.is() ) { if( xValueSeq.is() ) diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx index 97d3a32bca87..1605f8aba05d 100644 --- a/sc/source/filter/inc/xlchart.hxx +++ b/sc/source/filter/inc/xlchart.hxx @@ -57,7 +57,6 @@ class XclRoot; #define SERVICE_CHART2_ERRORBAR "com.sun.star.chart2.ErrorBar" #define SERVICE_CHART2_EXPREGCURVE "com.sun.star.chart2.ExponentialRegressionCurve" #define SERVICE_CHART2_FORMATTEDSTRING "com.sun.star.chart2.FormattedString" -#define SERVICE_CHART2_LABELEDDATASEQ "com.sun.star.chart2.data.LabeledDataSequence" #define SERVICE_CHART2_LEGEND "com.sun.star.chart2.Legend" #define SERVICE_CHART2_LINEARREGCURVE "com.sun.star.chart2.LinearRegressionCurve" #define SERVICE_CHART2_LINEARSCALING "com.sun.star.chart2.LinearScaling" diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 53656cb6c608..5c2dc073949c 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -41,6 +41,7 @@ #include <vcl/svapp.hxx> #include <com/sun/star/beans/UnknownPropertyException.hpp> +#include <com/sun/star/chart2/data/LabeledDataSequence.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/table/CellAddress.hpp> @@ -1071,9 +1072,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_createLabeledDataSequenceFro Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); if ( xContext.is() ) { - xResult.set( xContext->getServiceManager()->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.data.LabeledDataSequence")), - xContext ), uno::UNO_QUERY_THROW ); + xResult.set( chart2::data::LabeledDataSequence::create(xContext), uno::UNO_QUERY_THROW ); } if ( bHasValues ) { diff --git a/sw/inc/unochart.hxx b/sw/inc/unochart.hxx index e40ac8ee05c7..eb480ecd3358 100644 --- a/sw/inc/unochart.hxx +++ b/sw/inc/unochart.hxx @@ -28,7 +28,7 @@ #include <com/sun/star/chart2/data/XDataSequence.hpp> #include <com/sun/star/chart2/data/XTextualDataSequence.hpp> #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp> -#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp> +#include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp> #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp> #include <com/sun/star/chart2/data/DataSequenceRole.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -353,13 +353,11 @@ public: ////////////////////////////////////////////////////////////////////// -typedef cppu::WeakImplHelper6 +typedef cppu::WeakImplHelper4 < - ::com::sun::star::chart2::data::XLabeledDataSequence, - ::com::sun::star::util::XCloneable, + ::com::sun::star::chart2::data::XLabeledDataSequence2, ::com::sun::star::lang::XServiceInfo, ::com::sun::star::util::XModifyListener, - ::com::sun::star::util::XModifyBroadcaster, ::com::sun::star::lang::XComponent > SwChartLabeledDataSequenceBaseClass; 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, |