summaryrefslogtreecommitdiff
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
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
-rw-r--r--chart2/source/inc/FormattedStringHelper.hxx4
-rw-r--r--chart2/source/model/main/FormattedString.hxx69
-rw-r--r--chart2/source/tools/FormattedStringHelper.cxx14
-rw-r--r--chart2/source/tools/TitleHelper.cxx36
-rw-r--r--chart2/source/view/inc/LegendEntryProvider.hxx4
-rw-r--r--chart2/source/view/main/VLegend.cxx2
-rw-r--r--offapi/UnoApi_offapi.mk5
-rw-r--r--offapi/com/sun/star/chart2/FormattedString.idl35
-rw-r--r--offapi/com/sun/star/chart2/XFormattedString2.idl48
-rw-r--r--oox/source/drawingml/chart/titleconverter.cxx6
-rw-r--r--reportdesign/source/ui/inspection/DataProviderHandler.cxx6
-rw-r--r--sc/source/filter/excel/xichart.cxx33
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx10
-rw-r--r--sc/source/filter/inc/fapihelper.hxx70
-rw-r--r--sc/source/filter/inc/xlchart.hxx1
15 files changed, 175 insertions, 168 deletions
diff --git a/chart2/source/inc/FormattedStringHelper.hxx b/chart2/source/inc/FormattedStringHelper.hxx
index 0dadc937cea6..cd24645ddd2c 100644
--- a/chart2/source/inc/FormattedStringHelper.hxx
+++ b/chart2/source/inc/FormattedStringHelper.hxx
@@ -19,7 +19,7 @@
#ifndef _CHART2_TOOLS_FORMATTEDSTRINGHELPER_HXX
#define _CHART2_TOOLS_FORMATTEDSTRINGHELPER_HXX
-#include <com/sun/star/chart2/XFormattedString.hpp>
+#include <com/sun/star/chart2/XFormattedString2.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include "charttoolsdllapi.hxx"
@@ -34,7 +34,7 @@ class OOO_DLLPUBLIC_CHARTTOOLS FormattedStringHelper
public:
static ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XFormattedString > >
+ ::com::sun::star::chart2::XFormattedString2 > >
createFormattedStringSequence(
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > & xContext
diff --git a/chart2/source/model/main/FormattedString.hxx b/chart2/source/model/main/FormattedString.hxx
index c88fff0b21f1..90f864b74e9a 100644
--- a/chart2/source/model/main/FormattedString.hxx
+++ b/chart2/source/model/main/FormattedString.hxx
@@ -26,7 +26,7 @@
#include "ServiceMacros.hxx"
#include "ModifyListenerHelper.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/chart2/XFormattedString.hpp>
+#include <com/sun/star/chart2/XFormattedString2.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -36,11 +36,11 @@ namespace chart
namespace impl
{
typedef ::cppu::WeakImplHelper5<
- ::com::sun::star::chart2::XFormattedString,
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::util::XCloneable,
- ::com::sun::star::util::XModifyBroadcaster,
- ::com::sun::star::util::XModifyListener >
+ ::css::chart2::XFormattedString2,
+ ::css::lang::XServiceInfo,
+ ::css::util::XCloneable,
+ ::css::util::XModifyBroadcaster,
+ ::css::util::XModifyListener >
FormattedString_Base;
}
@@ -50,8 +50,8 @@ class FormattedString :
public ::property::OPropertySet
{
public:
- FormattedString( ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext > const & xContext );
+ FormattedString( ::css::uno::Reference<
+ ::css::uno::XComponentContext > const & xContext );
virtual ~FormattedString();
/// declare XServiceInfo methods
@@ -60,52 +60,67 @@ public:
APPHELPER_SERVICE_FACTORY_HELPER( FormattedString )
/// merge XInterface implementations
- DECLARE_XINTERFACE()
+ DECLARE_XINTERFACE()
/// merge XTypeProvider implementations
- DECLARE_XTYPEPROVIDER()
+ DECLARE_XTYPEPROVIDER()
+
+
+ virtual void SAL_CALL setPropertyValue(const OUString& p1, const css::uno::Any& p2) throw (css::uno::RuntimeException)
+ { ::property::OPropertySet::setPropertyValue(p1, p2); }
+ virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& p1) throw (css::uno::RuntimeException)
+ { return ::property::OPropertySet::getPropertyValue(p1); }
+ virtual void SAL_CALL addPropertyChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) throw (css::uno::RuntimeException)
+ { ::property::OPropertySet::addPropertyChangeListener(p1, p2); }
+ virtual void SAL_CALL removePropertyChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) throw (css::uno::RuntimeException)
+ { ::property::OPropertySet::removePropertyChangeListener(p1, p2); }
+ virtual void SAL_CALL addVetoableChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) throw (css::uno::RuntimeException)
+ { ::property::OPropertySet::addVetoableChangeListener(p1, p2); }
+ virtual void SAL_CALL removeVetoableChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) throw (css::uno::RuntimeException)
+ { ::property::OPropertySet::removeVetoableChangeListener(p1, p2); }
+
protected:
explicit FormattedString( const FormattedString & rOther );
// ____ XFormattedString ____
virtual OUString SAL_CALL getString()
- throw (::com::sun::star::uno::RuntimeException);
+ throw (::css::uno::RuntimeException);
virtual void SAL_CALL setString( const OUString& String )
- throw (::com::sun::star::uno::RuntimeException);
+ throw (::css::uno::RuntimeException);
// ____ OPropertySet ____
- virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
- throw(::com::sun::star::beans::UnknownPropertyException);
+ virtual ::css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
+ throw(::css::beans::UnknownPropertyException);
// ____ OPropertySet ____
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
// ____ XPropertySet ____
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
+ virtual ::css::uno::Reference< ::css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo()
- throw (::com::sun::star::uno::RuntimeException);
+ throw (::css::uno::RuntimeException);
// ____ XCloneable ____
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
- throw (::com::sun::star::uno::RuntimeException);
+ virtual ::css::uno::Reference< ::css::util::XCloneable > SAL_CALL createClone()
+ throw (::css::uno::RuntimeException);
// ____ XModifyBroadcaster ____
virtual void SAL_CALL addModifyListener(
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
- throw (::com::sun::star::uno::RuntimeException);
+ const ::css::uno::Reference< ::css::util::XModifyListener >& aListener )
+ throw (::css::uno::RuntimeException);
virtual void SAL_CALL removeModifyListener(
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
- throw (::com::sun::star::uno::RuntimeException);
+ const ::css::uno::Reference< ::css::util::XModifyListener >& aListener )
+ throw (::css::uno::RuntimeException);
// ____ XModifyListener ____
virtual void SAL_CALL modified(
- const ::com::sun::star::lang::EventObject& aEvent )
- throw (::com::sun::star::uno::RuntimeException);
+ const ::css::lang::EventObject& aEvent )
+ throw (::css::uno::RuntimeException);
// ____ XEventListener (base of XModifyListener) ____
virtual void SAL_CALL disposing(
- const ::com::sun::star::lang::EventObject& Source )
- throw (::com::sun::star::uno::RuntimeException);
+ const ::css::lang::EventObject& Source )
+ throw (::css::uno::RuntimeException);
// ____ OPropertySet ____
virtual void firePropertyChangeEvent();
@@ -116,7 +131,7 @@ protected:
private:
OUString m_aString;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
+ ::css::uno::Reference< ::css::util::XModifyListener > m_xModifyEventForwarder;
};
} // namespace chart
diff --git a/chart2/source/tools/FormattedStringHelper.cxx b/chart2/source/tools/FormattedStringHelper.cxx
index 82ad2392bf69..f3a26442954c 100644
--- a/chart2/source/tools/FormattedStringHelper.cxx
+++ b/chart2/source/tools/FormattedStringHelper.cxx
@@ -21,6 +21,7 @@
#include "FormattedStringHelper.hxx"
#include "macros.hxx"
#include "PropertyHelper.hxx"
+#include <com/sun/star/chart2/FormattedString.hpp>
//.............................................................................
namespace chart
@@ -32,27 +33,24 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-Sequence< Reference< chart2::XFormattedString > >
+Sequence< Reference< chart2::XFormattedString2 > >
FormattedStringHelper::createFormattedStringSequence(
const Reference< uno::XComponentContext > & xContext
, const OUString & rString
, const Reference< beans::XPropertySet > & xTextProperties ) throw()
{
- Reference< XFormattedString > xFormStr;
+ Reference< XFormattedString2 > xFormStr;
try
{
if( xContext.is() )
{
- xFormStr.set(
- xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.chart2.FormattedString", xContext ),
- uno::UNO_QUERY_THROW );
+ xFormStr = chart2::FormattedString::create(xContext);
xFormStr->setString( rString );
// set character properties
comphelper::copyProperties(
- xTextProperties, Reference< beans::XPropertySet >( xFormStr, uno::UNO_QUERY ) );
+ xTextProperties, Reference< beans::XPropertySet >( xFormStr, uno::UNO_QUERY_THROW ) );
}
}
catch( const uno::Exception & ex )
@@ -60,7 +58,7 @@ Sequence< Reference< chart2::XFormattedString > >
ASSERT_EXCEPTION( ex );
}
- return Sequence< Reference< XFormattedString > >( & xFormStr, 1 );
+ return Sequence< Reference< XFormattedString2 > >( & xFormStr, 1 );
}
//.............................................................................
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 );
}
}
}
diff --git a/chart2/source/view/inc/LegendEntryProvider.hxx b/chart2/source/view/inc/LegendEntryProvider.hxx
index b9acba38681c..940f884edd22 100644
--- a/chart2/source/view/inc/LegendEntryProvider.hxx
+++ b/chart2/source/view/inc/LegendEntryProvider.hxx
@@ -21,7 +21,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart/ChartLegendExpansion.hpp>
-#include <com/sun/star/chart2/XFormattedString.hpp>
+#include <com/sun/star/chart2/XFormattedString2.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -60,7 +60,7 @@ struct ViewLegendEntry
*/
::com::sun::star::uno::Sequence<
::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XFormattedString > > aLabel;
+ ::com::sun::star::chart2::XFormattedString2 > > aLabel;
};
class LegendEntryProvider
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index 4b7d699d9ab0..2bc9a65895ba 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -168,7 +168,7 @@ awt::Size lcl_createTextShapes(
xTarget->add( xEntry );
// set label text
- Sequence< Reference< XFormattedString > > aLabelSeq = (*aIt).aLabel;
+ Sequence< Reference< XFormattedString2 > > aLabelSeq = (*aIt).aLabel;
for( sal_Int32 i = 0; i < aLabelSeq.getLength(); ++i )
{
// todo: support more than one text range
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 825182a666cc..b500e72e34e8 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -75,6 +75,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/tree,\
MutableTreeNode \
TreeControl \
))
+$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2,\
+ FormattedString \
+))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2/data,\
DatabaseDataProvider \
LabeledDataSequence \
@@ -609,7 +612,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/chart2,
Diagram \
ErrorBar \
ExponentialScaling \
- FormattedString \
GridProperties \
Legend \
LinearScaling \
@@ -2004,6 +2006,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/chart2,\
XDiagram \
XDiagramProvider \
XFormattedString \
+ XFormattedString2 \
XInternalDataProvider \
XLabeled \
XLegend \
diff --git a/offapi/com/sun/star/chart2/FormattedString.idl b/offapi/com/sun/star/chart2/FormattedString.idl
index e4be3c7de08a..e4d80e7ef3a7 100644
--- a/offapi/com/sun/star/chart2/FormattedString.idl
+++ b/offapi/com/sun/star/chart2/FormattedString.idl
@@ -20,40 +20,13 @@
#ifndef com_sun_star_chart2_FormattedString_idl
#define com_sun_star_chart2_FormattedString_idl
-#include <com/sun/star/beans/PropertySet.idl>
-#include <com/sun/star/style/CharacterProperties.idl>
-#include <com/sun/star/style/CharacterPropertiesAsian.idl>
-#include <com/sun/star/style/CharacterPropertiesComplex.idl>
-#include <com/sun/star/chart2/XFormattedString.idl>
+#include <com/sun/star/chart2/XFormattedString2.idl>
-module com
-{
-module sun
-{
-module star
-{
-module chart2
-{
+module com { module sun { module star { module chart2 {
-service FormattedString
-{
- /**
- */
- service com::sun::star::beans::PropertySet;
+service FormattedString : XFormattedString2;
- service ::com::sun::star::style::CharacterProperties;
- [optional] service ::com::sun::star::style::CharacterPropertiesAsian;
- [optional] service ::com::sun::star::style::CharacterPropertiesComplex;
-
- /**
- */
- interface ::com::sun::star::chart2::XFormattedString;
-};
-
-} ; // chart2
-} ; // com
-} ; // sun
-} ; // star
+}; }; }; };
#endif
diff --git a/offapi/com/sun/star/chart2/XFormattedString2.idl b/offapi/com/sun/star/chart2/XFormattedString2.idl
new file mode 100644
index 000000000000..ea80fce260d7
--- /dev/null
+++ b/offapi/com/sun/star/chart2/XFormattedString2.idl
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef com_sun_star_chart2_XFormattedString2_idl
+#define com_sun_star_chart2_XFormattedString2_idl
+
+#include <com/sun/star/beans/XPropertySet.idl>
+#include <com/sun/star/style/CharacterProperties.idl>
+#include <com/sun/star/style/CharacterPropertiesAsian.idl>
+#include <com/sun/star/style/CharacterPropertiesComplex.idl>
+#include <com/sun/star/chart2/XFormattedString.idl>
+
+module com { module sun { module star { module chart2 {
+
+/**
+ Provides unified interface for FormattedString service.
+
+ @since LibreOffice 4.1
+*/
+interface XFormattedString2
+{
+ interface com::sun::star::beans::XPropertySet;
+
+ interface com::sun::star::chart2::XFormattedString;
+
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx
index d71cb977fa0e..32fb37f39f18 100644
--- a/oox/source/drawingml/chart/titleconverter.cxx
+++ b/oox/source/drawingml/chart/titleconverter.cxx
@@ -20,9 +20,9 @@
#include "oox/drawingml/chart/titleconverter.hxx"
#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/XDiagram.hpp>
-#include <com/sun/star/chart2/XFormattedString.hpp>
#include <com/sun/star/chart2/XLegend.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
@@ -117,10 +117,10 @@ Sequence< Reference< XFormattedString > > TextConverter::createStringSequence(
Reference< XFormattedString > TextConverter::appendFormattedString(
::std::vector< Reference< XFormattedString > >& orStringVec, const OUString& rString, bool bAddNewLine ) const
{
- Reference< XFormattedString > xFmtStr;
+ Reference< XFormattedString2 > xFmtStr;
try
{
- xFmtStr.set( ConverterRoot::createInstance( "com.sun.star.chart2.FormattedString" ), UNO_QUERY_THROW );
+ xFmtStr = FormattedString::create( ConverterRoot::getComponentContext() );
xFmtStr->setString( bAddNewLine ? (rString + OUString( sal_Unicode( '\n' ) )) : rString );
orStringVec.push_back( xFmtStr );
}
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index 6b4bb49a9736..72842e752278 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -28,11 +28,11 @@
#include <com/sun/star/inspection/PropertyControlType.hpp>
#include <com/sun/star/inspection/PropertyLineElement.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
+#include <com/sun/star/chart2/FormattedString.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XChartType.hpp>
-#include <com/sun/star/chart2/XFormattedString.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
@@ -246,9 +246,9 @@ void DataProviderHandler::impl_updateChartTitle_throw(const uno::Any& _aValue)
}
if ( xTitle.is() )
{
- uno::Reference< chart2::XFormattedString> xFormatted(m_xContext->getServiceManager()->createInstanceWithContext(OUString("com.sun.star.chart2.FormattedString"),m_xContext),uno::UNO_QUERY);
+ uno::Reference< chart2::XFormattedString2> xFormatted = chart2::FormattedString::create(m_xContext);
OUString sStr;
- _aValue>>= sStr;
+ _aValue >>= sStr;
xFormatted->setString(sStr);
uno::Sequence< uno::Reference< chart2::XFormattedString> > aArgs(1);
aArgs[0] = xFormatted;
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index f783eed1524f..50d36d26c7fa 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -37,6 +37,7 @@
#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
+#include <com/sun/star/chart2/FormattedString.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -875,25 +876,21 @@ Sequence< Reference< XFormattedString > > XclImpChSourceLink::CreateStringSequen
{
for( XclImpStringIterator aIt( *mxString ); aIt.Is(); ++aIt )
{
- Reference< XFormattedString > xFmtStr(
- ScfApiHelper::CreateInstance( SERVICE_CHART2_FORMATTEDSTRING ), UNO_QUERY );
- if( xFmtStr.is() )
- {
- // set text data
- xFmtStr->setString( aIt.GetPortionText() );
-
- // set font formatting and font color
- ScfPropertySet aStringProp( xFmtStr );
- sal_uInt16 nFontIdx = aIt.GetPortionFont();
- if( (nFontIdx == EXC_FONT_NOTFOUND) && (aIt.GetPortionIndex() == 0) )
- // leading unformatted portion - use passed font settings
- rRoot.ConvertFont( aStringProp, nLeadFontIdx, &rLeadFontColor );
- else
- rRoot.ConvertFont( aStringProp, nFontIdx );
+ Reference< css::chart2::XFormattedString2 > xFmtStr = css::chart2::FormattedString::create( comphelper::getProcessComponentContext() );
+ // set text data
+ xFmtStr->setString( aIt.GetPortionText() );
+
+ // set font formatting and font color
+ ScfPropertySet aStringProp( xFmtStr );
+ sal_uInt16 nFontIdx = aIt.GetPortionFont();
+ if( (nFontIdx == EXC_FONT_NOTFOUND) && (aIt.GetPortionIndex() == 0) )
+ // leading unformatted portion - use passed font settings
+ rRoot.ConvertFont( aStringProp, nLeadFontIdx, &rLeadFontColor );
+ else
+ rRoot.ConvertFont( aStringProp, nFontIdx );
- // add string to vector of strings
- aStringVec.push_back( xFmtStr );
- }
+ // add string to vector of strings
+ aStringVec.push_back( xFmtStr );
}
}
return ScfApiHelper::VectorToSequence( aStringVec );
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index 47f35c0d2cf1..3bf0f3e17319 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -56,7 +56,7 @@ using namespace ::com::sun::star;
// Static helper functions ====================================================
-OUString ScfApiHelper::GetServiceName( Reference< XInterface > xInt )
+OUString ScfApiHelper::GetServiceName( const Reference< XInterface >& xInt )
{
OUString aService;
Reference< XServiceName > xServiceName( xInt, UNO_QUERY );
@@ -74,7 +74,7 @@ Reference< XMultiServiceFactory > ScfApiHelper::GetServiceFactory( SfxObjectShel
}
Reference< XInterface > ScfApiHelper::CreateInstance(
- Reference< XMultiServiceFactory > xFactory, const OUString& rServiceName )
+ const Reference< XMultiServiceFactory >& xFactory, const OUString& rServiceName )
{
Reference< XInterface > xInt;
if( xFactory.is() )
@@ -323,9 +323,9 @@ void ScfPropSetHelper::ReadFromPropertySet( const ScfPropertySet& rPropSet )
mnNextIdx = 0;
}
-bool ScfPropSetHelper::ReadValue( UnoAny& rAny )
+bool ScfPropSetHelper::ReadValue( Any& rAny )
{
- UnoAny* pAny = GetNextAny();
+ Any* pAny = GetNextAny();
if( pAny )
rAny = *pAny;
return pAny != 0;
@@ -367,7 +367,7 @@ void ScfPropSetHelper::InitializeWrite( bool bClearAllAnys )
void ScfPropSetHelper::WriteValue( const Any& rAny )
{
- if( UnoAny* pAny = GetNextAny() )
+ if( Any* pAny = GetNextAny() )
*pAny = rAny;
}
diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx
index b4b696af1c7f..1238220d70ec 100644
--- a/sc/source/filter/inc/fapihelper.hxx
+++ b/sc/source/filter/inc/fapihelper.hxx
@@ -46,11 +46,6 @@ class SfxObjectShell;
class ScfApiHelper
{
public:
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > XInterfaceRef;
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > XServiceFactoryRef;
- typedef ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > UnoAnySequence;
-
-public:
/** Converts a tools color to a UNO color value. */
inline static sal_Int32 ConvertToApiColor( const Color& rColor )
{ return static_cast< sal_Int32 >( rColor.GetColor() ); }
@@ -64,23 +59,23 @@ public:
VectorToSequence( const ::std::vector< Type >& rVector );
/** Returns the service name provided via the XServiceName interface, or an empty string on error. */
- static OUString GetServiceName( XInterfaceRef xInt );
+ static OUString GetServiceName( const css::uno::Reference< css::uno::XInterface >& xInt );
/** Returns the multi service factory from a document shell. */
- static XServiceFactoryRef GetServiceFactory( SfxObjectShell* pShell );
+ static css::uno::Reference< css::lang::XMultiServiceFactory > GetServiceFactory( SfxObjectShell* pShell );
/** Creates an instance from the passed service name, using the passed service factory. */
- static XInterfaceRef CreateInstance(
- XServiceFactoryRef xFactory,
+ static css::uno::Reference< css::uno::XInterface > CreateInstance(
+ const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory,
const OUString& rServiceName );
/** Creates an instance from the passed service name, using the service factory of the passed object. */
- static XInterfaceRef CreateInstance(
+ static css::uno::Reference< css::uno::XInterface > CreateInstance(
SfxObjectShell* pShell,
const OUString& rServiceName );
/** Creates an instance from the passed service name, using the process service factory. */
- static XInterfaceRef CreateInstance( const OUString& rServiceName );
+ static css::uno::Reference< css::uno::XInterface > CreateInstance( const OUString& rServiceName );
/** Opens a password dialog and returns the encryption data.
@return The encryption data or an empty sequence on 'Cancel' or any error. */
@@ -116,36 +111,27 @@ template< typename Type >
class ScfPropertySet
{
public:
- typedef ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > XPropertySetRef;
- typedef ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XMultiPropertySet > XMultiPropSetRef;
- typedef ::com::sun::star::uno::Any UnoAny;
- typedef ::com::sun::star::uno::Sequence< UnoAny > UnoAnySequence;
- typedef ::com::sun::star::uno::Sequence< OUString > OUStringSequence;
-
-public:
inline explicit ScfPropertySet() {}
/** Constructs a property set wrapper with the passed UNO property set. */
- inline explicit ScfPropertySet( XPropertySetRef xPropSet ) { Set( xPropSet ); }
+ inline explicit ScfPropertySet( const css::uno::Reference< css::beans::XPropertySet > & xPropSet ) { Set( xPropSet ); }
/** Constructs a property set wrapper after querying the XPropertySet interface. */
template< typename InterfaceType >
- inline explicit ScfPropertySet( ::com::sun::star::uno::Reference< InterfaceType > xInterface ) { Set( xInterface ); }
+ inline explicit ScfPropertySet( const css::uno::Reference< InterfaceType >& xInterface ) { Set( xInterface ); }
~ScfPropertySet();
/** Sets the passed UNO property set and releases the old UNO property set. */
- void Set( XPropertySetRef xPropSet );
+ void Set( css::uno::Reference< css::beans::XPropertySet > xPropSet );
/** Queries the passed interface for an XPropertySet and releases the old UNO property set. */
template< typename InterfaceType >
inline void Set( ::com::sun::star::uno::Reference< InterfaceType > xInterface )
- { Set( XPropertySetRef( xInterface, ::com::sun::star::uno::UNO_QUERY ) ); }
+ { Set( css::uno::Reference< css::beans::XPropertySet >( xInterface, ::com::sun::star::uno::UNO_QUERY ) ); }
/** Returns true, if the contained XPropertySet interface is valid. */
inline bool Is() const { return mxPropSet.is(); }
/** Returns the contained XPropertySet interface. */
- inline XPropertySetRef GetApiPropertySet() const { return mxPropSet; }
+ inline css::uno::Reference< css::beans::XPropertySet > GetApiPropertySet() const { return mxPropSet; }
/** Returns the service name provided via the XServiceName interface, or an empty string on error. */
OUString GetServiceName() const;
@@ -157,13 +143,13 @@ public:
/** Gets the specified property from the property set.
@return true, if the Any could be filled with the property value. */
- bool GetAnyProperty( UnoAny& rValue, const OUString& rPropName ) const;
+ bool GetAnyProperty( css::uno::Any& rValue, const OUString& rPropName ) const;
/** Gets the specified property from the property set.
@return true, if the passed variable could be filled with the property value. */
template< typename Type >
inline bool GetProperty( Type& rValue, const OUString& rPropName ) const
- { UnoAny aAny; return GetAnyProperty( aAny, rPropName ) && (aAny >>= rValue); }
+ { css::uno::Any aAny; return GetAnyProperty( aAny, rPropName ) && (aAny >>= rValue); }
/** Gets the specified Boolean property from the property set.
@return true = property contains true; false = property contains false or error occurred. */
@@ -179,12 +165,12 @@ public:
/** Gets the specified properties from the property set. Tries to use the XMultiPropertySet interface.
@param rPropNames The property names. MUST be ordered alphabetically.
@param rValues The related property values. */
- void GetProperties( UnoAnySequence& rValues, const OUStringSequence& rPropNames ) const;
+ void GetProperties( css::uno::Sequence< css::uno::Any >& rValues, const css::uno::Sequence< OUString >& rPropNames ) const;
// Set properties ---------------------------------------------------------
/** Puts the passed Any into the property set. */
- void SetAnyProperty( const OUString& rPropName, const UnoAny& rValue );
+ void SetAnyProperty( const OUString& rPropName, const css::uno::Any& rValue );
/** Puts the passed value into the property set. */
template< typename Type >
@@ -206,12 +192,12 @@ public:
/** Puts the passed properties into the property set. Tries to use the XMultiPropertySet interface.
@param rPropNames The property names. MUST be ordered alphabetically.
@param rValues The related property values. */
- void SetProperties( const OUStringSequence& rPropNames, const UnoAnySequence& rValues );
+ void SetProperties( const css::uno::Sequence< OUString > & rPropNames, const css::uno::Sequence< css::uno::Any >& rValues );
// ------------------------------------------------------------------------
private:
- XPropertySetRef mxPropSet; /// The mandatory property set interface.
- XMultiPropSetRef mxMultiPropSet; /// The optional multi property set interface.
+ css::uno::Reference< css::beans::XPropertySet > mxPropSet; /// The mandatory property set interface.
+ css::uno::Reference< css::beans::XMultiPropertySet > mxMultiPropSet; /// The optional multi property set interface.
};
// ----------------------------------------------------------------------------
@@ -233,9 +219,6 @@ private:
class ScfPropSetHelper
{
public:
- typedef ::com::sun::star::uno::Any UnoAny;
-
-public:
/** @param ppPropNames A null-terminated array of ASCII property names. */
explicit ScfPropSetHelper( const sal_Char* const* ppcPropNames );
@@ -248,7 +231,7 @@ public:
template< typename Type >
bool ReadValue( Type& rValue );
/** Reads an Any from the value sequence. */
- bool ReadValue( UnoAny& rAny );
+ bool ReadValue( css::uno::Any& rAny );
/** Reads a tools string from the value sequence. */
bool ReadValue( String& rString );
/** Reads a color value from the value sequence. */
@@ -265,7 +248,7 @@ public:
template< typename Type >
void WriteValue( const Type& rValue );
/** Writes an Any to the value sequence. */
- void WriteValue( const UnoAny& rAny );
+ void WriteValue( const css::uno::Any& rAny );
/** Writes a tools string to the value sequence. */
inline void WriteValue( const String& rString )
{ WriteValue( OUString( rString ) ); }
@@ -281,14 +264,11 @@ public:
// ------------------------------------------------------------------------
private:
/** Returns a pointer to the next Any to be written to. */
- UnoAny* GetNextAny();
+ css::uno::Any* GetNextAny();
private:
- typedef ::com::sun::star::uno::Sequence< OUString > OUStringSequence;
- typedef ::com::sun::star::uno::Sequence< UnoAny > UnoAnySequence;
-
- OUStringSequence maNameSeq; /// Sequence of property names.
- UnoAnySequence maValueSeq; /// Sequence of property values.
+ css::uno::Sequence< OUString > maNameSeq; /// Sequence of property names.
+ css::uno::Sequence< css::uno::Any > maValueSeq; /// Sequence of property values.
ScfInt32Vec maNameOrder; /// Maps initial order to alphabetical order.
size_t mnNextIdx; /// Counter for next Any to be processed.
};
@@ -298,14 +278,14 @@ private:
template< typename Type >
bool ScfPropSetHelper::ReadValue( Type& rValue )
{
- UnoAny* pAny = GetNextAny();
+ css::uno::Any* pAny = GetNextAny();
return pAny && (*pAny >>= rValue);
}
template< typename Type >
void ScfPropSetHelper::WriteValue( const Type& rValue )
{
- UnoAny* pAny = GetNextAny();
+ css::uno::Any* pAny = GetNextAny();
if( pAny )
*pAny <<= rValue;
}
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 0df3408de43f..9743bee767ce 100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -56,7 +56,6 @@ class XclRoot;
#define SERVICE_CHART2_DIAGRAM "com.sun.star.chart2.Diagram"
#define SERVICE_CHART2_ERRORBAR "com.sun.star.chart2.ErrorBar"
#define SERVICE_CHART2_EXPREGCURVE "com.sun.star.chart2.ExponentialRegressionCurve"
-#define SERVICE_CHART2_FORMATTEDSTRING "com.sun.star.chart2.FormattedString"
#define SERVICE_CHART2_LEGEND "com.sun.star.chart2.Legend"
#define SERVICE_CHART2_LINEARREGCURVE "com.sun.star.chart2.LinearRegressionCurve"
#define SERVICE_CHART2_LINEARSCALING "com.sun.star.chart2.LinearScaling"