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>
This commit is contained in:
Artur Dryomov 2013-04-16 19:33:24 +03:00 committed by Thomas Arnhold
parent c75eeddfb8
commit b80d8c695e
18 changed files with 30 additions and 30 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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 );

View File

@ -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(

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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();
}

View File

@ -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 );

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}