summaryrefslogtreecommitdiff
path: root/sc
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 /sc
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 'sc')
-rw-r--r--sc/source/filter/excel/xichart.cxx26
-rw-r--r--sc/source/filter/inc/xichart.hxx7
-rw-r--r--sc/source/filter/inc/xlchart.hxx1
3 files changed, 15 insertions, 19 deletions
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index e07d1d4cd1bd..e36a1473e9a9 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -47,6 +47,7 @@
#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>
@@ -1145,9 +1146,9 @@ void XclImpChText::ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeIn
}
}
-Reference< XTitle > XclImpChText::CreateTitle() const
+Reference< css::chart2::XTitle2 > XclImpChText::CreateTitle() const
{
- Reference< XTitle > xTitle;
+ Reference< css::chart2::XTitle2 > xTitle;
if( mxSrcLink && mxSrcLink->HasString() )
{
// create the formatted strings
@@ -1156,16 +1157,13 @@ Reference< XTitle > XclImpChText::CreateTitle() const
if( aStringSeq.hasElements() )
{
// create the title object
- 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 );
- }
+ 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 );
}
}
return xTitle;
@@ -3747,7 +3745,7 @@ void XclImpChAxesSet::ConvertAxis(
if( xChAxisTitle ) try
{
Reference< XTitled > xTitled( xAxis, UNO_QUERY_THROW );
- Reference< XTitle > xTitle( xChAxisTitle->CreateTitle(), UNO_SET_THROW );
+ Reference< css::chart2::XTitle2 > xTitle = xChAxisTitle->CreateTitle();
xTitled->setTitleObject( xTitle );
}
catch( Exception& )
@@ -3937,7 +3935,7 @@ void XclImpChChart::Convert( const Reference<XChartDocument>& xChartDoc,
if( mxTitle ) try
{
Reference< XTitled > xTitled( xChartDoc, UNO_QUERY_THROW );
- Reference< XTitle > xTitle( mxTitle->CreateTitle(), UNO_SET_THROW );
+ Reference< css::chart2::XTitle2 > xTitle = mxTitle->CreateTitle();
xTitled->setTitleObject( xTitle );
}
catch( Exception& )
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index c1a2cbcc57fe..6be2572d1b02 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -61,6 +61,7 @@ namespace com { namespace sun { namespace star {
class XAxis;
class XLegend;
class XTitle;
+ class XTitle2;
class XFormattedString;
namespace data
{
@@ -487,9 +488,6 @@ 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). */
@@ -531,7 +529,8 @@ 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. */
- XTitleRef CreateTitle() const;
+ css::uno::Reference< css::chart2::XTitle2 >
+ 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 2c3a594ed9c7..4e3eb948b522 100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -58,7 +58,6 @@ class XclRoot;
#define SERVICE_CHART2_LINEARREGCURVE "com.sun.star.chart2.LinearRegressionCurve"
#define SERVICE_CHART2_LOGREGCURVE "com.sun.star.chart2.LogarithmicRegressionCurve"
#define SERVICE_CHART2_POTREGCURVE "com.sun.star.chart2.PotentialRegressionCurve"
-#define SERVICE_CHART2_TITLE "com.sun.star.chart2.Title"
// property names
#define EXC_CHPROP_ADDITIONALSHAPES "AdditionalShapes"