summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Dryomov <artur.dryomov@gmail.com>2013-04-16 19:33:24 +0300
committerThomas Arnhold <thomas@arnhold.org>2013-04-17 10:01:35 +0000
commitb80d8c695e6b6ded231e67ed9a80bcd1f1250c03 (patch)
treefbd2686e52603d484b12a836db2f8fb33ff79c32
parentc75eeddfb892918c13a19f7c534b73e423ff8d89 (diff)
fdo#62096 - replace some O(U)String compareTo with ==
Change-Id: I98d04d7da4c2b7ea0b769df9c2bfa8c1ad86bf2d Reviewed-on: https://gerrit.libreoffice.org/3422 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
-rw-r--r--package/source/xstor/xfactory.cxx2
-rw-r--r--package/source/zippackage/zipfileaccess.cxx2
-rw-r--r--sal/workben/testfile.cxx2
-rw-r--r--sd/source/ui/remotecontrol/DiscoveryService.cxx2
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx12
-rw-r--r--sfx2/source/appl/xpackcreator.cxx2
-rw-r--r--sfx2/source/doc/ownsubfilterservice.cxx2
-rw-r--r--sot/source/unoolestorage/xolesimplestorage.cxx2
-rw-r--r--svtools/source/hatchwindow/documentcloser.cxx2
-rw-r--r--svtools/source/hatchwindow/hatchwindowfactory.cxx2
-rw-r--r--svx/source/form/datanavi.cxx8
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java4
-rw-r--r--vcl/generic/fontmanager/fontcache.cxx8
-rw-r--r--vcl/unx/generic/dtrans/X11_clipboard.cxx2
-rw-r--r--vcl/unx/generic/dtrans/X11_droptarget.cxx2
-rw-r--r--vcl/unx/generic/dtrans/X11_selection.cxx2
-rw-r--r--vcl/unx/kde/UnxFilePicker.cxx2
-rw-r--r--vcl/unx/kde4/KDE4FilePicker.cxx2
18 files changed, 30 insertions, 30 deletions
diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx
index 8cf91ede9e21..11fb0744d5e9 100644
--- a/package/source/xstor/xfactory.cxx
+++ b/package/source/xstor/xfactory.cxx
@@ -294,7 +294,7 @@ sal_Bool SAL_CALL OStorageFactory::supportsService( const OUString& ServiceName
uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx
index 09a6e89d7fca..4365482808c0 100644
--- a/package/source/zippackage/zipfileaccess.cxx
+++ b/package/source/zippackage/zipfileaccess.cxx
@@ -469,7 +469,7 @@ sal_Bool SAL_CALL OZipFileAccess::supportsService( const OUString& ServiceName )
uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/sal/workben/testfile.cxx b/sal/workben/testfile.cxx
index 473e25a4ddf8..f4b1df974112 100644
--- a/sal/workben/testfile.cxx
+++ b/sal/workben/testfile.cxx
@@ -1760,7 +1760,7 @@ void DirectoryItemTest( void )
}
- if ( str1[0].compareTo(str1[1]) == 0 )
+ if ( str1[0] == str1[1] )
print_error( rtl::OString( "Reset" ),FileBase::E_None );
else
print_error( rtl::OString( "Reset" ),FileBase::E_invalidError );
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index a19cb32b228f..e18b89f94a29 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -93,7 +93,7 @@ void SAL_CALL DiscoveryService::run()
socklen_t aLen = sizeof( aAddr );
recvfrom( mSocket, aBuffer, BUFFER_SIZE, 0, (sockaddr*) &aAddr, &aLen );
OString aString( aBuffer, strlen( "LOREMOTE_SEARCH" ) );
- if ( aString.compareTo( "LOREMOTE_SEARCH" ) == 0 )
+ if ( aString == "LOREMOTE_SEARCH" )
{
OStringBuffer aStringBuffer("LOREMOTE_ADVERTISE\n");
aStringBuffer.append( OUStringToOString(
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 87f2b85418db..35766d4c6044 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -297,7 +297,7 @@ uno::Reference<rendering::XPolyPolygon2D> Parser::readPath( double* pArea = NULL
{
const OString aSubPathMarker( "subpath" );
- if( 0 != readNextToken().compareTo( aSubPathMarker ) )
+ if( readNextToken() != aSubPathMarker )
OSL_PRECOND(false, "broken path");
basegfx::B2DPolyPolygon aResult;
@@ -313,7 +313,7 @@ uno::Reference<rendering::XPolyPolygon2D> Parser::readPath( double* pArea = NULL
sal_Int32 nDummy=m_nCharIndex;
OString aCurrToken( m_aLine.getToken(m_nNextToken,' ',nDummy) );
- while( m_nCharIndex != -1 && 0 != aCurrToken.compareTo(aSubPathMarker) )
+ while( m_nCharIndex != -1 && aCurrToken != aSubPathMarker )
{
sal_Int32 nCurveFlag;
double nX, nY;
@@ -634,15 +634,15 @@ uno::Sequence<beans::PropertyValue> Parser::readImageImpl()
const sal_Int32 nImageSize( readInt32() );
OUString aFileName;
- if( aToken.compareTo( aPngMarker ) == 0 )
+ if( aToken == aPngMarker )
aFileName = aPngFile;
- else if( aToken.compareTo( aJpegMarker ) == 0 )
+ else if( aToken == aJpegMarker )
aFileName = aJpegFile;
- else if( aToken.compareTo( aPbmMarker ) == 0 )
+ else if( aToken == aPbmMarker )
aFileName = aPbmFile;
else
{
- SAL_WARN_IF(aToken.compareTo( aPpmMarker ),"sdext.pdfimport","Invalid bitmap format");
+ SAL_WARN_IF(aToken != aPpmMarker,"sdext.pdfimport","Invalid bitmap format");
aFileName = aPpmFile;
}
diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx
index c71d29120658..c7fef6ec542c 100644
--- a/sfx2/source/appl/xpackcreator.cxx
+++ b/sfx2/source/appl/xpackcreator.cxx
@@ -178,7 +178,7 @@ sal_Bool SAL_CALL OPackageStructureCreator::supportsService( const OUString& Ser
uno::Sequence< OUString > aSeq = impl_getStaticSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx
index 3cad59816e8a..4a03b1a3151c 100644
--- a/sfx2/source/doc/ownsubfilterservice.cxx
+++ b/sfx2/source/doc/ownsubfilterservice.cxx
@@ -138,7 +138,7 @@ sal_Bool SAL_CALL OwnSubFilterService::supportsService( const OUString& ServiceN
uno::Sequence< OUString > aSeq = impl_getStaticSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx
index 3141915ab9be..ea0b9d7722aa 100644
--- a/sot/source/unoolestorage/xolesimplestorage.cxx
+++ b/sot/source/unoolestorage/xolesimplestorage.cxx
@@ -787,7 +787,7 @@ OUString SAL_CALL OLESimpleStorage::getImplementationName()
uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx
index 35233046d4d8..c35fd3f608cd 100644
--- a/svtools/source/hatchwindow/documentcloser.cxx
+++ b/svtools/source/hatchwindow/documentcloser.cxx
@@ -235,7 +235,7 @@ OUString SAL_CALL ODocumentCloser::getImplementationName( )
uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index 5f93ebdc3b2b..51566f408fba 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -80,7 +80,7 @@ sal_Bool SAL_CALL OHatchWindowFactory::supportsService( const OUString& ServiceN
uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 82e46e711212..8ec224214b92 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1368,7 +1368,7 @@ namespace svxform
const PropertyValue* pPropsEnd = pProps + _xPropSeq.getLength();
for ( ; pProps != pPropsEnd; ++pProps )
{
- if ( sInstModel.compareTo( pProps->Name ) == 0 )
+ if ( sInstModel == pProps->Name )
{
Reference< css::xml::dom::XNode > xRoot;
if ( pProps->Value >>= xRoot )
@@ -1395,9 +1395,9 @@ namespace svxform
}
}
}
- else if ( sInstName.compareTo( pProps->Name ) == 0 && ( pProps->Value >>= sTemp ) )
+ else if ( sInstName == pProps->Name && ( pProps->Value >>= sTemp ) )
m_sInstanceName = sRet = sTemp;
- else if ( sInstURL.compareTo( pProps->Name ) == 0 && ( pProps->Value >>= sTemp ) )
+ else if ( sInstURL == pProps->Name && ( pProps->Value >>= sTemp ) )
m_sInstanceURL = sTemp;
}
@@ -2203,7 +2203,7 @@ namespace svxform
const PropertyValue* pPropsEnd = pProps + _xPropSeq.getLength();
for ( ; pProps != pPropsEnd; ++pProps )
{
- if ( sID.compareTo( pProps->Name ) == 0 )
+ if ( sID == pProps->Name )
{
pProps->Value >>= sInstName;
break;
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
index 03e2604b8ca4..0b37a657cca8 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
@@ -146,7 +146,7 @@ public final class WikiEditorImpl extends WeakBase
{
final com.sun.star.util.URL myURL = aURL;
//logger.log( Level.INFO, "received dispatch request for: "+aURL.Complete );
- if ( aURL.Protocol.compareTo( protocolName ) == 0 )
+ if ( aURL.Protocol == protocolName )
{
/*
synchronized( this )
@@ -158,7 +158,7 @@ public final class WikiEditorImpl extends WeakBase
try
{
- if ( myURL.Path.compareTo( "send" ) == 0 )
+ if ( myURL.Path == "send" )
{
sendArticle();
}
diff --git a/vcl/generic/fontmanager/fontcache.cxx b/vcl/generic/fontmanager/fontcache.cxx
index b2a2af528af6..0d14d48c58a3 100644
--- a/vcl/generic/fontmanager/fontcache.cxx
+++ b/vcl/generic/fontmanager/fontcache.cxx
@@ -264,10 +264,10 @@ void FontCache::read()
do
{
aStream.ReadLine( aLine );
- if( aLine.compareTo( "FontCacheDirectory:" ) == 0 ||
- aLine.compareTo( "EmptyFontCacheDirectory:" ) == 0 )
+ if( aLine == "FontCacheDirectory:" ||
+ aLine == "EmptyFontCacheDirectory:" )
{
- bool bEmpty = (aLine.compareTo( "Empty" ) == 0);
+ bool bEmpty = (aLine == "Empty" );
sal_Int32 nSearchIndex = bEmpty ? 24 : 19;
OString aDir;
@@ -309,7 +309,7 @@ void FontCache::read()
m_aCache[ nDir ].m_bUserOverrideOnly = bKeepOnlyUserOverridden;
}
}
- else if( pDir && aLine.compareTo( "File:" ) == 0 )
+ else if( pDir && aLine == "File:")
{
OString aFile( aLine.copy( 5 ) );
aStream.ReadLine( aLine );
diff --git a/vcl/unx/generic/dtrans/X11_clipboard.cxx b/vcl/unx/generic/dtrans/X11_clipboard.cxx
index 82f1ce9ee34c..6325e19e7f1e 100644
--- a/vcl/unx/generic/dtrans/X11_clipboard.cxx
+++ b/vcl/unx/generic/dtrans/X11_clipboard.cxx
@@ -259,7 +259,7 @@ sal_Bool SAL_CALL X11Clipboard::supportsService( const OUString& ServiceName )
Sequence < OUString > SupportedServicesNames = X11Clipboard_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if (SupportedServicesNames[n] == ServiceName)
return sal_True;
return sal_False;
diff --git a/vcl/unx/generic/dtrans/X11_droptarget.cxx b/vcl/unx/generic/dtrans/X11_droptarget.cxx
index f262003e10f9..b2e76aa63285 100644
--- a/vcl/unx/generic/dtrans/X11_droptarget.cxx
+++ b/vcl/unx/generic/dtrans/X11_droptarget.cxx
@@ -202,7 +202,7 @@ sal_Bool DropTarget::supportsService( const OUString& ServiceName ) throw()
Sequence < OUString > SupportedServicesNames = Xdnd_dropTarget_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if (SupportedServicesNames[n] == ServiceName)
return sal_True;
return sal_False;
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index db951bb7d0aa..5b79345d41cd 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -4151,7 +4151,7 @@ sal_Bool SelectionManagerHolder::supportsService( const OUString& ServiceName )
Sequence < OUString > SupportedServicesNames = Xdnd_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if (SupportedServicesNames[n] == ServiceName)
return sal_True;
return sal_False;
diff --git a/vcl/unx/kde/UnxFilePicker.cxx b/vcl/unx/kde/UnxFilePicker.cxx
index 5ccc84251544..706d0957ed49 100644
--- a/vcl/unx/kde/UnxFilePicker.cxx
+++ b/vcl/unx/kde/UnxFilePicker.cxx
@@ -660,7 +660,7 @@ sal_Bool SAL_CALL UnxFilePicker::supportsService( const OUString& ServiceName )
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
{
- if ( SupportedServicesNames[n].compareTo( ServiceName ) == 0 )
+ if ( SupportedServicesNames[n] == ServiceName )
return sal_True;
}
diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index d2731b095168..4e3d840bb1ea 100644
--- a/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -712,7 +712,7 @@ sal_Bool SAL_CALL KDE4FilePicker::supportsService( const OUString& ServiceName )
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
{
- if ( SupportedServicesNames[n].compareTo( ServiceName ) == 0 )
+ if ( SupportedServicesNames[n] == ServiceName )
return sal_True;
}