summaryrefslogtreecommitdiff
path: root/oox
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:41:41 +0200
commitd28f2cfcce9d551c88b2a45df840788797163db6 (patch)
tree556f8ea4157102e8c04412213f8f045f41b0231d /oox
parent3fb3e22f9f0d4626671c477763c998973f1e0b6a (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 (cherry picked from commit f30399c540f01f16f097b86ff518251324d558d7) Conflicts: sc/source/filter/inc/xlchart.hxx Change-Id: I4747208a13984904d0e409ea49a73b0f667c86c7
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx9
-rw-r--r--oox/source/drawingml/chart/titleconverter.cxx4
2 files changed, 7 insertions, 6 deletions
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 <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
-#include <com/sun/star/chart2/XTitle2.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -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 <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/FormattedString.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/Title.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XLegend.hpp>
+#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#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 );