From 53a3d028e6931e4443cfe8cdf18909f6bfd8e2f4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 22 Mar 2023 09:49:34 +0200 Subject: 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 --- chart2/source/view/main/VLegend.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'chart2/source/view/main') diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index 061cbb39976d..27bf869b8663 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -160,22 +161,22 @@ awt::Size lcl_createTextShapes( try { OUString aLabelString; - Sequence< Reference< XFormattedString2 > > aLabelSeq = rEntry.aLabel; - for( sal_Int32 i = 0; i < aLabelSeq.getLength(); ++i ) + const std::vector< rtl::Reference< ::chart::FormattedString > > & rLabelSeq = rEntry.aLabel; + for( size_t i = 0; i < rLabelSeq.size(); ++i ) { // todo: support more than one text range if( i == 1 ) break; // tdf#150034 limit legend label text - if (aLabelSeq[i]->getString().getLength() > 520) + if (rLabelSeq[i]->getString().getLength() > 520) { - sal_Int32 nIndex = aLabelSeq[i]->getString().indexOf(' ', 500); - aLabelSeq[i]->setString( - aLabelSeq[i]->getString().copy(0, nIndex > 500 ? nIndex : 500)); + sal_Int32 nIndex = rLabelSeq[i]->getString().indexOf(' ', 500); + rLabelSeq[i]->setString( + rLabelSeq[i]->getString().copy(0, nIndex > 500 ? nIndex : 500)); } - aLabelString += aLabelSeq[i]->getString(); + aLabelString += rLabelSeq[i]->getString(); // workaround for Issue #i67540# if( aLabelString.isEmpty()) aLabelString = " "; -- cgit