[Libreoffice-commits] core.git: xmloff/source

Jelle van der Waa jelle at vdwaa.nl
Wed Jun 19 03:10:58 PDT 2013


 xmloff/source/chart/PropertyMaps.cxx                  |    2 +-
 xmloff/source/core/unoatrcn.cxx                       |    2 +-
 xmloff/source/draw/animationexport.cxx                |   10 +++++-----
 xmloff/source/draw/shapeexport4.cxx                   |    4 ++--
 xmloff/source/draw/xexptran.cxx                       |    2 +-
 xmloff/source/meta/xmlmetai.cxx                       |    2 +-
 xmloff/source/style/XMLBackgroundImageExport.cxx      |    6 +++---
 xmloff/source/style/fonthdl.cxx                       |    2 +-
 xmloff/source/style/xmlnume.cxx                       |    2 +-
 xmloff/source/style/xmlnumfe.cxx                      |    4 ++--
 xmloff/source/style/xmlnumfi.cxx                      |   11 +++++------
 xmloff/source/text/XMLLineNumberingExport.cxx         |    2 +-
 xmloff/source/text/XMLSectionFootnoteConfigExport.cxx |    2 +-
 xmloff/source/text/txtflde.cxx                        |    2 +-
 xmloff/source/text/txtftne.cxx                        |    2 +-
 15 files changed, 27 insertions(+), 28 deletions(-)

New commits:
commit ad09b2f7efac628ac4261b86f9fd085f83ebe717
Author: Jelle van der Waa <jelle at vdwaa.nl>
Date:   Tue Jun 18 19:53:19 2013 +0200

    fdo#43460 xmloff: use isEmpty()
    
    Change-Id: I298767cc0ec03c22d3ae687939f0f9d5ce1963c1
    Reviewed-on: https://gerrit.libreoffice.org/4348
    Reviewed-by: Noel Power <noel.power at suse.com>
    Tested-by: Noel Power <noel.power at suse.com>

diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx
index 9962a09d..1f8bd78 100644
--- a/xmloff/source/chart/PropertyMaps.cxx
+++ b/xmloff/source/chart/PropertyMaps.cxx
@@ -471,7 +471,7 @@ void XMLChartExportPropertyMapper::handleSpecialItem(
                 break;
         }
 
