[Libreoffice-commits] .: xmlscript/source

Olivier Hallot ohallot at kemper.freedesktop.org
Sat Jan 28 03:33:22 PST 2012


 xmlscript/source/xmldlg_imexp/imp_share.hxx        |    6 +-
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx    |   28 +++++------
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |   24 +++++-----
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx    |   50 ++++++++++-----------
 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx   |    2 
 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx   |    8 +--
 xmlscript/source/xmllib_imexp/imp_share.hxx        |    6 +-
 xmlscript/source/xmllib_imexp/xmllib_export.cxx    |    2 
 xmlscript/source/xmllib_imexp/xmllib_import.cxx    |    2 
 xmlscript/source/xmlmod_imexp/xmlmod_export.cxx    |    2 
 10 files changed, 65 insertions(+), 65 deletions(-)

New commits:
commit 9d4e1a5dadede021922abcb00d346fe496240ab4
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date:   Sat Jan 28 09:31:35 2012 -0200

    Fix for fdo43460 Part LIV getLength() to isEmpty()
    
    Part LIV
    Modules
    xmlscript

diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index b915a18..33556e0 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -68,7 +68,7 @@ inline bool getBoolAttr(
     sal_Int32 nUid )
 {
     ::rtl::OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("true") ))
         {
@@ -96,7 +96,7 @@ inline bool getStringAttr(
     sal_Int32 nUid )
 {
     *pRet = xAttributes->getValueByUidName( nUid, rAttrName );
-    return (pRet->getLength() > 0);
+    return (!pRet->isEmpty());
 }
 
 inline bool getLongAttr(
@@ -105,7 +105,7 @@ inline bool getLongAttr(
     sal_Int32 nUid )
 {
     ::rtl::OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         *pRet = toInt32( aValue );
         return true;
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index ece2ca8..b6b717a 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -587,11 +587,11 @@ void ElementDescriptor::addNumberFormatAttr(
     // format-locale
     OUStringBuffer buf( 48 );
     buf.append( locale.Language );
-    if (locale.Country.getLength())
+    if (!locale.Country.isEmpty())
     {
         buf.append( (sal_Unicode)';' );
         buf.append( locale.Country );
-        if (locale.Variant.getLength())
+        if (!locale.Variant.isEmpty())
         {
             buf.append( (sal_Unicode)';' );
             buf.append( locale.Variant );
@@ -794,7 +794,7 @@ void ElementDescriptor::readImageURLAttr( OUString const & rPropName, OUString c
         rtl::OUString sURL;
         _xProps->getPropertyValue( rPropName ) >>= sURL;
 
-        if ( sURL.getLength() && sURL.compareToAscii( XMLSCRIPT_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( XMLSCRIPT_GRAPHOBJ_URLPREFIX ) ) == 0 )
+        if ( !sURL.isEmpty() && sURL.compareToAscii( XMLSCRIPT_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( XMLSCRIPT_GRAPHOBJ_URLPREFIX ) ) == 0 )
         {
             Reference< document::XStorageBasedDocument > xDocStorage( _xDocument, UNO_QUERY );
             if ( xDocStorage.is() )
@@ -809,7 +809,7 @@ void ElementDescriptor::readImageURLAttr( OUString const & rPropName, OUString c
                     sURL = xGraphicResolver->resolveGraphicObjectURL( sURL );
             }
         }
-        if ( sURL.getLength() )
+        if ( !sURL.isEmpty() )
                 addAttribute( rAttrName, sURL );
     }
 }
@@ -998,7 +998,7 @@ void ElementDescriptor::readDataAwareAttr( OUString const & rAttrName )
                 xConvertor->setPropertyValue( OUSTR("Address"), makeAny( aAddress ) );
                 rtl::OUString sAddress;
                 xConvertor->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress;
-                if ( sAddress.getLength() > 0 )
+                if ( !sAddress.isEmpty() )
                     addAttribute( rAttrName, sAddress );
 
                 OSL_TRACE( "*** Bindable value %s", rtl::OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() );
@@ -1027,7 +1027,7 @@ void ElementDescriptor::readDataAwareAttr( OUString const & rAttrName )
                 xConvertor->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress;
                 OSL_TRACE("**** cell range source list %s",
                     rtl::OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() );
-                if ( sAddress.getLength() > 0 )
+                if ( !sAddress.isEmpty() )
                     addAttribute( rAttrName, sAddress );
             }
             catch( uno::Exception& )
@@ -1091,7 +1091,7 @@ void ElementDescriptor::readDefaults( bool supportPrintable, bool supportVisible
         if ( xPersist.is() )
         {
             OUString sCtrlName = xPersist->getServiceName();
-            if ( sCtrlName.getLength() )
+            if ( !sCtrlName.isEmpty() )
                     addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":control-implementation") ), sCtrlName );
         }
     }
@@ -1199,15 +1199,15 @@ void ElementDescriptor::readEvents()
                 script::ScriptEventDescriptor descr;
                 if (xEvents->getByName( pNames[ nPos ] ) >>= descr)
                 {
-                    OSL_ENSURE( descr.ListenerType.getLength() > 0 &&
-                                descr.EventMethod.getLength() > 0 &&
-                                descr.ScriptCode.getLength() > 0 &&
-                                descr.ScriptType.getLength() > 0,
+                    OSL_ENSURE( !descr.ListenerType.isEmpty() &&
+                                !descr.EventMethod.isEmpty() &&
+                                !descr.ScriptCode.isEmpty() &&
+                                !descr.ScriptType.isEmpty() ,
                                 "### invalid event descr!" );
 
                     OUString aEventName;
 
-                    if (! descr.AddListenerParam.getLength())
+                    if (descr.AddListenerParam.isEmpty())
                     {
                         // detection of event-name
                         ::rtl::OString listenerType(
@@ -1234,7 +1234,7 @@ void ElementDescriptor::readEvents()
                     ElementDescriptor * pElem;
                     Reference< xml::sax::XAttributeList > xElem;
 
-                    if (aEventName.getLength()) // script:event
+                    if (!aEventName.isEmpty()) // script:event
                     {
                         pElem = new ElementDescriptor(
                             OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":event") ) );
@@ -1257,7 +1257,7 @@ void ElementDescriptor::readEvents()
                             OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":listener-method") ),
                             descr.EventMethod );
 
-                        if (descr.AddListenerParam.getLength())
+                        if (!descr.AddListenerParam.isEmpty())
                         {
                             pElem->addAttribute(
                                 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":listener-param") ),
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index ced4c0d..dfcfaf5 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -110,7 +110,7 @@ void Frame::endElement()
     }
 
     ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
