summaryrefslogtreecommitdiff
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
parent69d91300547f6ed45a9a499ffae71c2c0f91c441 (diff)
Fix for fdo43460 Part XXXIX getLength() to isEmpty()
Part XXXIX Modules testtools, toolkit, tools
-rw-r--r--testtools/source/bridgetest/bridgetest.cxx4
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx4
-rw-r--r--toolkit/source/awt/vclxwindow.cxx2
-rw-r--r--toolkit/source/awt/vclxwindows.cxx8
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx8
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx12
-rw-r--r--toolkit/source/controls/geometrycontrolmodel.cxx2
-rw-r--r--toolkit/source/controls/unocontrol.cxx2
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx8
-rw-r--r--toolkit/source/controls/unocontrols.cxx2
-rw-r--r--toolkit/source/helper/formpdfexport.cxx2
-rw-r--r--toolkit/source/helper/tkresmgr.cxx2
-rw-r--r--toolkit/source/helper/vclunohelper.cxx4
-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
25 files changed, 75 insertions, 75 deletions
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index 27af77bc796c..46435fb7e2d6 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -100,7 +100,7 @@ static bool check( bool b , char const * message )
namespace {
bool checkEmpty(rtl::OUString const & string, char const * message) {
- bool ok = string.getLength() == 0;
+ bool ok = string.isEmpty();
if (!ok) {
fprintf(
stderr, "%s failed: %s\n", message,
@@ -593,7 +593,7 @@ static sal_Bool performTest(
bRet &= check(
xLBT->getNullPolyLong().member == 0, "getNullPolyLong");
bRet &= check(
- xLBT->getNullPolyString().member.getLength() == 0,
+ xLBT->getNullPolyString().member.isEmpty(),
"getNullPolyString");
bRet &= check(
xLBT->getNullPolyType().member == Type(),
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index b9d94be3ec1b..3a8e2c625182 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -366,7 +366,7 @@ sal_uInt16 ImplGetComponentType( const String& rServiceName )
ComponentInfo aSearch;
rtl::OString aServiceName(rtl::OUStringToOString(rServiceName, osl_getThreadTextEncoding()).toAsciiLowerCase());
- if ( aServiceName.getLength() )
+ if ( !aServiceName.isEmpty() )
aSearch.pName = aServiceName.getStr();
else
aSearch.pName = "window";
@@ -1353,7 +1353,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > SAL_CALL VCLXToolkit::getClipboard( const ::rtl::OUString& clipboardName ) throw(::com::sun::star::uno::RuntimeException)
{
- if( clipboardName.getLength() == 0 )
+ if( clipboardName.isEmpty() )
{
if( !mxClipboard.is() )
{
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 76eab5bf0e37..7f2af75002f5 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -1545,7 +1545,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
case WINDOW_CANCELBUTTON:
case WINDOW_HELPBUTTON:
// Standard Button: overwrite only if not empty.
- if (aText.getLength())
+ if (!aText.isEmpty())
pWindow->SetText( aText );
break;
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 2669f0f21dce..f85bc3ce8da4 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2067,7 +2067,7 @@ namespace
{
Image lcl_getImageFromURL( const ::rtl::OUString& i_rImageURL )
{
- if ( !i_rImageURL.getLength() )
+ if ( i_rImageURL.isEmpty() )
return Image();
try
@@ -2174,7 +2174,7 @@ void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent ) throw
for ( sal_Int32 i=0; i<aItems.getLength(); ++i )
{
::rtl::OUString aLocalizationKey( aItems[i].First );
- if ( xStringResourceResolver.is() && aLocalizationKey.getLength() != 0 && aLocalizationKey[0] == '&' )
+ if ( xStringResourceResolver.is() && !aLocalizationKey.isEmpty() && aLocalizationKey[0] == '&' )
{
aLocalizationKey = xStringResourceResolver->resolveString(aLocalizationKey.copy( 1 ));
}
@@ -2973,7 +2973,7 @@ void VCLXFixedHyperlink::ProcessWindowEvent( const VclWindowEvent& rVclWindowEve
Reference< ::com::sun::star::system::XSystemShellExecute > xSystemShellExecute(
::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))), uno::UNO_QUERY );
- if ( sURL.getLength() > 0 && xSystemShellExecute.is() )
+ if ( !sURL.isEmpty() && xSystemShellExecute.is() )
{
try
{
@@ -4680,7 +4680,7 @@ void SAL_CALL VCLXComboBox::itemListChanged( const EventObject& i_rEvent ) throw
for ( sal_Int32 i=0; i<aItems.getLength(); ++i )
{
::rtl::OUString aLocalizationKey( aItems[i].First );
- if ( xStringResourceResolver.is() && aLocalizationKey.getLength() != 0 && aLocalizationKey[0] == '&' )
+ if ( xStringResourceResolver.is() && !aLocalizationKey.isEmpty() && aLocalizationKey[0] == '&' )
{
aLocalizationKey = xStringResourceResolver->resolveString(aLocalizationKey.copy( 1 ));
}
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index a227d61014cd..e717055747d3 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -595,7 +595,7 @@ void ControlModelContainerBase::insertByName( const ::rtl::OUString& aName, cons
- if ( !aName.getLength() || !xM.is() )
+ if ( aName.isEmpty() || !xM.is() )
lcl_throwIllegalArgumentException();
UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
@@ -1454,7 +1454,7 @@ void ControlContainerBase::ImplSetPosSize( Reference< XControl >& rxCtrl )
FontDescriptor aFD;
Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
aVal >>= aFD;
- if ( aFD.StyleName.getLength() )
+ if ( !aFD.StyleName.isEmpty() )
{
Reference< XFont > xFont = xD->getFont( aFD );
aFM = xFont->getFontMetric();
@@ -1860,7 +1860,7 @@ void ControlContainerBase::ImplUpdateResourceResolver()
uno::Reference< graphic::XGraphic > ControlContainerBase::Impl_getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL )
{
uno::Reference< graphic::XGraphic > xGraphic;
- if ( !_rURL.getLength() )
+ if ( _rURL.isEmpty() )
return xGraphic;
try
@@ -1895,7 +1895,7 @@ uno::Reference< graphic::XGraphic > ControlContainerBase::Impl_getGraphicFromURL
rUrl >>= url;
::rtl::OUString absoluteURL( url );
- if ( url.getLength() > 0 )
+ if ( !url.isEmpty() )
{
INetURLObject urlObj(baseLocation);
urlObj.removeSegment();
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index f152ff74823e..5a1303d84d25 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -336,7 +336,7 @@ void UnoDialogControl::PrepareWindowDescriptor( ::com::sun::star::awt::WindowDes
::rtl::OUString aImageURL;
Reference< graphic::XGraphic > xGraphic;
if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
- ( aImageURL.getLength() > 0 ))
+ ( !aImageURL.isEmpty() ))
{
::rtl::OUString absoluteUrl =
getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
@@ -564,7 +564,7 @@ void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChang
::rtl::OUString aImageURL;
Reference< graphic::XGraphic > xGraphic;
if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) &&
- ( aImageURL.getLength() > 0 ))
+ ( !aImageURL.isEmpty() ))
{
::rtl::OUString absoluteUrl =
getPhysicalLocation( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL )),
@@ -1018,7 +1018,7 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
ControlContainerBase::ImplSetPosSize( rxCtrl );
Reference < XWindow > xW( rxCtrl, UNO_QUERY );
- if ( !bOwnCtrl && xW.is() && sTitle.getLength() )
+ if ( !bOwnCtrl && xW.is() && !sTitle.isEmpty() )
{
awt::Rectangle aSizePos = xW->getPosSize();
@@ -1027,7 +1027,7 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
OutputDevice*pOutDev = Application::GetDefaultDevice();
if ( pOutDev )
{
- if ( !bOwnCtrl && sTitle.getLength() )
+ if ( !bOwnCtrl && !sTitle.isEmpty() )
{
// Adjust Y based on height of Title
::Rectangle aRect;
@@ -1044,7 +1044,7 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
FontDescriptor aFD;
Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
aVal >>= aFD;
- if ( aFD.StyleName.getLength() )
+ if ( !aFD.StyleName.isEmpty() )
{
Reference< XFont > xFont = xD->getFont( aFD );
aFM = xFont->getFontMetric();
@@ -1056,7 +1056,7 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
}
sal_Int16 nH = aFM.Ascent + aFM.Descent;
- if ( !bOwnCtrl && sTitle.getLength() )
+ if ( !bOwnCtrl && !sTitle.isEmpty() )
// offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
nY = nY + ( nH / 8); // how do I test this
}
diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx
index 9f6dd3eb21e5..82b1dd746996 100644
--- a/toolkit/source/controls/geometrycontrolmodel.cxx
+++ b/toolkit/source/controls/geometrycontrolmodel.cxx
@@ -635,7 +635,7 @@
sal_Int16 nAttributes(0);
static_cast< OPropertyArrayAggregationHelper* >( getArrayHelper( m_nPropertyMapId ) )->fillPropertyMembersByHandle( &sPropName, &nAttributes, _nHandle );
- if ( m_xAggregateSet.is() && sPropName.getLength() )
+ if ( m_xAggregateSet.is() && !sPropName.isEmpty() )
m_xAggregateSet->setPropertyValue( sPropName, _rValue );
}
}
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index 98e6392fe72e..b845b5984714 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -258,7 +258,7 @@ Reference< XWindowPeer > UnoControl::ImplGetCompatiblePeer( sal_Bool bAcceptE
bool UnoControl::ImplCheckLocalize( ::rtl::OUString& _rPossiblyLocalizable )
{
if ( !mpData->bLocalizationSupport
- || ( _rPossiblyLocalizable.getLength() == 0 )
+ || ( _rPossiblyLocalizable.isEmpty() )
|| ( _rPossiblyLocalizable[0] != '&' )
// TODO: make this reasonable. At the moment, everything which by accident starts with a & is considered
// localizable, which is probably wrong.
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 9c731d2edcdb..e00e791935bd 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -409,7 +409,7 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const
}
LocaleDataWrapper aLocaleInfo( maContext.getLegacyServiceFactory(), aLocale );
- if ( !sBankSymbol.getLength() )
+ if ( sBankSymbol.isEmpty() )
sBankSymbol = aLocaleInfo.getCurrBankSymbol();
// look for the currency entry (for this language) which has the given bank symbol
@@ -418,7 +418,7 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const
const Currency2* pAllCurrenciesEnd = pAllCurrencies + aAllCurrencies.getLength();
::rtl::OUString sCurrencySymbol = aLocaleInfo.getCurrSymbol();
- if ( !sBankSymbol.getLength() )
+ if ( sBankSymbol.isEmpty() )
{
DBG_ASSERT( pAllCurrencies != pAllCurrenciesEnd, "UnoControlModel::ImplGetDefaultValue: no currencies at all!" );
if ( pAllCurrencies != pAllCurrenciesEnd )
@@ -428,7 +428,7 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const
}
}
- if ( sBankSymbol.getLength() )
+ if ( !sBankSymbol.isEmpty() )
{
bool bLegacy = false;
for ( ;pAllCurrencies != pAllCurrenciesEnd; ++pAllCurrencies )
@@ -1048,7 +1048,7 @@ void UnoControlModel::read( const ::com::sun::star::uno::Reference< ::com::sun::
{
for ( i = 0; i < (sal_uInt32)aProps.getLength(); i++ )
{
- if ( !aProps.getConstArray()[i].getLength() )
+ if ( aProps.getConstArray()[i].isEmpty() )
{
::comphelper::removeElementAt( aProps, i );
::comphelper::removeElementAt( aValues, i );
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index 2fae9e6fa4d8..b193da5b0859 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -553,7 +553,7 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
else // linked
mxGrfObj = NULL; // release the GraphicObject
- if ( !_rURL.getLength() )
+ if ( _rURL.isEmpty() )
return xGraphic;
try
diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx
index cedc4825c7e4..957c0186620b 100644
--- a/toolkit/source/helper/formpdfexport.cxx
+++ b/toolkit/source/helper/formpdfexport.cxx
@@ -495,7 +495,7 @@ namespace toolkitform
{
::rtl::OUString sURL;
OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_TARGET_URL ) >>= sURL );
- const bool bDocumentLocalTarget = ( sURL.getLength() > 0 ) && ( sURL.getStr()[0] == '#' );
+ const bool bDocumentLocalTarget = !sURL.isEmpty() && ( sURL.getStr()[0] == '#' );
if ( bDocumentLocalTarget )
{
const ::rtl::OUString sDestinationName( sURL.copy(1) );
diff --git a/toolkit/source/helper/tkresmgr.cxx b/toolkit/source/helper/tkresmgr.cxx
index 7bf8b028c5dd..ed29c38dce44 100644
--- a/toolkit/source/helper/tkresmgr.cxx
+++ b/toolkit/source/helper/tkresmgr.cxx
@@ -104,7 +104,7 @@ Image TkResMgr::loadImage( sal_uInt16 nResId )
// -----------------------------------------------------------------------------
Image TkResMgr::getImageFromURL( const ::rtl::OUString& i_rImageURL )
{
- if ( !i_rImageURL.getLength() )
+ if ( i_rImageURL.isEmpty() )
return Image();
try
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index 888926e87143..4a38bf82a325 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -355,9 +355,9 @@ FontWeight VCLUnoHelper::ConvertFontWeight( float f )
Font VCLUnoHelper::CreateFont( const ::com::sun::star::awt::FontDescriptor& rDescr, const Font& rInitFont )
{
Font aFont( rInitFont );
- if ( rDescr.Name.getLength() )
+ if ( !rDescr.Name.isEmpty() )
aFont.SetName( rDescr.Name );
- if ( rDescr.StyleName.getLength() )
+ if ( !rDescr.StyleName.isEmpty() )
aFont.SetStyleName( rDescr.StyleName );
if ( rDescr.Height )
aFont.SetSize( Size( rDescr.Width, rDescr.Height ) );
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 );