diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-22 09:49:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-22 17:15:34 +0000 |
commit | 53a3d028e6931e4443cfe8cdf18909f6bfd8e2f4 (patch) | |
tree | f87ce03db44c09a9e3ce721e30cb1b6d6613a116 /chart2/source/tools | |
parent | f02ec0d8489404966596cb0e949bf969e8e66fa2 (diff) |
use more concrete type in chart2
Change-Id: I568530c1db0add697f7f257a4e5560a3e50919f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149290
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools')
-rw-r--r-- | chart2/source/tools/FormattedStringHelper.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/chart2/source/tools/FormattedStringHelper.cxx b/chart2/source/tools/FormattedStringHelper.cxx index 60669a9f979f..3cfc04c34dcc 100644 --- a/chart2/source/tools/FormattedStringHelper.cxx +++ b/chart2/source/tools/FormattedStringHelper.cxx @@ -18,6 +18,7 @@ */ #include <FormattedStringHelper.hxx> +#include <FormattedString.hxx> #include <com/sun/star/chart2/FormattedString.hpp> #include <comphelper/diagnose_ex.hxx> #include <comphelper/property.hxx> @@ -30,32 +31,28 @@ using namespace ::com::sun::star::chart2; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -Sequence< Reference< chart2::XFormattedString2 > > +std::vector< rtl::Reference< ::chart::FormattedString > > FormattedStringHelper::createFormattedStringSequence( - const Reference< uno::XComponentContext > & xContext - , const OUString & rString + const OUString & rString , const Reference< beans::XPropertySet > & xTextProperties ) noexcept { - Reference< XFormattedString2 > xFormStr; + rtl::Reference< FormattedString > xFormStr; try { - if( xContext.is() ) - { - xFormStr = chart2::FormattedString::create(xContext); + xFormStr = new FormattedString(); - xFormStr->setString( rString ); + xFormStr->setString( rString ); - // set character properties - comphelper::copyProperties( - xTextProperties, Reference< beans::XPropertySet >( xFormStr, uno::UNO_QUERY_THROW ) ); - } + // set character properties + comphelper::copyProperties( + xTextProperties, Reference< beans::XPropertySet >( static_cast<cppu::OWeakObject*>(xFormStr.get()), uno::UNO_QUERY_THROW ) ); } catch( const uno::Exception & ) { DBG_UNHANDLED_EXCEPTION("chart2"); } - return Sequence< Reference< XFormattedString2 > >( & xFormStr, 1 ); + return { xFormStr }; } } //namespace chart |