diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-17 16:15:09 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-21 08:24:01 +0200 |
commit | d256dbede60533369d1aac64cca34721183f6a8a (patch) | |
tree | de87948686ad1bd88165efe0139bb081517a872e /reportdesign | |
parent | f2bc5c6229e8e72feb3dd887b6d509e52d666c0c (diff) |
fdo#46808, Convert chart2::Title service to new style
API CHANGE: The chart2::XTitled interface now takes and returns
a XTitle2 instead of an XTitle.
Change-Id: I96c35909d3a13f1abb544296a782a0b6a7a58ec6
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/inc/DataProviderHandler.hxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/inspection/DataProviderHandler.cxx | 29 |
2 files changed, 15 insertions, 16 deletions
diff --git a/reportdesign/source/ui/inc/DataProviderHandler.hxx b/reportdesign/source/ui/inc/DataProviderHandler.hxx index f24d1f58e024..7649b5e3dd69 100644 --- a/reportdesign/source/ui/inc/DataProviderHandler.hxx +++ b/reportdesign/source/ui/inc/DataProviderHandler.hxx @@ -95,7 +95,7 @@ namespace rptui bool impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const; bool impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const; - void impl_updateChartTitle_throw(const ::com::sun::star::uno::Any& _aValue); + void impl_updateChartTitle_throw(const OUString& _aValue); // overload WeakComponentImplHelperBase::disposing() // This function is called upon disposing the component, diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index 72842e752278..ae231f76b0f6 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -29,12 +29,12 @@ #include <com/sun/star/inspection/PropertyLineElement.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart2/FormattedString.hpp> +#include <com/sun/star/chart2/Title.hpp> #include <com/sun/star/chart2/XDiagram.hpp> #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> #include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XChartType.hpp> #include <com/sun/star/chart2/XTitled.hpp> -#include <com/sun/star/chart2/XTitle.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/report/XReportDefinition.hpp> @@ -233,27 +233,22 @@ void SAL_CALL DataProviderHandler::setPropertyValue(const OUString & PropertyNam } } // ----------------------------------------------------------------------------- -void DataProviderHandler::impl_updateChartTitle_throw(const uno::Any& _aValue) +void DataProviderHandler::impl_updateChartTitle_throw(const OUString& sStr) { uno::Reference<chart2::XTitled> xTitled(m_xChartModel,uno::UNO_QUERY); if ( xTitled.is() ) { - uno::Reference<chart2::XTitle> xTitle = xTitled->getTitleObject(); + uno::Reference<chart2::XTitle2> xTitle = xTitled->getTitleObject(); if ( !xTitle.is() ) { - xTitle.set(m_xContext->getServiceManager()->createInstanceWithContext(OUString("com.sun.star.chart2.Title"),m_xContext),uno::UNO_QUERY); + xTitle = chart2::Title::create(m_xContext); xTitled->setTitleObject(xTitle); } - if ( xTitle.is() ) - { - uno::Reference< chart2::XFormattedString2> xFormatted = chart2::FormattedString::create(m_xContext); - OUString sStr; - _aValue >>= sStr; - xFormatted->setString(sStr); - uno::Sequence< uno::Reference< chart2::XFormattedString> > aArgs(1); - aArgs[0] = xFormatted; - xTitle->setText(aArgs); - } + uno::Reference< chart2::XFormattedString2> xFormatted = chart2::FormattedString::create(m_xContext); + xFormatted->setString(sStr); + uno::Sequence< uno::Reference< chart2::XFormattedString> > aArgs(1); + aArgs[0] = xFormatted; + xTitle->setText(aArgs); } } @@ -468,7 +463,11 @@ void SAL_CALL DataProviderHandler::actuatingPropertyChanged(const OUString & Act else if ( ActuatingPropertyName == PROPERTY_TITLE ) { if ( NewValue != OldValue ) - impl_updateChartTitle_throw(NewValue); + { + OUString aStr; + NewValue >>= aStr; + impl_updateChartTitle_throw(aStr); + } } else { |