-        if( sValueBuffer.getLength())
+        if( !sValueBuffer.isEmpty())
         {
             sValue = sValueBuffer.makeStringAndClear();
             sAttrName = rNamespaceMap.GetQNameByKey( nNameSpace, sAttrName );
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index cc51124..f479ba5 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -143,7 +143,7 @@ uno::Sequence< OUString > SAL_CALL SvUnoAttributeContainer::getElementNames(void
     for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ )
     {
         OUStringBuffer sBuffer( mpContainer->GetAttrPrefix(nAttr) );
-        if( sBuffer.getLength() != 0L )
+        if( !sBuffer.isEmpty() )
             sBuffer.append( (sal_Unicode)':' );
         sBuffer.append( mpContainer->GetAttrLName(nAttr) );
         *pNames++ = sBuffer.makeStringAndClear();
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index f3ba964..fd31cca 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -1200,7 +1200,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
 
                 while( nLength-- )
                 {
-                    if( sTmp.getLength() )
+                    if( !sTmp.isEmpty() )
                         sTmp.append( (sal_Unicode)';' );
 
                     sTmp.append( *p++ );
@@ -1244,7 +1244,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
 
                 while( nLength-- )
                 {
-                    if( sTmp.getLength() )
+                    if( !sTmp.isEmpty() )
                         sTmp.append( (sal_Unicode)';' );
 
                     sTmp.append( p->Time );
@@ -1475,7 +1475,7 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString
 
         for( nElement = 0; nElement < nLength; nElement++, pAny++ )
         {
-            if( sTmp.getLength() )
+            if( !sTmp.isEmpty() )
                 sTmp.append( (sal_Unicode)';' );
             convertValue( eAttributeName, sTmp2, *pAny );
             sTmp.append( sTmp2.makeStringAndClear() );
@@ -1557,7 +1557,7 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa
 
         for( nElement = 0; nElement < nLength; nElement++, pAny++ )
         {
-            if( sTmp.getLength() )
+            if( !sTmp.isEmpty() )
                 sTmp.append( (sal_Unicode)';' );
             convertTiming( sTmp2, *pAny );
             sTmp.append( sTmp2.makeStringAndClear() );
@@ -1596,7 +1596,7 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa
         {
             convertTiming( sTmp2, pEvent->Offset );
 
-            if( sTmp.getLength() )
+            if( !sTmp.isEmpty() )
                 sTmp.append( (sal_Unicode)'+' );
 
             sTmp.append( sTmp2.makeStringAndClear() );
diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx
index ad34554..b83f73e 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -78,7 +78,7 @@ using ::com::sun::star::uno::Sequence;
 
 void ExportParameter( OUStringBuffer& rStrBuffer, const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter )
 {
-    if ( rStrBuffer.getLength() )
+    if ( !rStrBuffer.isEmpty() )
         rStrBuffer.append( (sal_Unicode)' ' );
     if ( rParameter.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
     {
@@ -364,7 +364,7 @@ void ImpExportEnhancedPath( SvXMLExport& rExport,
         else
             aSegment = rSegments[ j ];
 
-        if ( aStrBuffer.getLength() )
+        if ( !aStrBuffer.isEmpty() )
             aStrBuffer.append( (sal_Unicode)' ' );
 
         sal_Int32 nParameter = 0;
diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx
index 97f8443..127004d 100644
--- a/xmloff/source/draw/xexptran.cxx
+++ b/xmloff/source/draw/xexptran.cxx
@@ -227,7 +227,7 @@ double Imp_GetDoubleChar(const OUString& rStr, sal_Int32& rPos, const sal_Int32
             sNumberString.append(rStr[rPos++]);
     }
 
-    if(sNumberString.getLength())
+    if(!sNumberString.isEmpty())
     {
         if(bLookForUnits)
             rConv.convertDouble(fRetval, sNumberString.makeStringAndClear(), true);
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index 28a49ed..e7b8b1c 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -290,7 +290,7 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno:
                 break;
             }
         }
-        if (sNumber.getLength())
+        if (!sNumber.isEmpty())
         {
             sBuildId += (";" + sNumber.makeStringAndClear());
         }
diff --git a/xmloff/source/style/XMLBackgroundImageExport.cxx b/xmloff/source/style/XMLBackgroundImageExport.cxx
index 362c84a..4aaa340 100644
--- a/xmloff/source/style/XMLBackgroundImageExport.cxx
+++ b/xmloff/source/style/XMLBackgroundImageExport.cxx
@@ -90,7 +90,7 @@ void XMLBackgroundImageExport::exportXML( const Any& rURL,
             break;
         }
 
-        if( aOut.getLength() )
+        if( !aOut.isEmpty() )
         {
             aOut.append( sal_Unicode( ' ' ) );
 
@@ -115,7 +115,7 @@ void XMLBackgroundImageExport::exportXML( const Any& rURL,
                 break;
             }
         }
-        if( aOut.getLength() )
+        if( !aOut.isEmpty() )
             GetExport().AddAttribute( XML_NAMESPACE_STYLE,
                                   XML_POSITION, aOut.makeStringAndClear() );
 
@@ -127,7 +127,7 @@ void XMLBackgroundImageExport::exportXML( const Any& rURL,
         {
             aOut.append( GetXMLToken(XML_BACKGROUND_NO_REPEAT) );
         }
-        if( aOut.getLength() )
+        if( !aOut.isEmpty() )
             GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REPEAT,
                           aOut.makeStringAndClear() );
 
diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx
index f65efea..0e1e836 100644
--- a/xmloff/source/style/fonthdl.cxx
+++ b/xmloff/source/style/fonthdl.cxx
@@ -154,7 +154,7 @@ sal_Bool XMLFontFamilyNamePropHdl::exportXML( OUString& rStrExpValue, const uno:
 
             if( nFirst <= nLast )
             {
-                if( sValue.getLength() != 0L )
+                if( !sValue.isEmpty() )
                 {
                     sValue.append( sal_Unicode( ',' ) );
                     sValue.append( sal_Unicode( ' ' ));
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index 0493325..01df8d8 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -326,7 +326,7 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
         GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_FORMAT,
                                        sTmp.makeStringAndClear() );
         GetExport().GetMM100UnitConverter().convertNumLetterSync( sTmp, eType );
-        if( sTmp.getLength() )
+        if( !sTmp.isEmpty() )
             GetExport().AddAttribute( XML_NAMESPACE_STYLE,
                                       XML_NUM_LETTER_SYNC,
                                            sTmp.makeStringAndClear() );
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 8e0b23b6..a71042f 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -372,7 +372,7 @@ void SvXMLNumFmtExport::AddToTextElement_Impl( const OUString& rString )
 
 void SvXMLNumFmtExport::FinishTextElement_Impl()
 {
-    if ( sTextContent.getLength() )
+    if ( !sTextContent.isEmpty() )
     {
         SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_TEXT,
                                   sal_True, sal_False );
@@ -1603,7 +1603,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
         }
     }
 
-    if ( sTextContent.getLength() )
+    if ( !sTextContent.isEmpty() )
         bAnyContent = sal_True;     // element written in FinishTextElement_Impl
 
     FinishTextElement_Impl();       // final text element - before maps
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 7fc2d97..9747063 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1077,7 +1077,7 @@ void SvXMLNumFmtElementContext::EndElement()
 
                 rParent.SetHasLongDoW( sal_False );     // only once
             }
-            if ( aContent.getLength() )
+            if ( !aContent.isEmpty() )
             {
                 lcl_EnquoteIfNecessary( aContent, rParent );
                 rParent.AddToCode( aContent.makeStringAndClear() );
@@ -1096,7 +1096,7 @@ void SvXMLNumFmtElementContext::EndElement()
             rParent.AddToCode( (sal_Unicode)'@');
             break;
         case XML_TOK_STYLE_FILL_CHARACTER:
-            if ( aContent.getLength() )
+            if ( !aContent.isEmpty() )
             {
                 rParent.AddToCode( (sal_Unicode)'*' );
                 rParent.AddToCode( aContent[0] );
@@ -1571,7 +1571,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter)
         }
     }
 
-    if ( !aFormatCode.getLength() )
+    if ( aFormatCode.isEmpty() )
     {
         //  insert empty format as empty string (with quotes)
         //  #93901# this check has to be done before inserting the conditions
@@ -2053,8 +2053,7 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex )
 
         //! collect all conditions first and adjust default to >=0, >0 or <0 depending on count
         //! allow blanks in conditions
-        sal_Bool bFirstCond = ( aConditions.getLength() == 0 );
-        if ( bFirstCond && aMyConditions.size() == 1 && sRealCond.compareToAscii( ">=0" ) == 0 )
+        if ( aConditions.isEmpty() && aMyConditions.size() == 1 && sRealCond.compareToAscii( ">=0" ) == 0 )
             bDefaultCond = sal_True;
 
         if ( nType == XML_TOK_STYLES_TEXT_STYLE && nIndex == 2 )
@@ -2111,7 +2110,7 @@ void SvXMLNumFormatContext::AddColor( sal_uInt32 const nColor )
             break;
         }
 
-    if ( aColName.getLength() )
+    if ( !aColName.isEmpty() )
     {
         aColName.insert( 0, (sal_Unicode) '[' );
         aColName.append( (sal_Unicode) ']' );
diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx
index 41eb515..c60178c 100644
--- a/xmloff/source/text/XMLLineNumberingExport.cxx
+++ b/xmloff/source/text/XMLLineNumberingExport.cxx
@@ -142,7 +142,7 @@ void XMLLineNumberingExport::Export()
             rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT,
                                  sNumPosBuf.makeStringAndClear());
             rExport.GetMM100UnitConverter().convertNumLetterSync( sNumPosBuf, nFormat );
-            if( sNumPosBuf.getLength() )
+            if( !sNumPosBuf.isEmpty() )
             {
                 rExport.AddAttribute(XML_NAMESPACE_STYLE,
                                      XML_NUM_LETTER_SYNC,
diff --git a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx
index 05e3ab7..847167d 100644
--- a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx
+++ b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx
@@ -170,7 +170,7 @@ void XMLSectionFootnoteConfigExport::exportXML(
             // and letter sync, if applicable
             rExport.GetMM100UnitConverter().convertNumLetterSync(
                 sBuf, nNumberingType );
-            if (sBuf.getLength())
+            if (!sBuf.isEmpty())
             {
                 rExport.AddAttribute(XML_NAMESPACE_STYLE,
                                      XML_NUM_LETTER_SYNC,
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 7e013db..b034cba 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -2589,7 +2589,7 @@ void XMLTextFieldExport::ProcessNumberingType(sal_Int16 nNumberingType)
         GetExport().GetMM100UnitConverter().convertNumLetterSync( sTmp,
                                                               nNumberingType );
 
-        if (sTmp.getLength())
+        if (!sTmp.isEmpty())
         {
             GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC,
                                      sTmp.makeStringAndClear() );
diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx
index 237c160..867397f 100644
--- a/xmloff/source/text/txtftne.cxx
+++ b/xmloff/source/text/txtftne.cxx
@@ -296,7 +296,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper(
     GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT,
                              sBuffer.makeStringAndClear() );
     GetExport().GetMM100UnitConverter().convertNumLetterSync( sBuffer, nNumbering);
-    if (sBuffer.getLength() )
+    if (!sBuffer.isEmpty() )
     {
         GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC,
                                  sBuffer.makeStringAndClear());


More information about the Libreoffice-commits mailing list