summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@alta.org.br>2012-01-13 15:54:57 -0200
committerOlivier Hallot <olivier.hallot@alta.org.br>2012-01-13 19:11:34 -0200
commit38423e0ad2a8e2a902aeb37391aef0b543c09d68 (patch)
tree2610f36fed95d4540d2e1d7e682dbd47bf6cf4ca /svl
parente60b212cc9f02d68ee638106a5881c21ac40ce8d (diff)
Fix for fdo43460 Part XXXVI getLength() to isEmpty()
Part XXXVI Modules svl
Diffstat (limited to 'svl')
-rw-r--r--svl/source/config/languageoptions.cxx2
-rw-r--r--svl/source/fsstor/fsfactory.cxx4
-rw-r--r--svl/source/fsstor/fsstorage.cxx10
-rw-r--r--svl/source/items/ctypeitm.cxx2
-rw-r--r--svl/source/items/srchitem.cxx2
-rw-r--r--svl/source/items/style.cxx2
-rw-r--r--svl/source/misc/filenotation.cxx4
-rw-r--r--svl/source/misc/folderrestriction.cxx2
-rw-r--r--svl/source/misc/lockfilecommon.cxx2
-rw-r--r--svl/source/misc/restrictedpaths.cxx2
-rw-r--r--svl/source/misc/sharecontrolfile.cxx2
-rw-r--r--svl/source/numbers/numfmuno.cxx2
-rw-r--r--svl/source/numbers/zforlist.cxx2
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx38
-rw-r--r--svl/source/passwordcontainer/syscreds.cxx4
15 files changed, 40 insertions, 40 deletions
diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx
index 77f1fce83a3b..94fbf42ff372 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -208,7 +208,7 @@ void SvtSystemLanguageOptions::Notify( const com::sun::star::uno::Sequence< r
LanguageType SvtSystemLanguageOptions::GetWin16SystemLanguage()
{
- if( m_sWin16SystemLocale.getLength() == 0 )
+ if( m_sWin16SystemLocale.isEmpty() )
return LANGUAGE_NONE;
return MsLangId::convertIsoStringToLanguage( m_sWin16SystemLocale );
}
diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx
index 464963f759fc..e092808f1a60 100644
--- a/svl/source/fsstor/fsfactory.cxx
+++ b/svl/source/fsstor/fsfactory.cxx
@@ -78,7 +78,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstance()
aTempURL = ::utl::TempFile( NULL, sal_True ).GetURL();
- if ( !aTempURL.getLength() )
+ if ( aTempURL.isEmpty() )
throw uno::RuntimeException(); // TODO: can not create tempfile
::ucbhelper::Content aResultContent(
@@ -131,7 +131,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA
if ( aArguments[0] >>= aURL )
{
- if ( !aURL.getLength() )
+ if ( aURL.isEmpty() )
{
OSL_FAIL( "Empty URL is provided!\n" );
throw uno::Exception(); // TODO: illegal argument
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index 01e4434a9c0c..47f52f475ce4 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -90,7 +90,7 @@ sal_Bool isLocalFile_Impl( ::rtl::OUString aURL )
{
}
- return ( aSystemPath.getLength() != 0 );
+ return ( !aSystemPath.isEmpty() );
}
@@ -117,7 +117,7 @@ struct FSStorage_Impl
, m_pTypeCollection( NULL )
, m_xFactory( xFactory )
{
- OSL_ENSURE( m_aURL.getLength(), "The URL must not be empty" );
+ OSL_ENSURE( !m_aURL.isEmpty(), "The URL must not be empty" );
}
FSStorage_Impl( const ::ucbhelper::Content& aContent, sal_Int32 nMode, uno::Reference< lang::XMultiServiceFactory > xFactory )
@@ -128,7 +128,7 @@ struct FSStorage_Impl
, m_pTypeCollection( NULL )
, m_xFactory( xFactory )
{
- OSL_ENSURE( m_aURL.getLength(), "The URL must not be empty" );
+ OSL_ENSURE( !m_aURL.isEmpty(), "The URL must not be empty" );
}
~FSStorage_Impl();
@@ -1061,7 +1061,7 @@ uno::Any SAL_CALL FSStorage::getByName( const ::rtl::OUString& aName )
if ( !GetContent() )
throw io::IOException(); // TODO: error handling
- if ( !aName.getLength() )
+ if ( aName.isEmpty() )
throw lang::IllegalArgumentException();
INetURLObject aURL( m_pImpl->m_aURL );
@@ -1186,7 +1186,7 @@ sal_Bool SAL_CALL FSStorage::hasByName( const ::rtl::OUString& aName )
if ( !GetContent() )
throw io::IOException(); // TODO: error handling
- if ( !aName.getLength() )
+ if ( aName.isEmpty() )
throw lang::IllegalArgumentException();
}
catch( uno::RuntimeException& )
diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx
index 84088c2c7ac2..d34c1db6a32e 100644
--- a/svl/source/items/ctypeitm.cxx
+++ b/svl/source/items/ctypeitm.cxx
@@ -223,7 +223,7 @@ bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uIn
{
// SetValue with an empty string resets the item; so call that
// function when PutValue is called with an empty string
- if (aValue.getLength() == 0)
+ if (aValue.isEmpty())
SetValue(aValue);
else
SetValue(
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index 8fca18ec7a20..d4c05c0892a4 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -503,7 +503,7 @@ bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMembe
case MID_SEARCH_LOCALE:
{
sal_Int16 nLocale;
- if (aSearchOpt.Locale.Language.getLength() || aSearchOpt.Locale.Country.getLength() )
+ if (!aSearchOpt.Locale.Language.isEmpty() || !aSearchOpt.Locale.Country.isEmpty() )
nLocale = MsLangId::convertLocaleToLanguage( aSearchOpt.Locale );
else
nLocale = LANGUAGE_NONE;
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 02ed772b5833..c49d9ad2ef9f 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -220,7 +220,7 @@ sal_Bool SfxStyleSheetBase::SetName( const XubString& rName )
rtl::OUString SfxStyleSheetBase::GetDisplayName() const
{
- if( maDisplayName.getLength() == 0 )
+ if( maDisplayName.isEmpty() )
{
return aName;
}
diff --git a/svl/source/misc/filenotation.cxx b/svl/source/misc/filenotation.cxx
index 065675ff7a6e..1cc73098daaf 100644
--- a/svl/source/misc/filenotation.cxx
+++ b/svl/source/misc/filenotation.cxx
@@ -67,10 +67,10 @@ namespace svt
m_sSystem = _rSystemPath;
if ( ( osl_File_E_None != osl_getFileURLFromSystemPath( m_sSystem.pData, &m_sFileURL.pData ) )
- && ( 0 == m_sFileURL.getLength() )
+ && ( m_sFileURL.isEmpty() )
)
{
- if ( _rSystemPath.getLength() )
+ if ( !_rSystemPath.isEmpty() )
{
INetURLObject aSmartParser;
aSmartParser.SetSmartProtocol( INET_PROT_FILE );
diff --git a/svl/source/misc/folderrestriction.cxx b/svl/source/misc/folderrestriction.cxx
index 8de4d294dcab..bb2fab561e99 100644
--- a/svl/source/misc/folderrestriction.cxx
+++ b/svl/source/misc/folderrestriction.cxx
@@ -81,7 +81,7 @@ static bool getEnvironmentValue( const sal_Char* _pAsciiEnvName, ::rtl::OUString
_rValue = ::rtl::OUString();
::rtl::OUString sEnvName = ::rtl::OUString::createFromAscii( _pAsciiEnvName );
osl_getEnvironment( sEnvName.pData, &_rValue.pData );
- return _rValue.getLength() != 0;
+ return !_rValue.isEmpty();
}
//-----------------------------------------------------------------------------
diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx
index 5bc5996ae93e..df1421b1b51e 100644
--- a/svl/source/misc/lockfilecommon.cxx
+++ b/svl/source/misc/lockfilecommon.cxx
@@ -201,7 +201,7 @@ uno::Sequence< ::rtl::OUString > LockFileCommon::ParseEntry( const uno::Sequence
{
SvtUserOptions aUserOpt;
::rtl::OUString aName = aUserOpt.GetFirstName();
- if ( aName.getLength() )
+ if ( !aName.isEmpty() )
aName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) );
aName += aUserOpt.GetLastName();
diff --git a/svl/source/misc/restrictedpaths.cxx b/svl/source/misc/restrictedpaths.cxx
index 1e6e74b1697d..37bd02370d79 100644
--- a/svl/source/misc/restrictedpaths.cxx
+++ b/svl/source/misc/restrictedpaths.cxx
@@ -47,7 +47,7 @@ namespace svt
_rValue = ::rtl::OUString();
::rtl::OUString sEnvName = ::rtl::OUString::createFromAscii( _pAsciiEnvName );
osl_getEnvironment( sEnvName.pData, &_rValue.pData );
- return _rValue.getLength() != 0;
+ return !_rValue.isEmpty();
}
//-----------------------------------------------------------------
diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx
index 45b4578c09a7..7eda0e251ea4 100644
--- a/svl/source/misc/sharecontrolfile.cxx
+++ b/svl/source/misc/sharecontrolfile.cxx
@@ -86,7 +86,7 @@ void ShareControlFile::OpenStream()
{
// if it is called outside of constructor the mutex must be locked already
- if ( !m_xStream.is() && m_aURL.getLength() )
+ if ( !m_xStream.is() && !m_aURL.isEmpty() )
{
uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
::ucbhelper::Content aContent = ::ucbhelper::Content( m_aURL, xDummyEnv );
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index 99ec1829cc9d..c678876dd033 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -115,7 +115,7 @@ const SfxItemPropertyMapEntry* lcl_GetNumberSettingsPropertyMap()
LanguageType lcl_GetLanguage( const lang::Locale& rLocale )
{
// empty language -> LANGUAGE_SYSTEM
- if ( rLocale.Language.getLength() == 0 )
+ if ( rLocale.Language.isEmpty() )
return LANGUAGE_SYSTEM;
LanguageType eRet = MsLangId::convertLocaleToLanguage( rLocale );
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 3aff518a583c..30bd5a756e0c 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1913,7 +1913,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat(
}
if ( rCode.Default )
pFormat->SetStandard();
- if ( rCode.DefaultName.getLength() )
+ if ( !rCode.DefaultName.isEmpty() )
pFormat->SetComment( rCode.DefaultName );
return pFormat;
}
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 5cbef9bf4e33..3afa5a5303f7 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -341,7 +341,7 @@ void StorageItem::setEncodedMP( const ::rtl::OUString& aEncoded, sal_Bool bAccep
sendNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasMaster"));
sendNames[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Master"));
- sal_Bool bHasMaster = ( aEncoded.getLength() > 0 || bAcceptEmpty );
+ sal_Bool bHasMaster = ( !aEncoded.isEmpty() || bAcceptEmpty );
sendVals[0] <<= bHasMaster;
sendVals[1] <<= aEncoded;
@@ -481,7 +481,7 @@ void SAL_CALL PasswordContainer::disposing( const EventObject& ) throw(RuntimeEx
vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUString& aLine, const ::rtl::OUString& aMasterPasswd ) throw(RuntimeException)
{
- if( aMasterPasswd.getLength() )
+ if( !aMasterPasswd.isEmpty() )
{
rtlCipher aDecoder = rtl_cipher_create (rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeStream );
OSL_ENSURE( aDecoder, "Can't create decoder\n" );
@@ -533,7 +533,7 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
::rtl::OUString PasswordContainer::EncodePasswords( vector< ::rtl::OUString > lines, const ::rtl::OUString& aMasterPasswd ) throw(RuntimeException)
{
- if( aMasterPasswd.getLength() )
+ if( !aMasterPasswd.isEmpty() )
{
::rtl::OString aSeq = ::rtl::OUStringToOString( createIndex( lines ), RTL_TEXTENCODING_UTF8 );
@@ -816,7 +816,7 @@ UrlRecord PasswordContainer::find(
{
::osl::MutexGuard aGuard( mMutex );
- if( !m_aContainer.empty() && aURL.getLength() )
+ if( !m_aContainer.empty() && !aURL.isEmpty() )
{
::rtl::OUString aUrl( aURL );
@@ -847,7 +847,7 @@ UrlRecord PasswordContainer::find(
}
}
}
- while( shorterUrl( aUrl ) && aUrl.getLength() );
+ while( shorterUrl( aUrl ) && !aUrl.isEmpty() );
}
return UrlRecord();
@@ -901,7 +901,7 @@ UrlRecord PasswordContainer::find(
if( !m_pStorageFile || !m_pStorageFile->useStorage() )
throw NoMasterException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Password storing is not active!")), Reference< XInterface >(), aRMode );
- if( !m_aMasterPasswd.getLength() && aHandler.is() )
+ if( m_aMasterPasswd.isEmpty() && aHandler.is() )
{
::rtl::OUString aEncodedMP;
sal_Bool bAskAgain = sal_False;
@@ -909,7 +909,7 @@ UrlRecord PasswordContainer::find(
if( !m_pStorageFile->getEncodedMP( aEncodedMP ) )
aRMode = PasswordRequestMode_PASSWORD_CREATE;
- else if ( !aEncodedMP.getLength() )
+ else if ( aEncodedMP.isEmpty() )
{
m_aMasterPasswd = GetDefaultMasterPassword();
bDefaultPassword = sal_True;
@@ -921,7 +921,7 @@ UrlRecord PasswordContainer::find(
bAskAgain = sal_False;
::rtl::OUString aPass = RequestPasswordFromUser( aRMode, aHandler );
- if ( aPass.getLength() )
+ if ( !aPass.isEmpty() )
{
if( aRMode == PasswordRequestMode_PASSWORD_CREATE )
{
@@ -947,7 +947,7 @@ UrlRecord PasswordContainer::find(
}
}
- if ( !m_aMasterPasswd.getLength() )
+ if ( m_aMasterPasswd.isEmpty() )
throw NoMasterException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No master password!")), Reference< XInterface >(), aRMode );
return m_aMasterPasswd;
@@ -1125,7 +1125,7 @@ sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::R
// the method should fail if there is no master password
if( m_pStorageFile && m_pStorageFile->useStorage() && m_pStorageFile->getEncodedMP( aEncodedMP ) )
{
- if ( !aEncodedMP.getLength() )
+ if ( aEncodedMP.isEmpty() )
{
// this is a default master password
// no UI is necessary
@@ -1139,7 +1139,7 @@ sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::R
xTmpHandler.set( xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler" ) ) ), uno::UNO_QUERY_THROW );
}
- if ( m_aMasterPasswd.getLength() )
+ if ( !m_aMasterPasswd.isEmpty() )
{
// there is a password, it should be just rechecked
PasswordRequestMode aRMode = PasswordRequestMode_PASSWORD_ENTER;
@@ -1147,16 +1147,16 @@ sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::R
do {
aPass = RequestPasswordFromUser( aRMode, xTmpHandler );
- bResult = ( aPass.getLength() && aPass.equals( m_aMasterPasswd ) );
+ bResult = ( !aPass.isEmpty() && aPass.equals( m_aMasterPasswd ) );
aRMode = PasswordRequestMode_PASSWORD_REENTER; // further questions with error notification
- } while( !bResult && aPass.getLength() );
+ } while( !bResult && !aPass.isEmpty() );
}
else
{
try
{
// ask for the password, if user provide no correct password an exception will be thrown
- bResult = ( GetMasterPassword( xTmpHandler ).getLength() > 0 );
+ bResult = !GetMasterPassword( xTmpHandler ).isEmpty();
}
catch( uno::Exception& )
{}
@@ -1186,7 +1186,7 @@ sal_Bool SAL_CALL PasswordContainer::changeMasterPassword( const uno::Reference<
sal_Bool bCanChangePassword = sal_True;
// if there is already a stored master password it should be entered by the user before the change happen
::rtl::OUString aEncodedMP;
- if( m_aMasterPasswd.getLength() || m_pStorageFile->getEncodedMP( aEncodedMP ) )
+ if( !m_aMasterPasswd.isEmpty() || m_pStorageFile->getEncodedMP( aEncodedMP ) )
bCanChangePassword = authorizateWithMasterPassword( xTmpHandler );
if ( bCanChangePassword )
@@ -1195,7 +1195,7 @@ sal_Bool SAL_CALL PasswordContainer::changeMasterPassword( const uno::Reference<
PasswordRequestMode aRMode = PasswordRequestMode_PASSWORD_CREATE;
::rtl::OUString aPass = RequestPasswordFromUser( aRMode, xTmpHandler );
- if ( aPass.getLength() )
+ if ( !aPass.isEmpty() )
{
// get all the persistent entries if it is possible
Sequence< UrlRecord > aPersistent = getAllPersistent( uno::Reference< task::XInteractionHandler >() );
@@ -1302,14 +1302,14 @@ void SAL_CALL PasswordContainer::removeMasterPassword()
sal_Bool bCanChangePassword = sal_True;
// if there is already a stored nondefault master password it should be entered by the user before the change happen
::rtl::OUString aEncodedMP;
- if( m_pStorageFile->getEncodedMP( aEncodedMP ) && aEncodedMP.getLength() )
+ if( m_pStorageFile->getEncodedMP( aEncodedMP ) && !aEncodedMP.isEmpty() )
bCanChangePassword = authorizateWithMasterPassword( xTmpHandler );
if ( bCanChangePassword )
{
// generate the default password
::rtl::OUString aPass = GetDefaultMasterPassword();
- if ( aPass.getLength() )
+ if ( !aPass.isEmpty() )
{
// get all the persistent entries if it is possible
Sequence< UrlRecord > aPersistent = getAllPersistent( uno::Reference< task::XInteractionHandler >() );
@@ -1348,7 +1348,7 @@ void SAL_CALL PasswordContainer::removeMasterPassword()
throw uno::RuntimeException();
::rtl::OUString aEncodedMP;
- return ( m_pStorageFile->useStorage() && m_pStorageFile->getEncodedMP( aEncodedMP ) && !aEncodedMP.getLength() );
+ return ( m_pStorageFile->useStorage() && m_pStorageFile->getEncodedMP( aEncodedMP ) && aEncodedMP.isEmpty() );
}
diff --git a/svl/source/passwordcontainer/syscreds.cxx b/svl/source/passwordcontainer/syscreds.cxx
index 66efc892cd65..66afb759072f 100644
--- a/svl/source/passwordcontainer/syscreds.cxx
+++ b/svl/source/passwordcontainer/syscreds.cxx
@@ -138,7 +138,7 @@ namespace
bool findURL( StringSet const & rContainer, rtl::OUString const & aURL, rtl::OUString & aResult )
{
// TODO: This code is actually copied from svl/source/passwordcontainer.cxx
- if( !rContainer.empty() && aURL.getLength() )
+ if( !rContainer.empty() && !aURL.isEmpty() )
{
::rtl::OUString aUrl( aURL );
@@ -167,7 +167,7 @@ namespace
}
}
}
- while( removeLastSegment( aUrl ) && aUrl.getLength() );
+ while( removeLastSegment( aUrl ) && !aUrl.isEmpty() );
}
aResult = rtl::OUString();
return false;