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

Jelle van der Waa (via Code Review) gerrit at gerrit.libreoffice.org
Tue Jun 18 03:05:27 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4334

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/34/4334/1

fdo#43460 sw: use isEmpty()

Change-Id: Ia23f01ee28f1dfd8079abedda50bbef0a5a1beec
---
M sw/source/core/crsr/crstrvl.cxx
M sw/source/filter/html/css1atr.cxx
M sw/source/filter/html/htmlatr.cxx
M sw/source/filter/html/htmldraw.cxx
M sw/source/filter/html/htmlfly.cxx
M sw/source/filter/html/htmlforw.cxx
M sw/source/filter/html/htmlnum.cxx
M sw/source/filter/ww8/rtfattributeoutput.cxx
M sw/source/filter/ww8/rtfsdrexport.cxx
M sw/source/filter/xml/xmltexte.cxx
10 files changed, 21 insertions(+), 21 deletions(-)



diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index a206d0c..0869c46 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1793,7 +1793,7 @@
                         comphelper::string::padToLength(sInsert, aFPos.nTabCnt, '\t');
                     if (aFPos.nSpaceCnt)
                         comphelper::string::padToLength(sInsert, sInsert.getLength() + aFPos.nSpaceCnt, ' ');
-                    if (sInsert.getLength())
+                    if (!sInsert.isEmpty())
                         GetDoc()->InsertString( *m_pCurCrsr, sInsert.makeStringAndClear());
                 }
                 // no break - still need to set orientation
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 5a348e4..db343f0 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -281,7 +281,7 @@
             sOut.append(OUStringToOString(*pSVal, eDestEnc));
     }
 
-    if (sOut.getLength())
+    if (!sOut.isEmpty())
         Strm() << sOut.makeStringAndClear().getStr();
 }
 
@@ -524,7 +524,7 @@
             sOut.append(sCSS1_rule_end);
             break;
         }
-        if (sOut.getLength())
+        if (!sOut.isEmpty())
             Strm() << sOut.makeStringAndClear().getStr();
     }
 }
@@ -2503,26 +2503,26 @@
 
     if( pOStr )
     {
-        if (sOut.getLength())
+        if (!sOut.isEmpty())
             sOut.append(' ');
         sOut.append(pOStr);
     }
 
     if( pCOStr )
     {
-        if (sOut.getLength())
+        if (!sOut.isEmpty())
             sOut.append(' ');
         sOut.append(pCOStr);
     }
 
     if( pBStr )
     {
-        if (sOut.getLength())
+        if (!sOut.isEmpty())
             sOut.append(' ');
         sOut.append(pBStr);
     }
 
-    if (sOut.getLength())
+    if (!sOut.isEmpty())
         rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_decoration, sOut.makeStringAndClear() );
     else if( bNone )
         rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_decoration, sCSS1_PV_none );
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 34514eb..2ce7beb 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -914,7 +914,7 @@
 
         if( nDir != rHWrt.nDirection )
         {
-            if( sOut.getLength() )
+            if( !sOut.isEmpty() )
                 rWrt.Strm() << sOut.makeStringAndClear().getStr();
             rHWrt.OutDirection( nDir );
         }
@@ -3022,7 +3022,7 @@
     if( sRel.Len() )
         sOut.append(OUStringToOString(sRel, RTL_TEXTENCODING_ASCII_US));
 
-    if( sOut.getLength() )
+    if( !sOut.isEmpty() )
         rWrt.Strm() << sOut.makeStringAndClear().getStr();
 
     if( bEvents )
diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx
index d098988..7b950c5 100644
--- a/sw/source/filter/html/htmldraw.cxx
+++ b/sw/source/filter/html/htmldraw.cxx
@@ -816,7 +816,7 @@
         HTMLOutFuncs::Out_Color( rWrt.Strm(), rFillColor, rHTMLWrt.eDestEnc );
     }
 
-    if (sOut.getLength())
+    if (!sOut.isEmpty())
         rWrt.Strm() << sOut.makeStringAndClear().getStr();
 
     // und nun noch ALIGN, HSPACE und VSPACE
diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index b7fdd6f..f17643b 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -742,7 +742,7 @@
         }
     }
 
-    if (sOut.getLength())
+    if (!sOut.isEmpty())
         Strm() << sOut.makeStringAndClear().getStr();
 
     // Umlauf fuer absatzgeb. Grafiken als <BR CLEAR=...> in den String
@@ -1039,7 +1039,7 @@
                 sOut.append('\"');
             }
 
-            if (sOut.getLength())
+            if (!sOut.isEmpty())
                 rWrt.Strm() << sOut.makeStringAndClear().getStr();
 
             if( pMacItem )
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index c9b1695..79afa49 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -1063,7 +1063,7 @@
         }
     }
 
-    if( sOut.getLength() )
+    if( !sOut.isEmpty() )
         rWrt.Strm() << sOut.makeStringAndClear().getStr();
 
     OSL_ENSURE( !bInCntnr, "Container wird fuer Controls nicht unterstuertzt" );
diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx
index 3555f87..9d1620a 100644
--- a/sw/source/filter/html/htmlnum.cxx
+++ b/sw/source/filter/html/htmlnum.cxx
@@ -873,7 +873,7 @@
             }
         }
 
-        if (sOut.getLength())
+        if (!sOut.isEmpty())
             rWrt.Strm() << sOut.makeStringAndClear().getStr();
 
         if( rWrt.bCfgOutStyles )
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index d726cb5..d93fdd2 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -977,7 +977,7 @@
     if ( m_nTableDepth > 1 )
     {
         m_aAfterRuns.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS);
-        if (m_aRowDefs.getLength() > 0)
+        if (!m_aRowDefs.isEmpty())
             m_aAfterRuns.append(m_aRowDefs.makeStringAndClear());
         else if (!m_aTables.empty())
         {
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 1b4cafd..cb2f885 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -60,7 +60,7 @@
     if ( nEscherContainer == ESCHER_SpContainer )
     {
         m_nShapeType = ESCHER_ShpInst_Nil;
-        if ( m_pShapeStyle->getLength() )
+        if ( !m_pShapeStyle->isEmpty() )
             m_pShapeStyle->makeStringAndClear();
         m_pShapeStyle->ensureCapacity( 200 );
         m_aShapeProps.clear();
@@ -318,7 +318,7 @@
                             }
                         }
 
-                        if (aVerticies.getLength() )
+                        if (!aVerticies.isEmpty() )
                         {
                             // We know the number of vertices at the end only, so we have to prepend them here.
                             OStringBuffer aBuf;
@@ -326,7 +326,7 @@
                             aBuf.append(aVerticies.makeStringAndClear());
                             m_aShapeProps.insert(std::pair<OString,OString>("pVerticies", aBuf.makeStringAndClear()));
                         }
-                        if ( aSegmentInfo.getLength() )
+                        if ( !aSegmentInfo.isEmpty() )
                             m_aShapeProps.insert(std::pair<OString,OString>("pSegmentInfo", aSegmentInfo.makeStringAndClear()));
                     }
                     else
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index fe7edfb..54217e8 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -515,7 +515,7 @@
                     case '.':
                     case '\'':
                     case '\\':
-                        if( !aBuffer.getLength() )
+                        if( aBuffer.isEmpty() )
                         {
                             aBuffer.append( (sal_Unicode)'\'' );
                             aBuffer.append( sRange.copy( 0, i ) );
@@ -524,11 +524,11 @@
                             aBuffer.append( (sal_Unicode)'\\' );
                         // no break!
                     default:
-                        if( aBuffer.getLength() )
+                        if( !aBuffer.isEmpty() )
                             aBuffer.append( c );
                 }
             }
-            if( aBuffer.getLength() )
+            if( !aBuffer.isEmpty() )
             {
                 aBuffer.append( (sal_Unicode)'\'' );
                 sRange = aBuffer.makeStringAndClear();

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

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