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

Jelle van der Waa (via Code Review) gerrit at gerrit.libreoffice.org
Mon Jun 17 11:32:45 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4324

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/4324/1

fdo#43460 oox: use isEmpty()

Change-Id: If291a72d87001932c605755d628cecc088d50275
---
M oox/source/core/contexthandler2.cxx
M oox/source/drawingml/lineproperties.cxx
M oox/source/export/drawingml.cxx
M oox/source/export/vmlexport.cxx
M oox/source/helper/storagebase.cxx
M oox/source/ppt/commonbehaviorcontext.cxx
6 files changed, 10 insertions(+), 10 deletions(-)



diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx
index 560965a..735d339 100644
--- a/oox/source/core/contexthandler2.cxx
+++ b/oox/source/core/contexthandler2.cxx
@@ -167,7 +167,7 @@
 {
     OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::processCollectedChars - no context info" );
     ElementInfo& rInfo = mxContextStack->back();
-    if( rInfo.maChars.getLength() > 0 )
+    if( !rInfo.maChars.isEmpty() )
     {
         OUString aChars = rInfo.maChars.makeStringAndClear();
         if( mbEnableTrimSpace && rInfo.mbTrimSpaces )
diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx
index 09432ab..dce0ad7 100644
--- a/oox/source/drawingml/lineproperties.cxx
+++ b/oox/source/drawingml/lineproperties.cxx
@@ -203,7 +203,7 @@
         break;
     }
 
-    if( aBuffer.getLength() > 0 )
+    if( !aBuffer.isEmpty() )
     {
         sal_Int32 nLength = lclGetArrowSize( rArrowProps.moArrowLength.get( XML_med ) );
         sal_Int32 nWidth  = lclGetArrowSize( rArrowProps.moArrowWidth.get( XML_med ) );
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8cbeead..6b4f80e 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -780,7 +780,7 @@
             usLanguageBuffer.append( eLocale.Country );
         }
 
-        if( usLanguageBuffer.getLength() )
+        if( !usLanguageBuffer.isEmpty() )
             usLanguage = usLanguageBuffer.makeStringAndClear();
     }
 
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index a6f8af0..5381d2f 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -86,7 +86,7 @@
         m_nShapeType = ESCHER_ShpInst_Nil;
         m_pShapeAttrList = m_pSerializer->createAttrList();
 
-        if ( m_pShapeStyle->getLength() )
+        if ( !m_pShapeStyle->isEmpty() )
             m_pShapeStyle->makeStringAndClear();
 
         m_pShapeStyle->ensureCapacity( 200 );
@@ -132,7 +132,7 @@
     if ( pRect )
         AddRectangleDimensions( aStyle, *pRect );
 
-    if ( aStyle.getLength() )
+    if ( !aStyle.isEmpty() )
         pAttrList->add( XML_style, aStyle.makeStringAndClear() );
 
     // coordorigin/coordsize
@@ -499,7 +499,7 @@
                             }
                         }
 
-                        if ( aPath.getLength() )
+                        if ( !aPath.isEmpty() )
                             m_pShapeAttrList->add( XML_path, aPath.getStr() );
                     }
 #if OSL_DEBUG_LEVEL > 0
@@ -796,7 +796,7 @@
 void VMLExport::AddLineDimensions( const Rectangle& rRectangle )
 {
     // style
-    if ( m_pShapeStyle->getLength() )
+    if ( !m_pShapeStyle->isEmpty() )
         m_pShapeStyle->append( ";" );
 
     m_pShapeStyle->append( "position:absolute" );
@@ -840,7 +840,7 @@
 
 void VMLExport::AddRectangleDimensions( OStringBuffer& rBuffer, const Rectangle& rRectangle )
 {
-    if ( rBuffer.getLength() )
+    if ( !rBuffer.isEmpty() )
         rBuffer.append( ";" );
 
     rBuffer.append( "position:absolute;" );
diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx
index 7f4674f..9088dae 100644
--- a/oox/source/helper/storagebase.cxx
+++ b/oox/source/helper/storagebase.cxx
@@ -119,7 +119,7 @@
 OUString StorageBase::getPath() const
 {
     OUStringBuffer aBuffer( maParentPath );
-    if( aBuffer.getLength() > 0 )
+    if( !aBuffer.isEmpty() )
         aBuffer.append( sal_Unicode( '/' ) );
     aBuffer.append( maStorageName );
     return aBuffer.makeStringAndClear();
diff --git a/oox/source/ppt/commonbehaviorcontext.cxx b/oox/source/ppt/commonbehaviorcontext.cxx
index ffaeef5..dd19dee 100644
--- a/oox/source/ppt/commonbehaviorcontext.cxx
+++ b/oox/source/ppt/commonbehaviorcontext.cxx
@@ -69,7 +69,7 @@
                 std::list< Attribute >::const_iterator iter;
                 for(iter = maAttributes.begin(); iter != maAttributes.end(); ++iter)
                 {
-                    if( sAttributes.getLength() )
+                    if( !sAttributes.isEmpty() )
                     {
                         sAttributes.appendAscii( ";" );
                     }

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

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