summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-07-08 15:02:31 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-07-10 08:09:00 +0000
commit54013188b24a1a02491a2853f731461253065424 (patch)
tree45078e1deb8bdfdde79a431daa81fde7c47621ad /writerfilter
parentfd2749455fe25e24b448a44f9ada6113e5ac0d13 (diff)
cleanup some unnecessary direct usage of the OString/OUString C API.
Change-Id: I6edee95aae1c169ce70063562a0c1b287e0c4735 Reviewed-on: https://gerrit.libreoffice.org/16861 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx15
1 files changed, 5 insertions, 10 deletions
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);
}