diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-05-23 10:11:49 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-05-23 10:39:21 +0200 |
commit | f30399c540f01f16f097b86ff518251324d558d7 (patch) | |
tree | df07a63621fc81cb3824d3f8b6a00b50dd596387 /sc | |
parent | bf4fb4d4146ca51bd706ef8094adef628f3a48ec (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 'sc')
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 26 | ||||
-rw-r--r-- | sc/source/filter/inc/xichart.hxx | 7 | ||||
-rw-r--r-- | sc/source/filter/inc/xlchart.hxx | 1 |
3 files changed, 19 insertions, 15 deletions
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index d5cd1310e3e3..83f73a9b4cc3 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -51,7 +51,6 @@ #include <com/sun/star/chart2/LinearScaling.hpp> #include <com/sun/star/chart2/PolarCoordinateSystem2d.hpp> #include <com/sun/star/chart2/PolarCoordinateSystem3d.hpp> -#include <com/sun/star/chart2/Title.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/XDiagram.hpp> #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> @@ -1129,9 +1128,9 @@ void XclImpChText::ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeIn } } -Reference< css::chart2::XTitle2 > XclImpChText::CreateTitle() const +Reference< XTitle > XclImpChText::CreateTitle() const { - Reference< css::chart2::XTitle2 > xTitle; + Reference< XTitle > xTitle; if( mxSrcLink && mxSrcLink->HasString() ) { // create the formatted strings @@ -1140,13 +1139,16 @@ Reference< css::chart2::XTitle2 > XclImpChText::CreateTitle() const if( aStringSeq.hasElements() ) { // create the title object - xTitle = css::chart2::Title::create( comphelper::getProcessComponentContext() ); - // set the formatted strings - xTitle->setText( aStringSeq ); - // more title formatting properties - ScfPropertySet aTitleProp( xTitle ); - ConvertFrame( aTitleProp ); - ConvertRotation( aTitleProp, true ); + xTitle.set( ScfApiHelper::CreateInstance( SERVICE_CHART2_TITLE ), UNO_QUERY ); + if( xTitle.is() ) + { + // set the formatted strings + xTitle->setText( aStringSeq ); + // more title formatting properties + ScfPropertySet aTitleProp( xTitle ); + ConvertFrame( aTitleProp ); + ConvertRotation( aTitleProp, true ); + } } } return xTitle; @@ -3725,7 +3727,7 @@ void XclImpChAxesSet::ConvertAxis( if( xChAxisTitle ) try { Reference< XTitled > xTitled( xAxis, UNO_QUERY_THROW ); - Reference< css::chart2::XTitle2 > xTitle = xChAxisTitle->CreateTitle(); + Reference< XTitle > xTitle( xChAxisTitle->CreateTitle(), UNO_SET_THROW ); xTitled->setTitleObject( xTitle ); } catch( Exception& ) @@ -3915,7 +3917,7 @@ void XclImpChChart::Convert( const Reference<XChartDocument>& xChartDoc, if( mxTitle ) try { Reference< XTitled > xTitled( xChartDoc, UNO_QUERY_THROW ); - Reference< css::chart2::XTitle2 > xTitle = mxTitle->CreateTitle(); + Reference< XTitle > xTitle( mxTitle->CreateTitle(), UNO_SET_THROW ); xTitled->setTitleObject( xTitle ); } catch( Exception& ) diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index 6be2572d1b02..c1a2cbcc57fe 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -61,7 +61,6 @@ namespace com { namespace sun { namespace star { class XAxis; class XLegend; class XTitle; - class XTitle2; class XFormattedString; namespace data { @@ -488,6 +487,9 @@ typedef boost::shared_ptr< XclImpChFont > XclImpChFontRef; class XclImpChText : public XclImpChGroupBase, public XclImpChFontBase, protected XclImpChRoot { public: + typedef ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle > XTitleRef; + +public: explicit XclImpChText( const XclImpChRoot& rRoot ); /** Reads the CHTEXT record (called by base class). */ @@ -529,8 +531,7 @@ public: /** Converts and writes all contained data to the passed data point label property set. */ void ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeInfo& rTypeInfo ) const; /** Creates a title text object. */ - css::uno::Reference< css::chart2::XTitle2 > - CreateTitle() const; + XTitleRef CreateTitle() const; /** Converts the manual position of the specified title */ void ConvertTitlePosition( const XclChTextKey& rTitleKey ) const; diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx index 828d67795dfe..dff5c227d28b 100644 --- a/sc/source/filter/inc/xlchart.hxx +++ b/sc/source/filter/inc/xlchart.hxx @@ -54,6 +54,7 @@ class XclRoot; #define SERVICE_CHART2_DIAGRAM "com.sun.star.chart2.Diagram" #define SERVICE_CHART2_ERRORBAR "com.sun.star.chart2.ErrorBar" #define SERVICE_CHART2_LEGEND "com.sun.star.chart2.Legend" +#define SERVICE_CHART2_TITLE "com.sun.star.chart2.Title" // property names #define EXC_CHPROP_ADDITIONALSHAPES "AdditionalShapes" |