[PATCH] fdo#43460 include, registry, svtools, svx, unodevtools: use isEm...
Jelle van der Waa (via Code Review)
gerrit at gerrit.libreoffice.org
Tue Jun 18 03:05:32 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/4335
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/35/4335/1
fdo#43460 include,registry,svtools,svx,unodevtools: use isEmpty()
Change-Id: I6e35b91092239275694eec3666b076f7ff7e54f6
---
M include/rtl/ustrbuf.hxx
M registry/source/keyimpl.cxx
M svtools/source/svhtml/parhtml.cxx
M svtools/source/svrtf/parrtf.cxx
M svx/source/form/formcontroller.cxx
M svx/source/svdraw/svdmodel.cxx
M svx/source/svdraw/svdtrans.cxx
M unodevtools/source/skeletonmaker/cppcompskeleton.cxx
M unodevtools/source/skeletonmaker/javacompskeleton.cxx
9 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index b648714..ec40448 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -421,7 +421,7 @@
*/
OUStringBuffer & append(const OUStringBuffer &str)
{
- if(str.getLength() > 0)
+ if(!str.isEmpty())
{
append( str.getStr(), str.getLength() );
}
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx
index 05993dd..36d6cae 100644
--- a/registry/source/keyimpl.cxx
+++ b/registry/source/keyimpl.cxx
@@ -1043,7 +1043,7 @@
OUString ORegKey::getFullPath(OUString const & path) const {
OSL_ASSERT(!m_name.isEmpty() && !path.isEmpty());
OUStringBuffer b(m_name);
- if (b.getLength() > 0 && b[b.getLength() - 1] == '/') {
+ if (!b.isEmpty() && b[b.getLength() - 1] == '/') {
if (path[0] == '/') {
b.append(path.getStr() + 1, path.getLength() - 1);
} else {
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index a95ec79..2430d72 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -648,7 +648,7 @@
{
// Restart with '&', the remainder is returned as
// text token.
- if( aToken.Len() || sTmpBuffer.getLength() )
+ if( aToken.Len() || !sTmpBuffer.isEmpty() )
{
// _GetNextChar() returns the previous text and
// during the next execution a new character is read.
@@ -808,7 +808,7 @@
rInput.IsEof() ) ||
!IsParserWorking() )
{
- if( sTmpBuffer.getLength() )
+ if( !sTmpBuffer.isEmpty() )
aToken += String(sTmpBuffer.makeStringAndClear());
return HTML_TEXTTOKEN;
}
@@ -824,7 +824,7 @@
nNextCh = GetNextChar();
}
- if( sTmpBuffer.getLength() )
+ if( !sTmpBuffer.isEmpty() )
aToken += String(sTmpBuffer.makeStringAndClear());
return HTML_TEXTTOKEN;
@@ -1016,7 +1016,7 @@
if( rInput.IsEof() )
{
bContinue = false;
- if( aToken.Len() || sTmpBuffer.getLength() )
+ if( aToken.Len() || !sTmpBuffer.isEmpty() )
{
bEndTokenFound = true;
}
@@ -1036,7 +1036,7 @@
break;
}
- if( (!bContinue && sTmpBuffer.getLength() > 0L) ||
+ if( (!bContinue && !sTmpBuffer.isEmpty()) ||
MAX_LEN == sTmpBuffer.getLength() )
aToken += String(sTmpBuffer.makeStringAndClear());
@@ -1119,7 +1119,7 @@
} while( '>' != nNextCh && '/' != nNextCh && !HTML_ISSPACE( nNextCh ) &&
IsParserWorking() && !rInput.IsEof() );
- if( sTmpBuffer.getLength() )
+ if( !sTmpBuffer.isEmpty() )
aToken += String(sTmpBuffer.makeStringAndClear());
// Skip blanks
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index f064a56..0ca1c79 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -338,7 +338,7 @@
wchar_t __next=GetNextChar();
if (__next>0xFF) // fix for #i43933# and #i35653#
{
- if (aByteString.getLength())
+ if (!aByteString.isEmpty())
aStrBuffer.Append(String(OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding())));
aStrBuffer.Append((sal_Unicode)__next);
@@ -373,7 +373,7 @@
bNextCh = false;
- if (aByteString.getLength())
+ if (!aByteString.isEmpty())
aStrBuffer.Append(String(OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding())));
}
break;
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 9a0ee3e..7145abb 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -870,9 +870,9 @@
aRowFilter.append( sCriteria );
}
}
- if ( aRowFilter.getLength() > 0 )
+ if ( !aRowFilter.isEmpty() )
{
- if ( aFilter.getLength() )
+ if ( !aFilter.isEmpty() )
aFilter.appendAscii( " OR " );
aFilter.appendAscii( "( " );
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index f62bd32..04d751d 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1315,11 +1315,11 @@
if(!rLoc.isNumTrailingZeros())
{
// Remove all trailing zeros.
- while (aBuf.getLength() && aBuf[aBuf.getLength()-1] == sal_Unicode('0'))
+ while (!aBuf.isEmpty() && aBuf[aBuf.getLength()-1] == sal_Unicode('0'))
aBuf.remove(aBuf.getLength()-1, 1);
// Remove decimal if it's the last character.
- if (aBuf.getLength() && aBuf[aBuf.getLength()-1] == cDec)
+ if (!aBuf.isEmpty() && aBuf[aBuf.getLength()-1] == cDec)
aBuf.remove(aBuf.getLength()-1, 1);
}
@@ -1340,7 +1340,7 @@
}
}
- if (!aBuf.getLength())
+ if (aBuf.isEmpty())
aBuf.append(sal_Unicode('0'));
if(bNegative)
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index 91e3f77..60710ed 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -925,7 +925,7 @@
}
}
- if(!aStr.getLength())
+ if(aStr.isEmpty())
aStr.insert(aStr.getLength(), aNullCode);
if(bNeg && (aStr.getLength() > 1 || aStr[0] != aNullCode[0]))
diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
index 435ee4d..98166ee 100644
--- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
@@ -808,14 +808,14 @@
}
if (propinterfaces.find("com/sun/star/beans/XFastPropertySet")
!= propinterfaces.end()) {
- if (buffer.getLength() > 0)
+ if (!buffer.isEmpty())
buffer.append(" | IMPLEMENTS_FAST_PROPERTY_SET");
else
buffer.append("IMPLEMENTS_FAST_PROPERTY_SET");
}
if (propinterfaces.find("com/sun/star/beans/XPropertyAccess")
!= propinterfaces.end()) {
- if (buffer.getLength() > 0)
+ if (!buffer.isEmpty())
buffer.append(" | IMPLEMENTS_PROPERTY_ACCESS");
else
buffer.append("IMPLEMENTS_PROPERTY_ACCESS");
diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
index b617eea..86ba705 100644
--- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
@@ -206,7 +206,7 @@
for (sal_uInt16 i = 0; i < 9; i++)
{
if (attribute & attributes[i]) {
- if (attributeValue.getLength() > 0) {
+ if (!attributeValue.isEmpty()) {
cast |= true;
attributeValue.append("|");
}
--
To view, visit https://gerrit.libreoffice.org/4335
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e35b91092239275694eec3666b076f7ff7e54f6
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Jelle van der Waa <jelle at vdwaa.nl>
More information about the LibreOffice
mailing list