summaryrefslogtreecommitdiff
path: root/svtools
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 /svtools
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 'svtools')
-rw-r--r--svtools/source/dialogs/PlaceEditDialog.cxx9
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx2
-rw-r--r--svtools/source/svhtml/htmlkywd.cxx2
-rw-r--r--svtools/source/svhtml/htmlout.cxx5
4 files changed, 7 insertions, 11 deletions
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 8305ea557b94..031edde3755a 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -226,13 +226,10 @@ IMPL_LINK( PlaceEditDialog, OKHdl, Button*, /*pBtn*/, void)
if ( m_xCurrentDetails.get() )
{
OUString sUrl = m_xCurrentDetails->getUrl().GetHost( INetURLObject::DecodeMechanism::WithCharset );
- OUString sGDriveHost( GDRIVE_BASE_URL );
- OUString sAlfrescoHost( ALFRESCO_CLOUD_BASE_URL );
- OUString sOneDriveHost( ONEDRIVE_BASE_URL );
- if ( sUrl.compareTo( sGDriveHost, sGDriveHost.getLength() ) == 0
- || sUrl.compareTo( sAlfrescoHost, sAlfrescoHost.getLength() ) == 0
- || sUrl.compareTo( sOneDriveHost, sOneDriveHost.getLength() ) == 0 )
+ if ( sUrl.startsWith( GDRIVE_BASE_URL )
+ || sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL )
+ || sUrl.startsWith( ONEDRIVE_BASE_URL ) )
{
m_pBTRepoRefresh->Click();
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index f35d174df05c..6262bcdee23b 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -853,7 +853,7 @@ void AssignmentPersistentData::ImplCommit()
for (;pTableNames != pEnd; ++pTableNames)
{
m_pTable->InsertEntry(*pTableNames);
- if (0 == pTableNames->compareTo(sOldTable))
+ if (*pTableNames == sOldTable)
bKnowOldTable = true;
}
diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx
index b345a48e5cfc..de34418d37ce 100644
--- a/svtools/source/svhtml/htmlkywd.cxx
+++ b/svtools/source/svhtml/htmlkywd.cxx
@@ -200,7 +200,7 @@ HtmlTokenId GetHTMLToken( const OUString& rName )
HtmlTokenId nRet = HtmlTokenId::NONE;
- if( !rName.compareTo( OOO_STRING_SVTOOLS_HTML_comment, 3 ) )
+ if( rName.startsWith( OOO_STRING_SVTOOLS_HTML_comment ))
return HtmlTokenId::COMMENT;
void* pFound;
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index c52207e10f32..f3993cba8dbe 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -980,10 +980,9 @@ OString HTMLOutFuncs::CreateTableDataOptionsValNum(
bool HTMLOutFuncs::PrivateURLToInternalImg( OUString& rURL )
{
- if( rURL.getLength() > 14 &&
- rURL.compareTo( OOO_STRING_SVTOOLS_HTML_private_image, 14 ) == 0 )
+ if( rURL.startsWith(OOO_STRING_SVTOOLS_HTML_private_image) )
{
- rURL = rURL.copy( 14 );
+ rURL = rURL.copy( strlen(OOO_STRING_SVTOOLS_HTML_private_image) );
return true;
}