-    if (_label.getLength())
+    if (!_label.isEmpty())
     {
         xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
                                          makeAny( _label ) );
@@ -645,7 +645,7 @@ void FormattedFieldElement::endElement()
         _xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID,
             OUString( RTL_CONSTASCII_USTRINGPARAM("value-default") ) ) );
-    if (sDefault.getLength())
+    if (!sDefault.isEmpty())
     {
         double d = sDefault.toDouble();
         if (d != 0.0 ||
@@ -673,7 +673,7 @@ void FormattedFieldElement::endElement()
         _xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID,
             OUString( RTL_CONSTASCII_USTRINGPARAM("format-code") ) ) );
-    if (sFormat.getLength())
+    if (!sFormat.isEmpty())
     {
         lang::Locale locale;
 
@@ -681,7 +681,7 @@ void FormattedFieldElement::endElement()
             _xAttributes->getValueByUidName(
                 _pImport->XMLNS_DIALOGS_UID,
                 OUString( RTL_CONSTASCII_USTRINGPARAM("format-locale") ) ) );
-        if (sLocale.getLength())
+        if (!sLocale.isEmpty())
         {
             // split locale
             sal_Int32 semi0 = sLocale.indexOf( ';' );
@@ -1501,7 +1501,7 @@ void TextFieldElement::endElement()
                        OUString( RTL_CONSTASCII_USTRINGPARAM("echochar") ),
                        _xAttributes,
                        _pImport->XMLNS_DIALOGS_UID ) &&
