[Libreoffice-commits] core.git: package/source sal/workben sdext/source sd/source sfx2/source sot/source svtools/source svx/source swext/mediawiki vcl/generic vcl/unx

Artur Dryomov artur.dryomov at gmail.com
Wed Apr 17 03:01:55 PDT 2013


 package/source/xstor/xfactory.cxx                         |    2 +-
 package/source/zippackage/zipfileaccess.cxx               |    2 +-
 sal/workben/testfile.cxx                                  |    2 +-
 sd/source/ui/remotecontrol/DiscoveryService.cxx           |    2 +-
 sdext/source/pdfimport/wrapper/wrapper.cxx                |   12 ++++++------
 sfx2/source/appl/xpackcreator.cxx                         |    2 +-
 sfx2/source/doc/ownsubfilterservice.cxx                   |    2 +-
 sot/source/unoolestorage/xolesimplestorage.cxx            |    2 +-
 svtools/source/hatchwindow/documentcloser.cxx             |    2 +-
 svtools/source/hatchwindow/hatchwindowfactory.cxx         |    2 +-
 svx/source/form/datanavi.cxx                              |    8 ++++----
 swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java |    4 ++--
 vcl/generic/fontmanager/fontcache.cxx                     |    8 ++++----
 vcl/unx/generic/dtrans/X11_clipboard.cxx                  |    2 +-
 vcl/unx/generic/dtrans/X11_droptarget.cxx                 |    2 +-
 vcl/unx/generic/dtrans/X11_selection.cxx                  |    2 +-
 vcl/unx/kde/UnxFilePicker.cxx                             |    2 +-
 vcl/unx/kde4/KDE4FilePicker.cxx                           |    2 +-
 18 files changed, 30 insertions(+), 30 deletions(-)

New commits:
commit b80d8c695e6b6ded231e67ed9a80bcd1f1250c03
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Tue Apr 16 19:33:24 2013 +0300

    fdo#62096 - replace some O(U)String compareTo with ==
    
    Change-Id: I98d04d7da4c2b7ea0b769df9c2bfa8c1ad86bf2d
    Reviewed-on: https://gerrit.libreoffice.org/3422
    Reviewed-by: Thomas Arnhold <thomas at arnhold.org>
    Tested-by: Thomas Arnhold <thomas at arnhold.org>

diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx
index 8cf91ed..11fb074 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 09a6e89..4365482 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 473e25a..f4b1df9 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 a19cb32..e18b89f 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 87f2b85..35766d4 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 c71d291..c7fef6e 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 3cad598..4a03b1a 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 3141915..ea0b9d7 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 3523304..c35fd3f 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 5f93ebd..51566f4 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 82e46e7..8ec2242 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 03e2604..0b37a65 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 b2a2af5..0d14d48 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 82f1ce9..6325e19 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 f262003..b2e76aa 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 db951bb..5b79345 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 5ccc842..706d095 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 d2731b0..4e3d840 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;
     }
 


More information about the Libreoffice-commits mailing list