summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-17 16:15:09 +0200
committerNoel Grandin <noel@peralex.com>2013-05-21 08:24:01 +0200
commitd256dbede60533369d1aac64cca34721183f6a8a (patch)
treede87948686ad1bd88165efe0139bb081517a872e /oox
parentf2bc5c6229e8e72feb3dd887b6d509e52d666c0c (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 'oox')
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx9
-rw-r--r--oox/source/drawingml/chart/titleconverter.cxx4
2 files changed, 6 insertions, 7 deletions
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index 65d813d307c2..67f0a68a05d6 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -26,6 +26,7 @@
#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>
@@ -71,7 +72,7 @@ struct TitleLayoutInfo
{
typedef Reference< XShape > (*GetShapeFunc)( const Reference< cssc::XChartDocument >& );
- Reference< XTitle > mxTitle; /// The API title object.
+ Reference< XTitle2 > mxTitle; /// The API title object.
ModelRef< LayoutModel > mxLayout; /// The layout model, if existing.
GetShapeFunc mpGetShape; /// Helper function to receive the title shape.
@@ -89,9 +90,7 @@ 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 = 0.0;
- PropertySet aTitleProp( mxTitle );
- aTitleProp.getProperty( fAngle, PROP_TextRotation );
+ double fAngle = mxTitle->getTextRotation();
// convert the position
LayoutModel& rLayout = mxLayout.getOrCreate();
LayoutConverter aLayoutConv( rRoot, rLayout );
@@ -271,7 +270,7 @@ ObjectFormatter& ConverterRoot::getFormatter() const
return mxData->maFormatter;
}
-void ConverterRoot::registerTitleLayout( const Reference< XTitle >& rxTitle,
+void ConverterRoot::registerTitleLayout( const Reference< XTitle2 >& 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 32fb37f39f18..c34ad9a663f3 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< XTitle > xTitle( createInstance( "com.sun.star.chart2.Title" ), UNO_QUERY_THROW );
+ Reference< XTitle2 > xTitle = Title::create( getComponentContext() );
xTitle->setText( aStringSeq );
rxTitled->setTitleObject( xTitle );