-        aValue.getLength() > 0)
+                       !aValue.isEmpty() )
     {
         OSL_ENSURE( aValue.getLength() == 1, "### more than one character given for echochar!" );
         sal_Int16 nChar = (sal_Int16)aValue[ 0 ];
@@ -1588,7 +1588,7 @@ void TitledBoxElement::endElement()
 
     ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
 
-    if (_label.getLength())
+    if (!_label.isEmpty())
     {
         xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
                                          makeAny( _label ) );
@@ -1824,8 +1824,8 @@ Reference< xml::input::XElement > MenuPopupElement::startChildElement(
             xAttributes->getValueByUidName(
                 _pImport->XMLNS_DIALOGS_UID,
                 OUString( RTL_CONSTASCII_USTRINGPARAM("value") ) ) );
-        OSL_ENSURE( aValue.getLength(), "### menuitem has no value?" );
-        if (aValue.getLength())
+        OSL_ENSURE( !aValue.isEmpty(), "### menuitem has no value?" );
+        if (!aValue.isEmpty())
         {
             _itemValues.push_back( aValue );
 
@@ -1833,7 +1833,7 @@ Reference< xml::input::XElement > MenuPopupElement::startChildElement(
                 xAttributes->getValueByUidName(
                     _pImport->XMLNS_DIALOGS_UID,
                     OUString( RTL_CONSTASCII_USTRINGPARAM("selected") ) ) );
-            if (aSel.getLength() && aSel.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("true") ))
+            if (!aSel.isEmpty() && aSel.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("true") ))
             {
                 _itemSelected.push_back(
                     static_cast<sal_Int16>(_itemValues.size()) -1 );
@@ -2414,14 +2414,14 @@ BulletinBoardElement::BulletinBoardElement(
         _xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID,
             OUString( RTL_CONSTASCII_USTRINGPARAM("left") ) ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         _nBasePosX += toInt32( aValue );
     }
     aValue = _xAttributes->getValueByUidName(
         _pImport->XMLNS_DIALOGS_UID,
         OUString( RTL_CONSTASCII_USTRINGPARAM("top") ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         _nBasePosY += toInt32( aValue );
     }
@@ -2449,7 +2449,7 @@ void StyleElement::endElement()
         _xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID,
             OUString( RTL_CONSTASCII_USTRINGPARAM("style-id") ) ) );
-    if (aStyleId.getLength())
+    if (!aStyleId.isEmpty())
     {
         _pImport->addStyle( aStyleId, this );
     }
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index 37ef3ca..6a87acc 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -114,7 +114,7 @@ Reference< xml::input::XElement > ControlElement::getStyle(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID,
             OUString( RTL_CONSTASCII_USTRINGPARAM("style-id") ) ) );
-    if (aStyleId.getLength())
+    if (!aStyleId.isEmpty())
     {
         return _pImport->getStyle( aStyleId );
     }
@@ -128,7 +128,7 @@ OUString ControlElement::getControlId(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID,
             OUString( RTL_CONSTASCII_USTRINGPARAM("id") ) ) );
