summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@alta.org.br>2012-01-16 15:46:57 -0200
committerOlivier Hallot <olivier.hallot@alta.org.br>2012-01-16 18:49:04 -0200
commit81e50fb2e378120d05f7ffdee216ce6e248e189b (patch)
tree0fa6f4779bb3b4970e4720bef4ac36c90514b45c /tools
parent69d91300547f6ed45a9a499ffae71c2c0f91c441 (diff)
Fix for fdo43460 Part XXXIX getLength() to isEmpty()
Part XXXIX Modules testtools, toolkit, tools
Diffstat (limited to 'tools')
-rw-r--r--tools/bootstrp/cppdep.cxx2
-rw-r--r--tools/bootstrp/rscdep.cxx2
-rw-r--r--tools/inc/tools/diagnose_ex.h2
-rw-r--r--tools/qa/cppunit/test_stream.cxx2
-rw-r--r--tools/source/fsys/dirent.cxx26
-rw-r--r--tools/source/fsys/tempfile.cxx2
-rw-r--r--tools/source/fsys/urlobj.cxx18
-rw-r--r--tools/source/generic/svlibrary.cxx2
-rw-r--r--tools/source/inet/inetmime.cxx2
-rw-r--r--tools/source/misc/appendunixshellword.cxx2
-rw-r--r--tools/source/misc/getprocessworkingdir.cxx2
-rw-r--r--tools/source/rc/resmgr.cxx28
12 files changed, 45 insertions, 45 deletions
diff --git a/tools/bootstrp/cppdep.cxx b/tools/bootstrp/cppdep.cxx
index c03a6a456bc0..3c3fd61c9d02 100644
--- a/tools/bootstrp/cppdep.cxx
+++ b/tools/bootstrp/cppdep.cxx
@@ -97,7 +97,7 @@ sal_Bool CppDep::Search(const rtl::OString &rFileName)
rtl::OString aNewFile;
if (!aResult.isEmpty())
- if ( (aNewFile = Exists( aResult )).getLength() )
+ if ( !(aNewFile = Exists( aResult )).isEmpty() )
{
sal_Bool bFound = sal_False;
size_t nCount = m_aFileList.size();
diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx
index 4afde22fae14..f10448d911a0 100644
--- a/tools/bootstrp/rscdep.cxx
+++ b/tools/bootstrp/rscdep.cxx
@@ -125,7 +125,7 @@ int main( int argc, char** argv )
rtl::OString aToken;
String aRespName( &aBuf[1], osl_getThreadTextEncoding());
SimpleConfig aConfig( aRespName );
- while ((aToken = aConfig.getNext()).getLength())
+ while (!(aToken = aConfig.getNext()).isEmpty())
{
char aBuf2[255];
strcpy( aBuf2, aToken.getStr());
diff --git a/tools/inc/tools/diagnose_ex.h b/tools/inc/tools/diagnose_ex.h
index 21463a66b427..f3aecf4f9822 100644
--- a/tools/inc/tools/diagnose_ex.h
+++ b/tools/inc/tools/diagnose_ex.h
@@ -64,7 +64,7 @@
sMessage += ::rtl::OUStringToOString( caught.getValueTypeName(), osl_getThreadTextEncoding() ); \
::com::sun::star::uno::Exception exception; \
caught >>= exception; \
- if ( exception.Message.getLength() ) \
+ if ( !exception.Message.isEmpty() ) \
{ \
sMessage += "\nmessage: "; \
sMessage += ::rtl::OUStringToOString( exception.Message, osl_getThreadTextEncoding() ); \
diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx
index 16293d0eafad..cb7d5b24ff23 100644
--- a/tools/qa/cppunit/test_stream.cxx
+++ b/tools/qa/cppunit/test_stream.cxx
@@ -163,7 +163,7 @@ namespace
CPPUNIT_ASSERT(aTwo.equalsL(RTL_CONSTASCII_STRINGPARAM("bar")));
rtl::OString aThree = read_uInt8s_ToOString(aMemStream, 3);
- CPPUNIT_ASSERT(!aThree.getLength());
+ CPPUNIT_ASSERT(aThree.isEmpty());
aMemStream.Seek(0);
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index c2231c175f3a..e52fbba51ddc 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -521,7 +521,7 @@ FSysError DirEntry::ImpParseOs2Name( const rtl::OString& rPfad, FSysPathStyle eS
}
// wird damit ein Volume beschrieben?
- if ( !pParent && eFlag == FSYS_FLAG_RELROOT && aName.getLength() )
+ if ( !pParent && eFlag == FSYS_FLAG_RELROOT && !aName.isEmpty() )
eFlag = FSYS_FLAG_VOLUME;
// bei gesetztem ErrorCode den Namen komplett "ubernehmen
@@ -717,7 +717,7 @@ DirEntry::DirEntry( const rtl::OString& rInitName, FSysPathStyle eStyle )
pParent = NULL;
// schnelle Loesung fuer Leerstring
- if ( !rInitName.getLength() )
+ if ( rInitName.isEmpty() )
{
eFlag = FSYS_FLAG_CURRENT;
nError = FSYS_ERR_OK;
@@ -832,7 +832,7 @@ DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, sal_Bool bNormalize )
DirEntry *pTemp = pParent;
if ( bNormalize && pNewParent &&
- pNewParent->eFlag == FSYS_FLAG_RELROOT && !pNewParent->aName.getLength() )
+ pNewParent->eFlag == FSYS_FLAG_RELROOT && pNewParent->aName.isEmpty() )
{
pParent = 0;
delete pNewParent;
@@ -1078,7 +1078,7 @@ String DirEntry::GetName( FSysPathStyle eStyle ) const
}
case FSYS_FLAG_RELROOT:
- if ( !aName.getLength() )
+ if ( aName.isEmpty() )
{
aRet.append(ACTCURRENT(eStyle));
break;
@@ -1106,7 +1106,7 @@ bool DirEntry::IsAbs() const
#ifdef UNX
return ( pParent ? pParent->IsAbs() : eFlag == FSYS_FLAG_ABSROOT );
#else
- return ( pParent ? pParent->IsAbs() : eFlag == FSYS_FLAG_ABSROOT && aName.getLength() > 0 );
+ return ( pParent ? pParent->IsAbs() : eFlag == FSYS_FLAG_ABSROOT && !aName.isEmpty() );
#endif
}
@@ -1250,9 +1250,9 @@ DirEntry DirEntry::operator+( const DirEntry& rEntry ) const
*/
if (
- (eFlag == FSYS_FLAG_RELROOT && !aName.getLength()) ||
+ (eFlag == FSYS_FLAG_RELROOT && aName.isEmpty()) ||
(
- (pEntryTop->aName.getLength() ||
+ (!pEntryTop->aName.isEmpty() ||
((rEntry.Level()>1)?(rEntry[rEntry.Level()-2].aName.equalsIgnoreAsciiCase(RFS_IDENTIFIER)):sal_False))
&&
(pEntryTop->eFlag == FSYS_FLAG_ABSROOT ||
@@ -1265,7 +1265,7 @@ DirEntry DirEntry::operator+( const DirEntry& rEntry ) const
}
// irgendwas + "." (=> pEntryTop == &rEntry)
- if (pEntryTop->eFlag == FSYS_FLAG_RELROOT && !pEntryTop->aName.getLength())
+ if (pEntryTop->eFlag == FSYS_FLAG_RELROOT && pEntryTop->aName.isEmpty())
{
DBG_ASSERT( pEntryTop == &rEntry, "DirEntry::op+ buggy" );
return *this;
@@ -1283,7 +1283,7 @@ DirEntry DirEntry::operator+( const DirEntry& rEntry ) const
if ( pThisTop->eFlag == FSYS_FLAG_ABSROOT )
aDevice = pThisTop->aName;
DirEntry aRet = rEntry;
- if ( aDevice.getLength() )
+ if ( !aDevice.isEmpty() )
aRet.ImpGetTopPtr()->aName = aDevice;
return aRet;
}
@@ -1463,7 +1463,7 @@ DirEntry DirEntry::GetDevice() const
const DirEntry *pTop = ImpGetTopPtr();
if ( ( pTop->eFlag == FSYS_FLAG_ABSROOT || pTop->eFlag == FSYS_FLAG_RELROOT ) &&
- pTop->aName.getLength() )
+ !pTop->aName.isEmpty() )
return DirEntry( pTop->aName, FSYS_FLAG_VOLUME, FSYS_STYLE_HOST );
else
return DirEntry( rtl::OString(), FSYS_FLAG_INVALID, FSYS_STYLE_HOST );
@@ -1743,7 +1743,7 @@ FSysError DirEntry::ImpParseUnixName( const rtl::OString& rPfad, FSysPathStyle e
/* do nothing */;
// ist der Name die Root des aktuellen Drives?
- if ( nPos == 0 && aPfad.getLength() > 0 && ( aPfad[0] == '/' ) )
+ if ( nPos == 0 && !aPfad.isEmpty() && ( aPfad[0] == '/' ) )
{
// Root-Directory des aktuellen Drives
aStack.Push( new DirEntry( FSYS_FLAG_ABSROOT ) );
@@ -1805,10 +1805,10 @@ FSysError DirEntry::ImpParseUnixName( const rtl::OString& rPfad, FSysPathStyle e
// den Restpfad bestimmen
aPfad = nPos < aPfad.getLength()
? aPfad.copy(nPos + 1) : rtl::OString();
- while ( aPfad.getLength() && ( aPfad[0] == '/' ) )
+ while ( !aPfad.isEmpty() && ( aPfad[0] == '/' ) )
aPfad = aPfad.copy(1);
}
- while (aPfad.getLength());
+ while (!aPfad.isEmpty());
// Haupt-Entry (selbst) zuweisen
if ( aStack.Empty() )
diff --git a/tools/source/fsys/tempfile.cxx b/tools/source/fsys/tempfile.cxx
index c41b823764da..4a5c957c17f7 100644
--- a/tools/source/fsys/tempfile.cxx
+++ b/tools/source/fsys/tempfile.cxx
@@ -92,7 +92,7 @@ String ConstructTempDir_Impl( const String* pParent )
{
// if no parent or invalid parent : use system directory
::rtl::OUString& rTempNameBase_Impl = TempNameBase_Impl::get();
- if ( !rTempNameBase_Impl.getLength() )
+ if ( rTempNameBase_Impl.isEmpty() )
rTempNameBase_Impl = GetSystemTempDir_Impl();
aName = rTempNameBase_Impl;
}
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 9e3567e6701d..ffbdaa88893c 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -843,7 +843,7 @@ bool INetURLObject::setAbsURIRef(rtl::OUString const & rTheAbsURIRef,
if (m_eScheme == INET_PROT_NOT_VALID) {
sal_Unicode const * p1 = pPos;
aSynScheme = parseScheme(&p1, pEnd, nFragmentDelimiter);
- if (aSynScheme.getLength() > 0)
+ if (!aSynScheme.isEmpty())
{
m_eScheme = INET_PROT_GENERIC;
pPos = p1;
@@ -1509,7 +1509,7 @@ bool INetURLObject::convertRelToAbs(rtl::OUString const & rTheRelURIRef,
bool hasScheme = pPrefix != 0;
if (!hasScheme) {
pPrefixBegin = p;
- hasScheme = parseScheme(&pPrefixBegin, pEnd, '#').getLength() > 0;
+ hasScheme = !parseScheme(&pPrefixBegin, pEnd, '#').isEmpty();
}
sal_uInt32 nSegmentDelimiter = '/';
@@ -2299,7 +2299,7 @@ bool INetURLObject::setUser(rtl::OUString const & rTheUser,
{
if (
!getSchemeInfo().m_bUser ||
- (m_eScheme == INET_PROT_IMAP && rTheUser.getLength() == 0)
+ (m_eScheme == INET_PROT_IMAP && rTheUser.isEmpty())
)
{
return false;
@@ -4112,12 +4112,12 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
bool bUserInfo = false;
if (getSchemeInfo().m_bUser)
{
- if (m_eScheme == INET_PROT_IMAP && rTheUser.getLength() == 0)
+ if (m_eScheme == INET_PROT_IMAP && rTheUser.isEmpty())
{
setInvalid();
return false;
}
- if (rTheUser.getLength() != 0)
+ if (!rTheUser.isEmpty())
{
m_aUser.set(m_aAbsURIRef,
encodeText(rTheUser, false,
@@ -4132,12 +4132,12 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
bUserInfo = true;
}
}
- else if (rTheUser.getLength() != 0)
+ else if (!rTheUser.isEmpty())
{
setInvalid();
return false;
}
- if (rThePassword.getLength() != 0)
+ if (!rThePassword.isEmpty())
{
if (getSchemeInfo().m_bPassword)
{
@@ -4218,7 +4218,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
}
}
}
- else if (rTheHost.getLength() != 0 || nThePort != 0)
+ else if (!rTheHost.isEmpty() || nThePort != 0)
{
setInvalid();
return false;
@@ -4250,7 +4250,7 @@ rtl::OUString INetURLObject::GetAbsURL(rtl::OUString const & rTheBaseURIRef,
FSysStyle eStyle)
{
// Backwards compatibility:
- if (rTheRelURIRef.getLength() == 0 || rTheRelURIRef[0] == '#')
+ if (rTheRelURIRef.isEmpty() || rTheRelURIRef[0] == '#')
return rTheRelURIRef;
INetURLObject aTheAbsURIRef;
diff --git a/tools/source/generic/svlibrary.cxx b/tools/source/generic/svlibrary.cxx
index 290f9e50f4a1..8b46dfb916b3 100644
--- a/tools/source/generic/svlibrary.cxx
+++ b/tools/source/generic/svlibrary.cxx
@@ -83,7 +83,7 @@ static uno::Sequence< rtl::OUString > GetMultiPaths_Impl()
{
const bool bAddUser = (&rPathSeq == &aUserPaths);
const bool bAddInternal = (&rPathSeq == &aInternalPaths);
- if ((bAddUser || bAddInternal) && pPathSeq[k].getLength() > 0)
+ if ((bAddUser || bAddInternal) && !pPathSeq[k].isEmpty())
pRes[ nCount++ ] = pPathSeq[k];
}
}
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index 4343d085174d..a711e4adc0a9 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -310,7 +310,7 @@ bool parseParameters(ParameterList const & rInput,
if (pOutput)
for (Parameter * p = rInput.m_pList; p;)
{
- bool bCharset = p->m_aCharset.getLength() != 0;
+ bool bCharset = !p->m_aCharset.isEmpty();
rtl_TextEncoding eEncoding = RTL_TEXTENCODING_DONTKNOW;
if (bCharset)
eEncoding
diff --git a/tools/source/misc/appendunixshellword.cxx b/tools/source/misc/appendunixshellword.cxx
index 029d1da94214..64c8aa45ea21 100644
--- a/tools/source/misc/appendunixshellword.cxx
+++ b/tools/source/misc/appendunixshellword.cxx
@@ -45,7 +45,7 @@ void appendUnixShellWord(
rtl::OStringBuffer * accumulator, rtl::OString const & text)
{
OSL_ASSERT(accumulator != NULL);
- if (text.getLength() == 0) {
+ if (text.isEmpty()) {
accumulator->append(RTL_CONSTASCII_STRINGPARAM("''"));
} else {
bool quoted = false;
diff --git a/tools/source/misc/getprocessworkingdir.cxx b/tools/source/misc/getprocessworkingdir.cxx
index 29f7732f709b..c9c031729e22 100644
--- a/tools/source/misc/getprocessworkingdir.cxx
+++ b/tools/source/misc/getprocessworkingdir.cxx
@@ -45,7 +45,7 @@ bool getProcessWorkingDir(rtl::OUString &rUrl)
rUrl = rtl::OUString();
rtl::OUString s(RTL_CONSTASCII_USTRINGPARAM("$OOO_CWD"));
rtl::Bootstrap::expandMacros(s);
- if (s.getLength() == 0)
+ if (s.isEmpty())
{
if (osl_getProcessWorkingDir(&rUrl.pData) == osl_Process_E_None)
return true;
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 98605860ad9a..4652f2489210 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -203,8 +203,8 @@ void ResMgrContainer::init()
nIndex = 0;
while( nIndex >= 0 )
{
- OUString aPathElement( aEnvPath.getToken( 0, SAL_PATHSEPARATOR, nIndex ) );
- if( aPathElement.getLength() )
+ OUString aPathElement( aEnvPath.getToken( 0, SEARCH_PATH_DELIMITER, nIndex ) );
+ if( !aPathElement.isEmpty() )
{
OUString aFileURL;
File::getFileURLFromSystemPath( aPathElement, aFileURL );
@@ -269,7 +269,7 @@ namespace
return (
rLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("en")) &&
rLocale.Country.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("US")) &&
- rLocale.Variant.getLength() == 0
+ rLocale.Variant.isEmpty()
);
}
}
@@ -284,11 +284,11 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
boost::unordered_map< OUString, ContainerElement, OUStringHash >::iterator it = m_aResFiles.end();
int nTries = 0;
- if( aLocale.Language.getLength() > 0 )
+ if( !aLocale.Language.isEmpty() )
nTries = 1;
- if( aLocale.Country.getLength() > 0 )
+ if( !aLocale.Country.isEmpty() )
nTries = 2;
- if( aLocale.Variant.getLength() > 0 )
+ if( !aLocale.Variant.isEmpty() )
nTries = 3;
while( nTries-- )
{
@@ -377,16 +377,16 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
{
OUStringBuffer sKey = rPrefix;
sKey.append( rLocale.Language );
- if( rLocale.Country.getLength() )
+ if( !rLocale.Country.isEmpty() )
{
sKey.append( sal_Unicode('-') );
sKey.append( rLocale.Country );
}
- if( rLocale.Variant.getLength() )
+ if( !rLocale.Variant.isEmpty() )
{
sKey.append( sal_Unicode('-') );
sKey.append( rLocale.Variant );
- } // if( aLocale.Variant.getLength() )
+ } // if( !aLocale.Variant.isEmpty() )
::rtl::OUString sURL = sKey.makeStringAndClear();
sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".res"));
if ( m_aResFiles.find(sURL) == m_aResFiles.end() )
@@ -437,9 +437,9 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
InternalResMgr* ResMgrContainer::getNextFallback( InternalResMgr* pMgr )
{
com::sun::star::lang::Locale aLocale = pMgr->aLocale;
- if( aLocale.Variant.getLength() )
+ if( !aLocale.Variant.isEmpty() )
aLocale.Variant = OUString();
- else if( aLocale.Country.getLength() )
+ else if( !aLocale.Country.isEmpty() )
aLocale.Country = OUString();
else if( !isAlreadyPureenUS(aLocale) )
{
@@ -1663,7 +1663,7 @@ ResMgr* ResMgr::CreateResMgr( const sal_Char* pPrefixName,
OUString aPrefix( pPrefixName, strlen( pPrefixName ), osl_getThreadTextEncoding() );
- if( ! aLocale.Language.getLength() )
+ if( aLocale.Language.isEmpty() )
aLocale = ResMgrContainer::get().getDefLocale();
InternalResMgr* pImp = ResMgrContainer::get().getResMgr( aPrefix, aLocale );
@@ -1680,7 +1680,7 @@ ResMgr* ResMgr::SearchCreateResMgr(
OUString aPrefix( pPrefixName, strlen( pPrefixName ), osl_getThreadTextEncoding() );
- if( ! rLocale.Language.getLength() )
+ if( rLocale.Language.isEmpty() )
rLocale = ResMgrContainer::get().getDefLocale();
InternalResMgr* pImp = ResMgrContainer::get().getResMgr( aPrefix, rLocale );
@@ -1907,7 +1907,7 @@ SimpleResMgr::SimpleResMgr( const sal_Char* pPrefixName,
com::sun::star::lang::Locale aLocale( rLocale );
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
- if( ! aLocale.Language.getLength() )
+ if( aLocale.Language.isEmpty() )
aLocale = ResMgrContainer::get().getDefLocale();
m_pResImpl = ResMgrContainer::get().getResMgr( aPrefix, aLocale, true );