From 54013188b24a1a02491a2853f731461253065424 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 8 Jul 2015 15:02:31 +0200 Subject: cleanup some unnecessary direct usage of the OString/OUString C API. Change-Id: I6edee95aae1c169ce70063562a0c1b287e0c4735 Reviewed-on: https://gerrit.libreoffice.org/16861 Tested-by: Jenkins Reviewed-by: Noel Grandin --- writerfilter/source/dmapper/PropertyMap.cxx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index e28953866798..3a30cf3d6afe 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -484,27 +484,22 @@ SectionPropertyMap::~SectionPropertyMap() OUString lcl_FindUnusedPageStyleName(const uno::Sequence< OUString >& rPageStyleNames) { - static const sal_Char cDefaultStyle[] = "Converted"; - //find the hightest number x in each style with the name "cDefaultStyle+x" and + static const char DEFAULT_STYLE[] = "Converted"; + //find the highest number x in each style with the name "DEFAULT_STYLE+x" and //return an incremented name sal_Int32 nMaxIndex = 0; - const sal_Int32 nDefaultLength = sizeof(cDefaultStyle)/sizeof(sal_Char) - 1; - const OUString sDefaultStyle( cDefaultStyle, nDefaultLength, RTL_TEXTENCODING_ASCII_US ); const OUString* pStyleNames = rPageStyleNames.getConstArray(); for( sal_Int32 nStyle = 0; nStyle < rPageStyleNames.getLength(); ++nStyle) { - if( pStyleNames[nStyle].getLength() > nDefaultLength && - !rtl_ustr_compare_WithLength( sDefaultStyle.getStr(), nDefaultLength, pStyleNames[nStyle].getStr(), nDefaultLength)) + if( pStyleNames[nStyle].startsWith(DEFAULT_STYLE) ) { - sal_Int32 nIndex = pStyleNames[nStyle].copy( nDefaultLength ).toInt32(); + sal_Int32 nIndex = pStyleNames[nStyle].copy( strlen(DEFAULT_STYLE) ).toInt32(); if( nIndex > nMaxIndex) nMaxIndex = nIndex; } } - OUString sRet( sDefaultStyle ); - sRet += OUString::number( nMaxIndex + 1); - return sRet; + return DEFAULT_STYLE + OUString::number( nMaxIndex + 1); } -- cgit