summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-05-23 10:11:49 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-05-23 10:39:21 +0200
commitf30399c540f01f16f097b86ff518251324d558d7 (patch)
treedf07a63621fc81cb3824d3f8b6a00b50dd596387 /reportdesign
parentbf4fb4d4146ca51bd706ef8094adef628f3a48ec (diff)
Revert "fdo#46808, Convert chart2::Title service to new style"
This reverts commit d256dbede60533369d1aac64cca34721183f6a8a: For one, the new css.chart2.XTitle2 looked unfinished, in that it transfered the direct properties of the old-style css.chart2.Title service into attributes, but left out all the properties inherited by the old-style service from css.style.ParagraphProperties, css.drawing.FillProperties, css.drawing.LineProperties (and that missing FIXME css.layout.LayoutElement, whatever that is supposed to be). This needs more thought, to either make available all propertiers as attributes, or none. For another, this broke JunitTest_chart2_unoapi (sch.ChXChartDocument, sch.ChartTitle), for hard-to-debug reasons. Conflicts: chart2/source/model/main/Title.cxx chart2/source/model/main/Title.hxx offapi/com/sun/star/chart2/XTitle2.idl sc/source/filter/inc/xlchart.hxx Change-Id: I4747208a13984904d0e409ea49a73b0f667c86c7
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/ui/inc/DataProviderHandler.hxx2
-rw-r--r--reportdesign/source/ui/inspection/DataProviderHandler.cxx29
2 files changed, 16 insertions, 15 deletions
diff --git a/reportdesign/source/ui/inc/DataProviderHandler.hxx b/reportdesign/source/ui/inc/DataProviderHandler.hxx
index 7649b5e3dd69..f24d1f58e024 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 OUString& _aValue);
+ void impl_updateChartTitle_throw(const ::com::sun::star::uno::Any& _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 ae231f76b0f6..72842e752278 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,22 +233,27 @@ void SAL_CALL DataProviderHandler::setPropertyValue(const OUString & PropertyNam
}
}
// -----------------------------------------------------------------------------
-void DataProviderHandler::impl_updateChartTitle_throw(const OUString& sStr)
+void DataProviderHandler::impl_updateChartTitle_throw(const uno::Any& _aValue)
{
uno::Reference<chart2::XTitled> xTitled(m_xChartModel,uno::UNO_QUERY);
if ( xTitled.is() )
{
- uno::Reference<chart2::XTitle2> xTitle = xTitled->getTitleObject();
+ uno::Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
if ( !xTitle.is() )
{
- xTitle = chart2::Title::create(m_xContext);
+ xTitle.set(m_xContext->getServiceManager()->createInstanceWithContext(OUString("com.sun.star.chart2.Title"),m_xContext),uno::UNO_QUERY);
xTitled->setTitleObject(xTitle);
}
- 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);
+ 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);
+ }
}
}
@@ -463,11 +468,7 @@ void SAL_CALL DataProviderHandler::actuatingPropertyChanged(const OUString & Act
else if ( ActuatingPropertyName == PROPERTY_TITLE )
{
if ( NewValue != OldValue )
- {
- OUString aStr;
- NewValue >>= aStr;
- impl_updateChartTitle_throw(aStr);
- }
+ impl_updateChartTitle_throw(NewValue);
}
else
{