-    if (! aId.getLength())
+    if (aId.isEmpty())
     {
         throw xml::sax::SAXException(
             OUString( RTL_CONSTASCII_USTRINGPARAM("missing id attribute!") ),
@@ -145,7 +145,7 @@ OUString ControlElement::getControlModelName(
     aModel = xAttributes->getValueByUidName(
         _pImport->XMLNS_DIALOGS_UID,
         OUString( RTL_CONSTASCII_USTRINGPARAM("control-implementation") ) );
-    if (! aModel.getLength())
+    if (aModel.isEmpty())
         aModel = rDefaultModel;
     return aModel;
 }
@@ -820,7 +820,7 @@ bool ImportContext::importStringProperty(
     OUString aValue(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         _xControlModel->setPropertyValue( rPropName, makeAny( aValue ) );
         return true;
@@ -835,7 +835,7 @@ bool ImportContext::importDoubleProperty(
     OUString aValue(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         _xControlModel->setPropertyValue( rPropName, makeAny( aValue.toDouble() ) );
         return true;
@@ -865,7 +865,7 @@ bool ImportContext::importLongProperty(
     OUString aValue(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         _xControlModel->setPropertyValue( rPropName, makeAny( toInt32( aValue ) ) );
         return true;
@@ -881,7 +881,7 @@ bool ImportContext::importLongProperty(
     OUString aValue(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         _xControlModel->setPropertyValue( rPropName, makeAny( toInt32( aValue ) + nOffset ) );
         return true;
@@ -896,7 +896,7 @@ bool ImportContext::importHexLongProperty(
     OUString aValue(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         _xControlModel->setPropertyValue( rPropName, makeAny( toInt32( aValue ) ) );
         return true;
@@ -911,7 +911,7 @@ bool ImportContext::importShortProperty(
     OUString aValue(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         _xControlModel->setPropertyValue( rPropName, makeAny( (sal_Int16)toInt32( aValue ) ) );
         return true;
@@ -926,7 +926,7 @@ bool ImportContext::importAlignProperty(
     OUString aAlign(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aAlign.getLength())
+    if (!aAlign.isEmpty())
     {
         sal_Int16 nAlign;
         if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("left") ))
@@ -965,7 +965,7 @@ bool ImportContext::importVerticalAlignProperty(
     OUString aAlign(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aAlign.getLength())
+    if (!aAlign.isEmpty())
     {
         style::VerticalAlignment eAlign;
 
@@ -999,7 +999,7 @@ bool ImportContext::importImageURLProperty(
     Reference< xml::input::XAttributes > const & xAttributes )
 {
     rtl::OUString sURL = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, rAttrName );
-    if ( sURL.getLength() )
+    if ( !sURL.isEmpty() )
     {
         Reference< document::XStorageBasedDocument > xDocStorage( _pImport->getDocOwner(), UNO_QUERY );
 
@@ -1017,7 +1017,7 @@ bool ImportContext::importImageURLProperty(
                 try
                 {
                     aTmp = xGraphicResolver->resolveGraphicObjectURL( aTmp );
-                    if ( aTmp.getLength() )
+                    if ( !aTmp.isEmpty() )
                         sURL = aTmp;
                 }
                 catch( const uno::Exception& )
@@ -1027,7 +1027,7 @@ bool ImportContext::importImageURLProperty(
 
             }
         }
-        if ( sURL.getLength() > 0 )
+        if ( !sURL.isEmpty() )
         {
             Reference< beans::XPropertySet > xProps( getControlModel(), UNO_QUERY );
             if ( xProps.is() )
@@ -1052,10 +1052,10 @@ bool ImportContext::importImageURLProperty(
         sCellRange = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, rPropName );
     bool bRes = false;
     Reference< lang::XMultiServiceFactory > xFac( _pImport->getDocOwner(), UNO_QUERY );
-    if ( xFac.is() && ( sLinkedCell.getLength() ||  sCellRange.getLength() ) )
+    if ( xFac.is() && ( !sLinkedCell.isEmpty() ||  !sCellRange.isEmpty() ) )
     {
         // Set up Celllink
-        if ( sLinkedCell.getLength() )
+        if ( !sLinkedCell.isEmpty() )
         {
             Reference< form::binding::XBindableValue > xBindable( getControlModel(), uno::UNO_QUERY );
             Reference< beans::XPropertySet > xConvertor( xFac->createInstance( OUSTR( "com.sun.star.table.CellAddressConversion" )), uno::UNO_QUERY );
@@ -1077,7 +1077,7 @@ bool ImportContext::importImageURLProperty(
             }
         }
         // Set up CelllRange
-        if ( sCellRange.getLength() )
+        if ( !sCellRange.isEmpty() )
         {
             Reference< form::binding::XListEntrySink  > xListEntrySink( getControlModel(), uno::UNO_QUERY );
             Reference< beans::XPropertySet > xConvertor( xFac->createInstance( OUSTR( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY );
@@ -1109,7 +1109,7 @@ bool ImportContext::importImageAlignProperty(
     OUString aAlign(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aAlign.getLength())
+    if (!aAlign.isEmpty())
     {
         sal_Int16 nAlign;
         if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("left") ))
@@ -1148,7 +1148,7 @@ bool ImportContext::importImagePositionProperty(
     OUString aPosition(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aPosition.getLength())
+    if (!aPosition.isEmpty())
     {
         sal_Int16 nPosition;
         if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("left-top") ))
@@ -1223,7 +1223,7 @@ bool ImportContext::importButtonTypeProperty(
     OUString buttonType(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (buttonType.getLength())
+    if (!buttonType.isEmpty())
     {
         sal_Int16 nButtonType;
         if (buttonType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("standard") ))
@@ -1262,7 +1262,7 @@ bool ImportContext::importDateFormatProperty(
     OUString aFormat(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aFormat.getLength())
+    if (!aFormat.isEmpty())
     {
         sal_Int16 nFormat;
         if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("system_short") ))
@@ -1333,7 +1333,7 @@ bool ImportContext::importTimeFormatProperty(
     OUString aFormat(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aFormat.getLength())
+    if (!aFormat.isEmpty())
     {
         sal_Int16 nFormat;
         if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("24h_short") ))
@@ -1380,7 +1380,7 @@ bool ImportContext::importOrientationProperty(
     OUString aOrient(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aOrient.getLength())
+    if (!aOrient.isEmpty())
     {
         sal_Int32 nOrient;
         if (aOrient.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("horizontal") ))
@@ -1411,7 +1411,7 @@ bool ImportContext::importLineEndFormatProperty(
     OUString aFormat(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aFormat.getLength())
+    if (!aFormat.isEmpty())
     {
         sal_Int16 nFormat;
         if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("carriage-return") ))
@@ -1446,7 +1446,7 @@ bool ImportContext::importSelectionTypeProperty(
     OUString aSelectionType(
         xAttributes->getValueByUidName(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
-    if (aSelectionType.getLength())
+    if (!aSelectionType.isEmpty())
     {
         view::SelectionType eSelectionType;
 
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
index 616f319..a5b18b4 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
@@ -289,7 +289,7 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& /
                                     aLibName );
 
                                 ::rtl::OUString aLinkURL( xLibContainer->getLibraryLinkURL( aLibName ) );
-                                if ( aLinkURL.getLength() )
+                                if ( !aLinkURL.isEmpty() )
                                 {
                                     // xlink:href attribute
                                     pLibElement->addAttribute( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( XMLNS_XLINK_PREFIX ":href" ) ),
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
index a5f26e2..062bdf3 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
@@ -82,7 +82,7 @@ namespace xmlscript
         if ( xAttributes.is() )
         {
             ::rtl::OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
-            if ( aValue.getLength() )
+            if ( !aValue.isEmpty() )
             {
                 if ( aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "true" ) ) )
                 {
@@ -363,7 +363,7 @@ void BasicElementBase::processingInstruction( const ::rtl::OUString& /*rTarget*/
                     m_pImport->XMLNS_UID,
                     ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "name" ) ) );
 
-                if ( m_xLib.is() && aName.getLength() )
+                if ( m_xLib.is() && !aName.isEmpty() )
                     xElement.set( new BasicModuleElement( rLocalName, xAttributes, this, m_pImport, m_xLib, aName ) );
             }
         }
@@ -426,7 +426,7 @@ void BasicElementBase::processingInstruction( const ::rtl::OUString& /*rTarget*/
 
             if ( xAttributes.is() )
             {
-                if ( m_xLib.is() && m_aName.getLength() )
+                if ( m_xLib.is() && !m_aName.isEmpty() )
                     xElement.set( new BasicSourceCodeElement( rLocalName, xAttributes, this, m_pImport, m_xLib, m_aName ) );
             }
         }
@@ -479,7 +479,7 @@ void BasicElementBase::processingInstruction( const ::rtl::OUString& /*rTarget*/
     {
         try
         {
-            if ( m_xLib.is() && m_aName.getLength() )
+            if ( m_xLib.is() && !m_aName.isEmpty() )
             {
                 Any aElement;
                 aElement <<= m_aBuffer.makeStringAndClear();
diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx
index b8ca321..08deae9 100644
--- a/xmlscript/source/xmllib_imexp/imp_share.hxx
+++ b/xmlscript/source/xmllib_imexp/imp_share.hxx
@@ -70,7 +70,7 @@ inline bool getBoolAttr(
 {
     OUString aValue(
         xAttributes->getValueByUidName( uid, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("true") ))
         {
@@ -99,7 +99,7 @@ inline bool getStringAttr(
     Reference< xml::input::XAttributes > const & xAttributes, sal_Int32 uid )
 {
     *pRet = xAttributes->getValueByUidName( uid, rAttrName );
-    return (pRet->getLength() > 0);
+    return (!pRet->isEmpty());
 }
 
 inline bool getLongAttr(
@@ -109,7 +109,7 @@ inline bool getLongAttr(
 {
     OUString aValue(
         xAttributes->getValueByUidName( uid, rAttrName ) );
-    if (aValue.getLength())
+    if (!aValue.isEmpty())
     {
         *pRet = toInt32( aValue );
         return true;
diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx
index 6fcce79..97f42c9 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx
@@ -88,7 +88,7 @@ SAL_CALL exportLibraryContainer(
                                     rLib.aName );
 
 
-        if( rLib.aStorageURL.getLength() )
+        if( !rLib.aStorageURL.isEmpty() )
         {
             pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_XLINK_PREFIX ":href") ),
                                         rLib.aStorageURL );
diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
index 158ca99..21cc0f3 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
@@ -305,7 +305,7 @@ Reference< xml::input::XElement > LibraryElement::startChildElement(
         OUString aValue( xAttributes->getValueByUidName(
             _pImport->XMLNS_LIBRARY_UID,
             OUString( RTL_CONSTASCII_USTRINGPARAM("name") ) ) );
-        if (aValue.getLength())
+        if (!aValue.isEmpty())
             mElements.push_back( aValue );
 
         return new LibElementBase( rLocalName, xAttributes, this, _pImport );
diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx
index f44632a..8114fd5 100644
--- a/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx
+++ b/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx
@@ -65,7 +65,7 @@ SAL_CALL exportScriptModule(
                                 rMod.aName );
     pModElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":language") ),
                                 rMod.aLanguage );
-    if( rMod.aModuleType.getLength()>0 )
+    if( !rMod.aModuleType.isEmpty() )
         pModElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":moduleType") ),
                                     rMod.aModuleType );
 


More information about the Libreoffice-commits mailing list