summaryrefslogtreecommitdiff
path: root/xmlhelp/source/treeview
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-05 14:39:55 +0200
committerNoel Grandin <noel@peralex.com>2013-11-11 12:58:13 +0200
commitfcd1637d5101b9142e6808edfb77b01122857901 (patch)
tree5fd09f97de80cf2a9481bd55a798015db35f1d0c /xmlhelp/source/treeview
parentef90021abe3735fba57145598fd7c3d359d2718e (diff)
convert OUString compareToAscii == 0 to equalsAscii
Convert code like aStr.compareToAscii("XXX") == 0 to aStr.equalsAscii("XXX") which is both easier to read and faster. Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
Diffstat (limited to 'xmlhelp/source/treeview')
-rw-r--r--xmlhelp/source/treeview/tvfactory.cxx6
-rw-r--r--xmlhelp/source/treeview/tvread.cxx18
2 files changed, 12 insertions, 12 deletions
diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx
index b4cee958fd8e..1bcf74ecaefd 100644
--- a/xmlhelp/source/treeview/tvfactory.cxx
+++ b/xmlhelp/source/treeview/tvfactory.cxx
@@ -93,8 +93,8 @@ TVFactory::supportsService(
throw( RuntimeException )
{
return
- ServiceName.compareToAscii( "com.sun.star.help.TreeView" ) == 0 ||
- ServiceName.compareToAscii( "com.sun.star.ucb.HiearchyDataSource" ) == 0;
+ ServiceName.equalsAscii( "com.sun.star.help.TreeView" ) ||
+ ServiceName.equalsAscii( "com.sun.star.ucb.HiearchyDataSource" );
}
Sequence< OUString > SAL_CALL
@@ -230,7 +230,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL treeview_component_getFactory(
// File Content Provider.
- if ( TVFactory::getImplementationName_static().compareToAscii( pImplName ) == 0 )
+ if ( TVFactory::getImplementationName_static().equalsAscii( pImplName ) )
{
xFactory = TVFactory::createServiceFactory( xSMgr );
}
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 722784c39652..76ef240bcc50 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -305,11 +305,11 @@ TVRead::getByName( const OUString& aName )
{
bool found( true );
Any aAny;
- if( aName.compareToAscii( "Title" ) == 0 )
+ if( aName.equalsAscii( "Title" ) )
aAny <<= Title;
- else if( aName.compareToAscii( "TargetURL" ) == 0 )
+ else if( aName.equalsAscii( "TargetURL" ) )
aAny <<= TargetURL;
- else if( aName.compareToAscii( "Children" ) == 0 )
+ else if( aName.equalsAscii( "Children" ) )
{
cppu::OWeakObject* p = Children.get();
aAny <<= Reference< XInterface >( p );
@@ -340,9 +340,9 @@ sal_Bool SAL_CALL
TVRead::hasByName( const OUString& aName )
throw( RuntimeException )
{
- if( aName.compareToAscii( "Title" ) == 0 ||
- aName.compareToAscii( "TargetURL" ) == 0 ||
- aName.compareToAscii( "Children" ) == 0 )
+ if( aName.equalsAscii( "Title" ) ||
+ aName.equalsAscii( "TargetURL" ) ||
+ aName.equalsAscii( "Children" ) )
return true;
return false;
@@ -359,7 +359,7 @@ TVRead::getByHierarchicalName( const OUString& aName )
OUString name( aName );
if( ( idx = name.indexOf( sal_Unicode( '/' ) ) ) != -1 &&
- name.copy( 0,idx ).compareToAscii( "Children" ) == 0 )
+ name.copy( 0,idx ).equalsAscii( "Children" ) )
return Children->getByHierarchicalName( name.copy( 1 + idx ) );
return getByName( name );
@@ -373,7 +373,7 @@ TVRead::hasByHierarchicalName( const OUString& aName )
OUString name( aName );
if( ( idx = name.indexOf( sal_Unicode( '/' ) ) ) != -1 &&
- name.copy( 0,idx ).compareToAscii( "Children" ) == 0 )
+ name.copy( 0,idx ).equalsAscii( "Children" ) )
return Children->hasByHierarchicalName( name.copy( 1 + idx ) );
return hasByName( name );
@@ -775,7 +775,7 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext )
( str[idx_ + 4] == 'e' || str[idx_ + 4] == 'E' ) )
{
OUString baseName = aFileName.copy(0,idx_).toAsciiLowerCase();
- if(! showBasic && baseName.compareToAscii("sbasic") == 0 )
+ if(! showBasic && baseName.equalsAscii("sbasic") )
continue;
osl::File aFile( aFileUrl );
if( osl::FileBase::E_None == aFile.open( osl_File_OpenFlag_Read ) )