summaryrefslogtreecommitdiff
path: root/chart2/source/tools/TitleHelper.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-09 11:12:06 +0200
committerNoel Grandin <noel@peralex.com>2013-05-13 09:38:03 +0200
commit5d1ad167294878789e644452f23ef883af93fe87 (patch)
tree8f8e14de156eb20e5843e7458502b58828c258a9 /chart2/source/tools/TitleHelper.cxx
parent39ab9c4e4f4fb26326d8b1f08e4ef45cbe268cfb (diff)
fdo#46808 Convert chart2::FormattedString service to new style
API CHANGE: dropped the following services from the new unified interface because the current service does not implement them. service ::com::sun::star::style::CharacterProperties; [optional] service ::com::sun::star::style::CharacterPropertiesAsian; [optional] service ::com::sun::star::style::CharacterPropertiesComplex; Change-Id: I7cb6a5d4e998975b1272f4f4da03feea30cd30b6
Diffstat (limited to 'chart2/source/tools/TitleHelper.cxx')
-rw-r--r--chart2/source/tools/TitleHelper.cxx36
1 files changed, 15 insertions, 21 deletions
diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx
index c5b74b54fcd9..a8a0b0074990 100644
--- a/chart2/source/tools/TitleHelper.cxx
+++ b/chart2/source/tools/TitleHelper.cxx
@@ -22,6 +22,7 @@
#include "macros.hxx"
#include "AxisHelper.hxx"
#include "DiagramHelper.hxx"
+#include <com/sun/star/chart2/FormattedString.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <rtl/ustrbuf.hxx>
@@ -300,30 +301,23 @@ void TitleHelper::setCompleteString( const OUString& rNewText
}
else
{
- uno::Reference< uno::XInterface > xI(
- xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.chart2.FormattedString", xContext ) );
- uno::Reference< XFormattedString > xFormattedString( xI, uno::UNO_QUERY );
+ uno::Reference< chart2::XFormattedString2 > xFormattedString =
+ chart2::FormattedString::create( xContext );
- if(xFormattedString.is())
+ xFormattedString->setString( aNewText );
+ aNewStringList[0].set( xFormattedString );
+ if( pDefaultCharHeight != 0 )
{
- xFormattedString->setString( aNewText );
- aNewStringList[0].set( xFormattedString );
- if( pDefaultCharHeight != 0 )
+ try
{
- try
- {
- uno::Reference< beans::XPropertySet > xProp( xFormattedString, uno::UNO_QUERY_THROW );
-
- uno::Any aFontSize( uno::makeAny( *pDefaultCharHeight ));
- xProp->setPropertyValue( "CharHeight", aFontSize );
- xProp->setPropertyValue( "CharHeightAsian", aFontSize );
- xProp->setPropertyValue( "CharHeightComplex", aFontSize );
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
+ uno::Any aFontSize( uno::makeAny( *pDefaultCharHeight ));
+ xFormattedString->setPropertyValue( "CharHeight", aFontSize );
+ xFormattedString->setPropertyValue( "CharHeightAsian", aFontSize );
+ xFormattedString->setPropertyValue( "CharHeightComplex", aFontSize );
+ }
+ catch( const uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
}
}
}