summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-05 11:06:18 +0200
committerNoel Grandin <noel@peralex.com>2013-11-11 12:58:12 +0200
commit0a9ef5a18e148c7a5c9a088e153a7873d1564841 (patch)
tree3c3bc21e7ee4f836a1d056695175e0b1a91eda26 /svtools
parent7944301424aac0943e4ecc0410f495b210ad3b79 (diff)
convert OUString 0==compareToAscii to equalsAscii
Convert code like: 0 == aStr.compareToAscii("XXX") to aStr.equalsAscii("XXX") which is both clearer and faster. Change-Id: I2e906d7d38494db38eb292702fadb781b1251e07
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/graphic/provider.cxx16
-rw-r--r--svtools/source/java/javacontext.cxx2
-rw-r--r--svtools/source/uno/addrtempuno.cxx6
-rw-r--r--svtools/source/uno/miscservices.cxx4
-rw-r--r--svtools/source/uno/unoevent.cxx2
5 files changed, 15 insertions, 15 deletions
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index ea051c7446e3..8c0be63be0d3 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -169,7 +169,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadMemory( const OUS
uno::Reference< ::graphic::XGraphic > xRet;
sal_Int32 nIndex = 0;
- if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:memorygraphic" ) ) )
+ if( rResourceURL.getToken( 0, '/', nIndex ).equalsAscii( "private:memorygraphic" ) )
{
sal_Int64 nGraphicAddress = rResourceURL.getToken( 0, '/', nIndex ).toInt64();
@@ -192,7 +192,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadRepositoryImage(
uno::Reference< ::graphic::XGraphic > xRet;
sal_Int32 nIndex = 0;
- if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:graphicrepository" ) ) )
+ if( rResourceURL.getToken( 0, '/', nIndex ).equalsAscii( "private:graphicrepository" ) )
{
OUString sPathName( rResourceURL.copy( nIndex ) );
BitmapEx aBitmap;
@@ -213,7 +213,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadStandardImage( co
uno::Reference< ::graphic::XGraphic > xRet;
sal_Int32 nIndex = 0;
- if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:standardimage" ) ) )
+ if( rResourceURL.getToken( 0, '/', nIndex ).equalsAscii( "private:standardimage" ) )
{
OUString sImageName( rResourceURL.copy( nIndex ) );
if ( sImageName == "info" )
@@ -277,7 +277,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const O
uno::Reference< ::graphic::XGraphic > xRet;
sal_Int32 nIndex = 0;
- if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:resource" ) ) )
+ if( rResourceURL.getToken( 0, '/', nIndex ).equalsAscii( "private:resource" ) )
{
OString aResMgrName(OUStringToOString(
rResourceURL.getToken(0, '/', nIndex), RTL_TEXTENCODING_ASCII_US));
@@ -293,8 +293,8 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const O
{
BitmapEx aBmpEx;
- if( ( 0 == aResourceType.compareToAscii( "bitmap" ) ) ||
- ( 0 == aResourceType.compareToAscii( "bitmapex" ) ) )
+ if( aResourceType.equalsAscii( "bitmap" ) ||
+ aResourceType.equalsAscii( "bitmapex" ) )
{
aResId.SetRT( RSC_BITMAP );
@@ -303,7 +303,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const O
aBmpEx = BitmapEx( aResId );
}
}
- else if( 0 == aResourceType.compareToAscii( "image" ) )
+ else if( aResourceType.equalsAscii( "image" ) )
{
aResId.SetRT( RSC_IMAGE );
@@ -313,7 +313,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const O
aBmpEx = aImage.GetBitmapEx();
}
}
- else if( 0 == aResourceType.compareToAscii( "imagelist" ) )
+ else if( aResourceType.equalsAscii( "imagelist" ) )
{
aResId.SetRT( RSC_IMAGELIST );
diff --git a/svtools/source/java/javacontext.cxx b/svtools/source/java/javacontext.cxx
index 93e42e3c3a1a..e51d2ca450e5 100644
--- a/svtools/source/java/javacontext.cxx
+++ b/svtools/source/java/javacontext.cxx
@@ -65,7 +65,7 @@ Any SAL_CALL JavaContext::getValueByName( const OUString& Name) throw (RuntimeEx
{
Any retVal;
- if ( 0 == Name.compareToAscii( JAVA_INTERACTION_HANDLER_NAME ))
+ if ( Name.equalsAscii( JAVA_INTERACTION_HANDLER_NAME ))
{
{
osl::MutexGuard aGuard(osl::Mutex::getGlobalMutex());
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx
index 691c278e0369..7ae18f496459 100644
--- a/svtools/source/uno/addrtempuno.cxx
+++ b/svtools/source/uno/addrtempuno.cxx
@@ -215,7 +215,7 @@ namespace svt
PropertyValue aVal;
if (_rValue >>= aVal)
{
- if (0 == aVal.Name.compareToAscii("DataSource"))
+ if (aVal.Name.equalsAscii("DataSource"))
{
#if OSL_DEBUG_LEVEL > 0
sal_Bool bSuccess =
@@ -225,7 +225,7 @@ namespace svt
return;
}
- if (0 == aVal.Name.compareToAscii("DataSourceName"))
+ if (aVal.Name.equalsAscii("DataSourceName"))
{
#if OSL_DEBUG_LEVEL > 0
sal_Bool bSuccess =
@@ -235,7 +235,7 @@ namespace svt
return;
}
- if (0 == aVal.Name.compareToAscii("Command"))
+ if (aVal.Name.equalsAscii("Command"))
{
#if OSL_DEBUG_LEVEL > 0
sal_Bool bSuccess =
diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx
index a62b248cfcdb..afd04f4919bc 100644
--- a/svtools/source/uno/miscservices.cxx
+++ b/svtools/source/uno/miscservices.cxx
@@ -130,14 +130,14 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
SvFilterOptionsDialog_CreateInstance,
aServiceNames);
}
- else if( 0 == GraphicProvider::getImplementationName_Static().compareToAscii( pImplementationName ) )
+ else if( GraphicProvider::getImplementationName_Static().equalsAscii( pImplementationName ) )
{
xFactory = ::cppu::createOneInstanceFactory(xSMgr,
GraphicProvider::getImplementationName_Static(),
GraphicProvider_CreateInstance,
GraphicProvider::getSupportedServiceNames_Static() );
}
- else if( 0 == GraphicRendererVCL::getImplementationName_Static().compareToAscii( pImplementationName ) )
+ else if( GraphicRendererVCL::getImplementationName_Static().equalsAscii( pImplementationName ) )
{
xFactory = ::cppu::createOneInstanceFactory(xSMgr,
GraphicRendererVCL::getImplementationName_Static(),
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index d5c5240db20e..9a4870e6b1fd 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -168,7 +168,7 @@ sal_uInt16 SvBaseEventDescriptor::mapNameToEventID(const OUString& rName) const
// iterate over known event names
for(sal_Int16 i = 0; i < mnMacroItems; i++)
{
- if (0 == rName.compareToAscii(mpSupportedMacroItems[i].mpEventName))
+ if( rName.equalsAscii(mpSupportedMacroItems[i].mpEventName))
{
return mpSupportedMacroItems[i].mnEvent;
}