Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please find attached a partial fix for Easy Hack FDO43460

Part X
Module
cppu
cppuhelper
cpputools
- -- 
Olivier Hallot
Founder, Board of Directors Member - The Document Foundation
LibreOffice translation leader for Brazilian Portuguese
+55-21-8822-8812
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJO6kwGAAoJEJp3R7nH3vLx3iEH/RbmYWDFir8eFwucl/tAoMFE
dy00/adJQeE6Fhn4JfUtYiG4VTl4uLwBHN0MhoAcaxIXQ/Zr4vwMqWGCVYbxqLS4
0xlApf+yWZqx87NKAkpKvELkP4v37jJFtX0i81xFQCUtyaHM2tA7pWJjnHIW1kVK
sL+UxoOFNFdxfn5g6fJkd89cPKMUGRwPfPGEe0IzGyqmiQr8eF8q6u/6aBr0z25L
BMVcESBOI31HXI6mLWKNylvB4y5nAkZjpapWuQdMyo57+wgfrjj7QNEIdNGuDcXQ
eJjrWq6+WhXGTsbuvXHyx9ffXuSK7Ml9hS4a7YW2nhm60sZ+TQRtp+PmBLaFHWE=
=vOfW
-----END PGP SIGNATURE-----
From 336a40c2fa4dbac7160722e82f97ed481f42a67b Mon Sep 17 00:00:00 2001
From: Olivier Hallot <olivier.hallot@alta.org.br>
Date: Thu, 15 Dec 2011 17:29:53 -0200
Subject: [PATCH] Fix for fdo43460 Part X getLength() to isEmpty()

Part X
Module
cppu
cppuhelper
cpputools
---
 cppu/source/uno/EnvStack.cxx                       |    2 +-
 cppu/source/uno/lbenv.cxx                          |    4 ++--
 cppu/source/uno/lbmap.cxx                          |    6 +++---
 cppuhelper/source/bootstrap.cxx                    |    8 ++++----
 cppuhelper/source/component_context.cxx            |    2 +-
 cppuhelper/source/factory.cxx                      |    2 +-
 cppuhelper/source/propertysetmixin.cxx             |    2 +-
 cppuhelper/source/propshlp.cxx                     |    8 ++++----
 cppuhelper/source/servicefactory.cxx               |   14 +++++++-------
 cppuhelper/source/shlib.cxx                        |    4 ++--
 .../source/registercomponent/registercomponent.cxx |   16 ++++++++--------
 cpputools/source/regsingleton/regsingleton.cxx     |    2 +-
 cpputools/source/unoexe/unoexe.cxx                 |   18 +++++++++---------
 13 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx
index d1ff292..9542440 100644
--- a/cppu/source/uno/EnvStack.cxx
+++ b/cppu/source/uno/EnvStack.cxx
@@ -203,7 +203,7 @@ static int s_getNextEnv(uno_Environment ** ppEnv, uno_Environment * pCurrEnv, un
         res = 1;
     }
 
