[PATCH] fdo#43460 tools: use isEmpty()

Jelle van der Waa (via Code Review) gerrit at gerrit.libreoffice.org
Tue Jun 18 02:43:31 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4333

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/33/4333/1

fdo#43460 tools: use isEmpty()

Change-Id: I832473cab555d8ac5c6b2a47d51124ac63e996e9
---
M tools/source/fsys/urlobj.cxx
M tools/source/memtools/multisel.cxx
M tools/source/stream/stream.cxx
3 files changed, 21 insertions(+), 21 deletions(-)



diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 071ca7a..77128d7 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -899,7 +899,7 @@
                                    eCharset,
                                    false);
                     }
-                    if (aSynAuthority.getLength() == 0)
+                    if (aSynAuthority.isEmpty())
                     {
                         setInvalid();
                         return false;
@@ -965,7 +965,7 @@
                                    false);
                     }
                 }
-                if (aSynAuthority.getLength() == 0)
+                if (aSynAuthority.isEmpty())
                 {
                     setInvalid();
                     return false;
@@ -1987,7 +1987,7 @@
     // new relative URL would neither be empty nor start with <"/"> nor start
     // with <1*rseg> (i.e., it could be mistaken for an absolute URL starting
     // with a scheme part), then the new relative URL is prefixed with "./":
-    if (aSynRelURIRef.getLength() == 0)
+    if (aSynRelURIRef.isEmpty())
     {
         if (pSubjectPathEnd - pSubjectPathBegin >= nMatch + 2
             && pSubjectPathBegin[nMatch] == '/'
@@ -2886,12 +2886,12 @@
             }
             break;
         case INET_PROT_LDAP:
-            if (aSynHost.getLength() == 0 && m_aPort.isPresent())
+            if (aSynHost.isEmpty() && m_aPort.isPresent())
                 return false;
             break;
 
         default:
-            if (aSynHost.getLength() == 0)
+            if (aSynHost.isEmpty())
                 return false;
             break;
     }
@@ -2944,7 +2944,7 @@
                 appendUCS4(aTheSynPath, nUTF32, eEscapeType, bOctets,
                            PART_HTTP_PATH, '%', eCharset, true);
             }
-            if (aTheSynPath.getLength() == 0)
+            if (aTheSynPath.isEmpty())
                 aTheSynPath.append(sal_Unicode('/'));
             break;
 
@@ -2965,7 +2965,7 @@
                 appendUCS4(aTheSynPath, nUTF32, eEscapeType, bOctets,
                            PART_HTTP_PATH, '%', eCharset, true);
             }
-            if (aTheSynPath.getLength() == 0)
+            if (aTheSynPath.isEmpty())
                 aTheSynPath.append(sal_Unicode('/'));
             break;
 
@@ -3008,7 +3008,7 @@
                 appendUCS4(aTheSynPath, nUTF32, eEscapeType, bOctets,
                            PART_PCHAR, '%', eCharset, true);
             }
-            if (aTheSynPath.getLength() == 0)
+            if (aTheSynPath.isEmpty())
                 aTheSynPath.append(sal_Unicode('/'));
             break;
         }
@@ -3076,7 +3076,7 @@
                 appendUCS4(aTheSynPath, nUTF32, eEscapeType, bOctets,
                            PART_NEWS_ARTICLE_LOCALPART, '%', eCharset, true);
             }
-            if (aTheSynPath.getLength() == 0)
+            if (aTheSynPath.isEmpty())
                 return false;
             ++pPos;
             aTheSynPath.append(sal_Unicode('@'));
@@ -3197,7 +3197,7 @@
                     appendUCS4(aTheSynPath, nUTF32, eEscapeType, bOctets,
                                PART_PCHAR, '%', eCharset, false);
             }
-            if (aTheSynPath.getLength() == 0)
+            if (aTheSynPath.isEmpty())
                 aTheSynPath.append(sal_Unicode('/'));
             break;
 
