diff options
Diffstat (limited to 'chart2/source/tools/ObjectIdentifier.cxx')
-rw-r--r-- | chart2/source/tools/ObjectIdentifier.cxx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index ad98d645170f..0952effbbf86 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -155,20 +155,15 @@ rtl::Reference<ChartType> lcl_getFirstStockChartType( const rtl::Reference<::cha OUString lcl_getIndexStringAfterString( const OUString& rString, const OUString& rSearchString ) { - OUStringBuffer aRet; - sal_Int32 nIndexStart = rString.lastIndexOf( rSearchString ); - if( nIndexStart != -1 ) - { - nIndexStart += rSearchString.getLength(); - sal_Int32 nIndexEnd = rString.getLength(); - sal_Int32 nNextColon = rString.indexOf( ':', nIndexStart ); - if( nNextColon != -1 ) - nIndexEnd = nNextColon; - aRet = rString.subView(nIndexStart,nIndexEnd-nIndexStart); - } - - return aRet.makeStringAndClear(); + if( nIndexStart == -1 ) + return OUString(); + nIndexStart += rSearchString.getLength(); + sal_Int32 nIndexEnd = rString.getLength(); + sal_Int32 nNextColon = rString.indexOf( ':', nIndexStart ); + if( nNextColon != -1 ) + nIndexEnd = nNextColon; + return rString.copy(nIndexStart,nIndexEnd-nIndexStart); } sal_Int32 lcl_StringToIndex( std::u16string_view rIndexString ) |