-    if (nextPurpose.getLength())
+    if (!nextPurpose.isEmpty())
     {
         rtl::OUString next_envDcp(s_uno_envDcp);
         next_envDcp += nextPurpose;
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index 08e7035..ba3465c 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -1031,7 +1031,7 @@ inline void EnvironmentsData::getRegisteredEnvironments(
           iPos != aName2EnvMap.end(); ++iPos )
     {
         uno_Environment * pWeak = iPos->second;
-        if (!rEnvDcp.getLength() ||
+        if (rEnvDcp.isEmpty() ||
             rEnvDcp.equals( pWeak->pTypeName ))
         {
             ppFound[nSize] = 0;
@@ -1116,7 +1116,7 @@ static uno_Environment * initDefaultEnvironment(
         that->releaseInterface = unoenv_releaseInterface;
 
         OUString envPurpose = cppu::EnvDcp::getPurpose(rEnvDcp);
-        if (envPurpose.getLength())
+        if (!envPurpose.isEmpty())
         {
             rtl::OUString libStem = envPurpose.copy(envPurpose.lastIndexOf(':') + 1);
             libStem += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_uno_uno") );
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index ec56c05..84e2cc7 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -312,7 +312,7 @@ static inline OUString getBridgeName(
     SAL_THROW( () )
 {
     OUStringBuffer aBridgeName( 16 );
-    if (rAddPurpose.getLength())
+    if (!rAddPurpose.isEmpty())
     {
         aBridgeName.append( rAddPurpose );
         aBridgeName.append( (sal_Unicode)'_' );
@@ -469,7 +469,7 @@ static Mapping getMediateMapping(
     }
 
     // connect to uno
-    if (rAddPurpose.getLength()) // insert purpose mapping between new ano_uno <-> uno
+    if (!rAddPurpose.isEmpty()) // insert purpose mapping between new ano_uno <-> uno
     {
         // create anonymous uno env
         Environment aAnUno;
@@ -540,7 +540,7 @@ void SAL_CALL uno_getMapping(
     }
 
     // See if an identity mapping does fit.
-    if (!aRet.is() && pFrom == pTo && !aAddPurpose.getLength())
+    if (!aRet.is() && pFrom == pTo && aAddPurpose.isEmpty())
         aRet = createIdentityMapping(pFrom);
 
     if (!aRet.is())
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index 399af07..2fb8ccd 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -81,13 +81,13 @@ namespace cppu
 OUString const & get_this_libpath()
 {
     static OUString s_path;
-    if (0 == s_path.getLength())
+    if (s_path.isEmpty())
     {
         OUString path;
         Module::getUrlFromAddress( reinterpret_cast<oslGenericFunction>(get_this_libpath), path );
         path = path.copy( 0, path.lastIndexOf( '/' ) );
         MutexGuard guard( Mutex::getGlobalMutex() );
-        if (0 == s_path.getLength())
+        if (s_path.isEmpty())
             s_path = path;
     }
     return s_path;
@@ -317,7 +317,7 @@ Reference< registry::XSimpleRegistry > nestRegistries(
     sal_Int32 index;
     Reference< registry::XSimpleRegistry > lastRegistry;
 
-    if(write_rdb.getLength()) // is there a write registry given?
+    if(!write_rdb.isEmpty()) // is there a write registry given?
     {
         lastRegistry.set(xSimRegFac->createInstance(), UNO_QUERY);
 
@@ -533,7 +533,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
             throw BootstrapException(
                 OUSTR("cannot convert soffice installation path to URL!"));
         }
-        if (path.getLength() > 0 && path[path.getLength() - 1] != '/') {
+        if (!path.isEmpty() && path[path.getLength() - 1] != '/') {
             path += OUSTR("/");
         }
 
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx
index 97a1f72..da60e39 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -593,7 +593,7 @@ Any ComponentContext::lookupMap( OUString const & rName )
             {
                 OUString serviceName;
                 if ((usesService >>= serviceName) &&
-                    serviceName.getLength())
+                    !serviceName.isEmpty())
                 {
                     xInstance = args.getLength()
                         ? m_xSMgr->createInstanceWithArgumentsAndContext(
diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index 573f7b4..cab323a 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -876,7 +876,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory()
     }
 
     Reference< XInterface > xFactory;
-    if( aActivatorName.getLength() != 0 )
+    if( !aActivatorName.isEmpty() )
     {
         Reference<XInterface > x = xSMgr->createInstance( aActivatorName );
         Reference<XImplementationLoader > xLoader( x, UNO_QUERY );
diff --git a/cppuhelper/source/propertysetmixin.cxx b/cppuhelper/source/propertysetmixin.cxx
index 7d2b832..e4cddeb 100644
--- a/cppuhelper/source/propertysetmixin.cxx
+++ b/cppuhelper/source/propertysetmixin.cxx
@@ -1022,7 +1022,7 @@ PropertySetMixinImpl::~PropertySetMixinImpl() {
 }
 
 void PropertySetMixinImpl::checkUnknown(rtl::OUString const & propertyName) {
-    if (propertyName.getLength() != 0) {
+    if (!propertyName.isEmpty()) {
         m_impl->get(
             static_cast< css::beans::XPropertySet * >(this), propertyName);
     }
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index 3121095..338d9c1 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -311,7 +311,7 @@ void OPropertySetHelper::addPropertyChangeListener(
     {
         // only add listeners if you are not disposed
         // a listener with no name means all properties
-        if( rPropertyName.getLength() )
+        if( !rPropertyName.isEmpty() )
         {
             // get the map table
             IPropertyArrayHelper & rPH = getInfoHelper();
@@ -357,7 +357,7 @@ void OPropertySetHelper::removePropertyChangeListener(
     // all listeners are automaticly released in a dispose call
     if( !rBHelper.bInDispose && !rBHelper.bDisposed )
     {
-        if( rPropertyName.getLength() )
+        if( !rPropertyName.isEmpty() )
         {
             // get the map table
             IPropertyArrayHelper & rPH = getInfoHelper();
@@ -393,7 +393,7 @@ void OPropertySetHelper::addVetoableChangeListener(
     {
         // only add listeners if you are not disposed
         // a listener with no name means all properties
-        if( rPropertyName.getLength() )
+        if( !rPropertyName.isEmpty() )
         {
             // get the map table
             IPropertyArrayHelper & rPH = getInfoHelper();
@@ -437,7 +437,7 @@ void OPropertySetHelper::removeVetoableChangeListener(
     // all listeners are automaticly released in a dispose call
     if( !rBHelper.bInDispose && !rBHelper.bDisposed )
     {
-        if( rPropertyName.getLength() )
+        if( !rPropertyName.isEmpty() )
         {
             // get the map table
             IPropertyArrayHelper & rPH = getInfoHelper();
diff --git a/cppuhelper/source/servicefactory.cxx b/cppuhelper/source/servicefactory.cxx
index 25f4970..ea97a17 100644
--- a/cppuhelper/source/servicefactory.cxx
+++ b/cppuhelper/source/servicefactory.cxx
@@ -113,7 +113,7 @@ Reference< registry::XSimpleRegistry > SAL_CALL createSimpleRegistry(
             createInstance(
                 loadSharedLibComponentFactory(
                     OUSTR("bootstrap.uno" SAL_DLLEXTENSION),
-                    0 == rBootstrapPath.getLength()
+                    rBootstrapPath.isEmpty()
                     ? get_this_libpath() : rBootstrapPath,
                     OUSTR("com.sun.star.comp.stoc.SimpleRegistry"),
                     Reference< lang::XMultiServiceFactory >(),
@@ -144,7 +144,7 @@ Reference< registry::XSimpleRegistry > SAL_CALL createNestedRegistry(
             createInstance(
                 loadSharedLibComponentFactory(
                     OUSTR("bootstrap.uno" SAL_DLLEXTENSION),
-                    0 == rBootstrapPath.getLength()
+                    rBootstrapPath.isEmpty()
                     ? get_this_libpath() : rBootstrapPath,
                     OUSTR("com.sun.star.comp.stoc.NestedRegistry"),
                     Reference< lang::XMultiServiceFactory >(),
@@ -247,7 +247,7 @@ static void add_access_control_entries(
     if (bootstrap.getFrom( OUSTR("UNO_AC_SINGLEUSER"), ac_user ))
     {
         // ac in single-user mode
-        if (ac_user.getLength())
+        if (!ac_user.isEmpty())
         {
             // - ac prop: single-user-id
             entry.bLateInitService = false;
@@ -383,7 +383,7 @@ Reference< lang::XMultiComponentFactory > bootstrapInitialSF(
     SAL_THROW( (Exception) )
 {
     OUString const & bootstrap_path =
-        0 == rBootstrapPath.getLength() ? get_this_libpath() : rBootstrapPath;
+        rBootstrapPath.isEmpty() ? get_this_libpath() : rBootstrapPath;
 
     Reference< lang::XMultiComponentFactory > xMgr(
         createInstance(
@@ -542,7 +542,7 @@ Reference< XComponentContext > bootstrapInitialContext(
             Reference< lang::XSingleComponentFactory > xFac(
                 loadSharedLibComponentFactory(
                     OUSTR("bootstrap.uno" SAL_DLLEXTENSION),
-                    0 == rBootstrapPath.getLength()
+                    rBootstrapPath.isEmpty()
                     ? get_this_libpath() : rBootstrapPath,
                 OUSTR("com.sun.star.comp.stoc.RegistryTypeDescriptionProvider"),
                 Reference< lang::XMultiServiceFactory >( xSF, UNO_QUERY ),
@@ -587,7 +587,7 @@ static Reference< lang::XMultiComponentFactory > createImplServiceFactory(
 
     // open a registry
     sal_Bool bRegistryShouldBeValid = sal_False;
-    if (rWriteRegistry.getLength() && !rReadRegistry.getLength())
+    if (!rWriteRegistry.isEmpty() && rReadRegistry.isEmpty())
     {
         bRegistryShouldBeValid = sal_True;
         xRegistry.set( createSimpleRegistry( rBootstrapPath ) );
@@ -603,7 +603,7 @@ static Reference< lang::XMultiComponentFactory > createImplServiceFactory(
             }
         }
     }
-    else if (rWriteRegistry.getLength() && rReadRegistry.getLength())
+    else if (!rWriteRegistry.isEmpty() && !rReadRegistry.isEmpty())
     {
         // default registry
         bRegistryShouldBeValid = sal_True;
diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index 3b6cdfc..1213b0e 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -228,7 +228,7 @@ static OUString makeComponentPath(
         OSL_ASSERT( FileBase::E_None ==
                     FileBase::getSystemPathFromFileURL( rLibName, aComp ) );
         OSL_ASSERT(
-            ! rPath.getLength() ||
+            rPath.isEmpty() ||
             FileBase::E_None ==
               FileBase::getSystemPathFromFileURL( rPath, aComp ) );
     }
@@ -236,7 +236,7 @@ static OUString makeComponentPath(
 
     OUStringBuffer buf( rPath.getLength() + rLibName.getLength() + 12 );
 
-    if (0 != rPath.getLength())
+    if (!rPath.isEmpty())
     {
         buf.append( rPath );
         if (rPath[ rPath.getLength() -1 ] != '/')
diff --git a/cpputools/source/registercomponent/registercomponent.cxx 
b/cpputools/source/registercomponent/registercomponent.cxx
index cc9d22e..7ad3abe 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 05fc7da..da6258f 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 684bc39..ea3eac5 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<XInterface>() );
         }
-        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 );
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.