@@ -3362,7 +3362,7 @@
                 appendUCS4(aTheSynPath, nUTF32, eEscapeType, bOctets,
                            PART_URIC, '%', eCharset, true);
             }
-            if (aTheSynPath.getLength() == 0)
+            if (aTheSynPath.isEmpty())
                 return false;
             break;
         default:
@@ -3732,7 +3732,7 @@
     }
     else
     {
-        if (m_aAbsURIRef.getLength() != 0)
+        if (!m_aAbsURIRef.isEmpty())
         {
             sal_Unicode const * pSchemeBegin
                 = m_aAbsURIRef.getStr();
@@ -3874,7 +3874,7 @@
         aBuffer.
             append(decode(m_aFragment, cEscapePrefix, eMechanism, eCharset));
     }
-    if (aBuffer.getLength() != 0)
+    if (!aBuffer.isEmpty())
     {
         OUStringBuffer aResult(aBuffer);
         if (rStringWidth->queryStringWidth(aResult.makeStringAndClear())
@@ -3884,7 +3884,7 @@
                 if (i == 0)
                 {
                     aBuffer.setLength(aBuffer.getLength() - 1);
-                    if (aBuffer.getLength() == 0)
+                    if (aBuffer.isEmpty())
                         break;
                 }
                 else
@@ -4088,7 +4088,7 @@
                     break;
 
                 case INET_PROT_LDAP:
-                    if (aSynHost.getLength() == 0 && nThePort != 0)
+                    if (aSynHost.isEmpty() && nThePort != 0)
                     {
                         setInvalid();
                         return false;
@@ -4096,7 +4096,7 @@
                     break;
 
                 default:
-                    if (aSynHost.getLength() == 0)
+                    if (aSynHost.isEmpty())
                     {
                         setInvalid();
                         return false;
@@ -4289,7 +4289,7 @@
     else
         aNewPath.append(m_aAbsURIRef.getStr() + aSegment.getEnd(),
                         m_aPath.getEnd() - aSegment.getEnd());
-    if (aNewPath.getLength() == 0 && !aSegment.isEmpty() &&
+    if (aNewPath.isEmpty() && !aSegment.isEmpty() &&
         m_aAbsURIRef[aSegment.getBegin()] == '/')
     {
         aNewPath.append(sal_Unicode('/'));
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index d91c499..25e4d70 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -714,7 +714,7 @@
     {
         while( *pInput >= sal_Unicode('0') && *pInput <= sal_Unicode('9') )
             aNumberBuf.append( *pInput++ );
-        if( aNumberBuf.getLength() )
+        if( !aNumberBuf.isEmpty() )
         {
             sal_Int32 nNumber = aNumberBuf.makeStringAndClear().toInt32() + mnOffset;
             aNumbers.push_back( nNumber );
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index e802566..cc7667d 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -585,7 +585,7 @@
             aBuf.append(buf, n);
     }
 
-    if ( !bEnd && !GetError() && aBuf.getLength() )
+    if ( !bEnd && !GetError() && !aBuf.isEmpty() )
         bEnd = sal_True;
 
     nOldFilePos += nTotalLen;
@@ -627,7 +627,7 @@
         nLen /= sizeof(sal_Unicode);
         if ( !nLen )
         {
-            if ( aBuf.getLength() == 0 )
+            if ( aBuf.isEmpty() )
             {
                 // exit on first BlockRead error
                 bIsEof = sal_True;
@@ -671,7 +671,7 @@
             aBuf.append( buf, n );
     }
 
-    if ( !bEnd && !GetError() && aBuf.getLength() )
+    if ( !bEnd && !GetError() && !aBuf.isEmpty() )
         bEnd = sal_True;
 
     nOldFilePos += nTotalLen * sizeof(sal_Unicode);

-- 
To view, visit https://gerrit.libreoffice.org/4333
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I832473cab555d8ac5c6b2a47d51124ac63e996e9
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