From d28f2cfcce9d551c88b2a45df840788797163db6 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 23 May 2013 10:11:49 +0200 Subject: 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 (cherry picked from commit f30399c540f01f16f097b86ff518251324d558d7) Conflicts: sc/source/filter/inc/xlchart.hxx Change-Id: I4747208a13984904d0e409ea49a73b0f667c86c7 --- oox/source/drawingml/chart/converterbase.cxx | 9 +++++---- oox/source/drawingml/chart/titleconverter.cxx | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'oox') diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index 67f0a68a05d6..65d813d307c2 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -72,7 +71,7 @@ struct TitleLayoutInfo { typedef Reference< XShape > (*GetShapeFunc)( const Reference< cssc::XChartDocument >& ); - Reference< XTitle2 > mxTitle; /// The API title object. + Reference< XTitle > mxTitle; /// The API title object. ModelRef< LayoutModel > mxLayout; /// The layout model, if existing. GetShapeFunc mpGetShape; /// Helper function to receive the title shape. @@ -90,7 +89,9 @@ void TitleLayoutInfo::convertTitlePos( ConverterRoot& rRoot, const Reference< cs // try to get the title shape Reference< XShape > xTitleShape( mpGetShape( rxChart1Doc ), UNO_SET_THROW ); // get title rotation angle, needed for correction of position of top-left edge - double fAngle = mxTitle->getTextRotation(); + double fAngle = 0.0; + PropertySet aTitleProp( mxTitle ); + aTitleProp.getProperty( fAngle, PROP_TextRotation ); // convert the position LayoutModel& rLayout = mxLayout.getOrCreate(); LayoutConverter aLayoutConv( rRoot, rLayout ); @@ -270,7 +271,7 @@ ObjectFormatter& ConverterRoot::getFormatter() const return mxData->maFormatter; } -void ConverterRoot::registerTitleLayout( const Reference< XTitle2 >& rxTitle, +void ConverterRoot::registerTitleLayout( const Reference< XTitle >& rxTitle, const ModelRef< LayoutModel >& rxLayout, ObjectType eObjType, sal_Int32 nMainIdx, sal_Int32 nSubIdx ) { OSL_ENSURE( rxTitle.is(), "ConverterRoot::registerTitleLayout - missing title object" ); diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx index c34ad9a663f3..32fb37f39f18 100644 --- a/oox/source/drawingml/chart/titleconverter.cxx +++ b/oox/source/drawingml/chart/titleconverter.cxx @@ -22,9 +22,9 @@ #include #include #include -#include #include #include +#include #include #include "oox/drawingml/textbody.hxx" #include "oox/drawingml/textparagraph.hxx" @@ -152,7 +152,7 @@ void TitleConverter::convertFromModel( const Reference< XTitled >& rxTitled, con if( aStringSeq.hasElements() ) try { // create the title object and set the string data - Reference< XTitle2 > xTitle = Title::create( getComponentContext() ); + Reference< XTitle > xTitle( createInstance( "com.sun.star.chart2.Title" ), UNO_QUERY_THROW ); xTitle->setText( aStringSeq ); rxTitled->setTitleObject( xTitle ); -- cgit