summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-10 12:42:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-10 15:53:13 +0200
commit43a6b59539ad573436f43303e9fbe17c12dc9c84 (patch)
tree24cbf3a9fc84ad38e17ed92ed0a50db48f20f2c5 /xmloff
parentf2a1298ea409141a9190c7789b39546644084980 (diff)
simplify some OUString compareTo calls
to either startsWith or == or != Change-Id: Ie4b4662f5b8e4532cbc1ab36910389e0b3d41ef0 Reviewed-on: https://gerrit.libreoffice.org/39750 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/ximpstyl.cxx6
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx2
-rw-r--r--xmloff/source/text/txtflde.cxx2
-rw-r--r--xmloff/source/text/txtimp.cxx2
4 files changed, 6 insertions, 6 deletions
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index a9cbc922ec0d..5ec90505c443 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -1261,7 +1261,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
if( nPrefLen )
{
sal_Int32 nStylePrefLen = aStyleName.lastIndexOf( '-' ) + 1;
- if( (nPrefLen != nStylePrefLen) || (aStyleName.compareTo( rPrefix, nPrefLen ) != 0) )
+ if( (nPrefLen != nStylePrefLen) || !aStyleName.startsWith(rPrefix) )
continue;
aStyleName = aStyleName.copy( nPrefLen );
@@ -1357,7 +1357,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
if( nPrefLen )
{
sal_Int32 nStylePrefLen = aStyleName.lastIndexOf( '-' ) + 1;
- if( (nPrefLen != nStylePrefLen) || (aStyleName.compareTo( rPrefix, nPrefLen ) != 0) )
+ if( (nPrefLen != nStylePrefLen) || !aStyleName.startsWith( rPrefix ) )
continue;
aStyleName = aStyleName.copy( nPrefLen );
@@ -1371,7 +1371,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
if( nPrefLen )
{
sal_Int32 nStylePrefLen = sParentStyleDisplayName.lastIndexOf( '-' ) + 1;
- if( (nPrefLen != nStylePrefLen) || (sParentStyleDisplayName.compareTo( rPrefix, nPrefLen ) != 0) )
+ if( (nPrefLen != nStylePrefLen) || !sParentStyleDisplayName.startsWith( rPrefix ) )
continue;
sParentStyleDisplayName = sParentStyleDisplayName.copy( nPrefLen );
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index c11222ff1c9b..4f332d25ab1c 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -988,7 +988,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
const sal_Int32 nRotateLen(aRotate.getLength());
sal_Int32 nLen = sValue.getLength();
if( nLen >= nRotateLen+3 &&
- 0 == sValue.compareTo( aRotate, nRotateLen ) &&
+ sValue.startsWith(aRotate) &&
'(' == sValue[nRotateLen] &&
')' == sValue[nLen-1] )
{
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 713b2621a9bc..e6cf61577327 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -390,7 +390,7 @@ enum FieldIdEnum XMLTextFieldExport::GetFieldID(
// search for TextField service name
while( nCount2-- )
{
- if( 0 == pNames2->compareTo(sPresentationServicePrefix, sPresentationServicePrefix.getLength()))
+ if( pNames2->startsWith(sPresentationServicePrefix) )
{
// TextField found => postfix is field type!
sFieldName = pNames2->copy(sPresentationServicePrefix.getLength());
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index b2653f152871..0bc0c9617473 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -2597,7 +2597,7 @@ bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange(
o_rpRDFaAttributes = std::get<2>(rEntry);
m_xImpl->m_BookmarkStartRanges.erase(sName);
auto it(m_xImpl->m_BookmarkVector.begin());
- while (it != m_xImpl->m_BookmarkVector.end() && it->compareTo(sName)!=0)
+ while (it != m_xImpl->m_BookmarkVector.end() && *it != sName)
{
++it;
}