From 1b99d8800e399f45404ab62827163a873d2a1aec Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Thu, 15 Dec 2011 17:29:53 -0200 Subject: Fix for fdo43460 Part X getLength() to isEmpty() Part X Module cppu cppuhelper cpputools --- .../source/registercomponent/registercomponent.cxx | 16 ++++++++-------- cpputools/source/regsingleton/regsingleton.cxx | 2 +- cpputools/source/unoexe/unoexe.cxx | 18 +++++++++--------- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'cpputools') diff --git a/cpputools/source/registercomponent/registercomponent.cxx b/cpputools/source/registercomponent/registercomponent.cxx index cc9d22e42a96..7ad3abe87662 100644 --- a/cpputools/source/registercomponent/registercomponent.cxx +++ b/cpputools/source/registercomponent/registercomponent.cxx @@ -264,7 +264,7 @@ sal_Bool parseOptions(int ac, char* av[], Options& rOptions, sal_Bool bCmdFile) { i++; OUString regName = OStringToOUString(av[i], osl_getThreadTextEncoding()); - if( ! rOptions.sBootRegName.getLength() ) + if( rOptions.sBootRegName.isEmpty() ) { rOptions.sBootRegName = regName; } @@ -321,7 +321,7 @@ sal_Bool parseOptions(int ac, char* av[], Options& rOptions, sal_Bool bCmdFile) sUrls = OStringToOUString(av[i]+2, osl_getThreadTextEncoding()); } - if (rOptions.sComponentUrls.getLength()) + if (!rOptions.sComponentUrls.isEmpty()) { OUString tmp(rOptions.sComponentUrls + OUString(";", 1, osl_getThreadTextEncoding()) + sUrls); rOptions.sComponentUrls = tmp; @@ -660,7 +660,7 @@ static void bootstrap( if ( opt.sRegName.equals(opt.sBootRegName) ) { - if( opt.sBootRegName2.getLength() ) + if( !opt.sBootRegName2.isEmpty() ) { xSMgr = createRegistryServiceFactory( convertToFileUrl(opt.sRegName), @@ -675,14 +675,14 @@ static void bootstrap( } else { - if( opt.sBootRegName2.getLength() ) + if( !opt.sBootRegName2.isEmpty() ) { xSMgr = createRegistryServiceFactory( convertToFileUrl( opt.sBootRegName2 ), convertToFileUrl( opt.sBootRegName ), sal_True ); } - else if ( opt.sBootRegName.getLength() ) + else if ( !opt.sBootRegName.isEmpty() ) { xSMgr = createRegistryServiceFactory( convertToFileUrl( opt.sBootRegName ), @@ -766,12 +766,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) exit(1); } - if( ! aOptions.sRegName.getLength() ) + if( aOptions.sRegName.isEmpty() ) { fprintf( stderr, "ERROR: target registry missing (-r option)\n" ); exit( 1 ); } - if ( aOptions.sComponentUrls.getLength() == 0 ) + if ( aOptions.sComponentUrls.isEmpty() ) { fprintf(stderr, "ERROR: no component url is specified!\n"); exit(1); @@ -786,7 +786,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) catch( Exception& e ) { fprintf(stderr, "ERROR: create ServiceManager failed!\n"); - if ( e.Message.getLength() ) + if ( !e.Message.isEmpty() ) { fprintf(stderr, "ERROR description: %s\n", OUStringToOString(e.Message, osl_getThreadTextEncoding()).getStr()); diff --git a/cpputools/source/regsingleton/regsingleton.cxx b/cpputools/source/regsingleton/regsingleton.cxx index 05fc7dafe67a..da6258f106a9 100644 --- a/cpputools/source/regsingleton/regsingleton.cxx +++ b/cpputools/source/regsingleton/regsingleton.cxx @@ -128,7 +128,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) if (insert_entry) { - if (service.getLength()) + if (!service.isEmpty()) { Reference< registry::XRegistryKey > xEntry( xKey->openKey( singleton ) ); if (! xEntry.is()) diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index 684bc39934e1..ea3eac5f4c43 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -510,7 +510,7 @@ inline Reference< XInterface > OInstanceProvider::createInstance() throw (Exception) { Reference< XInterface > xRet; - if (_aImplName.getLength()) // manually via loader + if (!_aImplName.isEmpty()) // manually via loader xRet = loadComponent( _xContext, _aImplName, _aLocation ); else // via service manager unoexe::createInstance( xRet, _xContext, _aServiceName ); @@ -532,7 +532,7 @@ Reference< XInterface > OInstanceProvider::getInstance( const OUString & rName ) { Reference< XInterface > xRet; - if (_aImplName.getLength() == 0 && _aServiceName.getLength() == 0) + if (_aImplName.isEmpty() && _aServiceName.isEmpty()) { OSL_ASSERT( rName.equalsAsciiL( @@ -702,9 +702,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc,) } } - if ((aImplName.getLength() != 0) && (aServiceName.getLength() != 0)) + if (!(aImplName.isEmpty() || aServiceName.isEmpty())) throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM("give component exOR service name!" ) ), Reference< XInterface >() ); - if (aImplName.getLength() == 0 && aServiceName.getLength() == 0) + if (aImplName.isEmpty() && aServiceName.isEmpty()) { if (! aUnoUrl.endsWithIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(";uno.ComponentContext") )) @@ -719,9 +719,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc,) "unexpected option --singleinstance!") ), Reference() ); } - if (aImplName.getLength() && !aLocation.getLength()) + if (!aImplName.isEmpty() && aLocation.isEmpty()) throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM("give component location!" ) ), Reference< XInterface >() ); - if (aServiceName.getLength() && aLocation.getLength()) + if (!aServiceName.isEmpty() && !aLocation.isEmpty()) out( "\n> warning: service name given, will ignore location!" ); // read component params @@ -761,7 +761,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc,) xRegistry = (xRegistry.is() ? nestRegistries( xNewReg, xRegistry ) : xNewReg); } - if (aReadWriteRegistry.getLength()) + if (!aReadWriteRegistry.isEmpty()) { #if OSL_DEBUG_LEVEL > 1 out( "\n> trying to open rw registry: " ); @@ -788,7 +788,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc,) //#### accept, instanciate, etc. ########################################################### - if (aUnoUrl.getLength()) // accepting connections + if (!aUnoUrl.isEmpty()) // accepting connections { sal_Int32 nIndex = 0, nTokens = 0; do { aUnoUrl.getToken( 0, ';', nIndex ); nTokens++; } while( nIndex != -1 ); @@ -854,7 +854,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc,) else // no uno url { Reference< XInterface > xInstance; - if (aImplName.getLength()) // manually via loader + if (!aImplName.isEmpty()) // manually via loader xInstance = loadComponent( xContext, aImplName, aLocation ); else // via service manager createInstance( xInstance, xContext, aServiceName ); -- cgit