From 857742d60f579826cbd0ca5a5336348484714b2c Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 15 Dec 2014 10:21:19 +0100 Subject: writerfilter: Use appropriate OUString functions on string constants Change-Id: I113dba36c8c6a15f93fb4f15cd85ddb07ce5eecf --- writerfilter/source/dmapper/StyleSheetTable.cxx | 7 +++---- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'writerfilter/source') diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 89e00d9a8476..dcdad731d92a 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -1576,9 +1576,9 @@ OUString StyleSheetTable::getOrCreateCharStyle( PropertyValueVector_t& rCharProp const OUString* pStyleNames = aStyleNames.getConstArray(); for( sal_Int32 nStyle = 0; nStyle < aStyleNames.getLength(); ++nStyle ) { - if( pStyleNames[nStyle].matchAsciiL( cListLabel, sizeof( cListLabel ) - 1 )) + OUString sSuffix; + if( pStyleNames[nStyle].startsWith( cListLabel, &sSuffix ) ) { - OUString sSuffix = pStyleNames[nStyle].copy( sizeof( cListLabel ) - 1 ); sal_Int32 nSuffix = sSuffix.toInt32(); if( nSuffix > 0 ) { @@ -1587,8 +1587,7 @@ OUString StyleSheetTable::getOrCreateCharStyle( PropertyValueVector_t& rCharProp } } } - sListLabel = OUString::createFromAscii( cListLabel ); - sListLabel += OUString::number( ++nStyleFound ); + sListLabel = cListLabel + OUString::number( ++nStyleFound ); //create a new one otherwise uno::Reference< lang::XMultiServiceFactory > xDocFactory( m_pImpl->m_xTextDocument, uno::UNO_QUERY_THROW ); PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier(); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 8793529e10f1..fd5d02bb6818 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1153,7 +1153,7 @@ void RTFDocumentImpl::text(OUString& rString) { // ; is the end of the entry bool bEnd = false; - if (rString.endsWithAsciiL(";", 1)) + if (rString.endsWith(";")) { rString = rString.copy(0, rString.getLength() - 1); bEnd = true; -- cgit