diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-17 17:47:34 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-17 19:07:47 -0200 |
commit | 964617156260cd157d4f39be01a5d3dec1c29a27 (patch) | |
tree | 403c4a06a8739adf8aa0befb75543e41b898601f /sw/source/filter | |
parent | 802d82b6e2acedd3581acbf23407d7f5f742c671 (diff) |
Fix for fdo43460 Part XL getLength() to isEmpty()
Part XL
Modules
sw
Diffstat (limited to 'sw/source/filter')
28 files changed, 121 insertions, 121 deletions
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index c16febe8a9b5..46598df63ed1 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -854,7 +854,7 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFmt *pFmt, rtl::OString& rToke // Wenn eine PoolId gesetzt ist, entspricht der Name der // Vorlage dem szugehoerigen Token - OSL_ENSURE( (rRefPoolId != 0) == (rToken.getLength() > 0), + OSL_ENSURE( (rRefPoolId != 0) == (!rToken.isEmpty()), "Token missing" ); } else @@ -1000,11 +1000,11 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFmt *pFmt, rtl::OString& rToke // Wenn ein Token gesetzt ist, enthaelt nPoolId die dazugehoerige // Vorlage - if( rToken.getLength() && !rRefPoolId ) + if( !rToken.isEmpty() && !rRefPoolId ) rRefPoolId = nPoolId; } - if( rToken.getLength() || bStop ) + if( !rToken.isEmpty() || bStop ) { // Anhalten wenn eine HTML-Tag-Vorlage gefunden wurde break; @@ -1017,7 +1017,7 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFmt *pFmt, rtl::OString& rToke } } - if( rToken.getLength() ) + if( !rToken.isEmpty() ) { // Es ist eine HTML-Tag-Vorlage if( !nDeep ) @@ -1064,7 +1064,7 @@ static sal_uInt16 GetCSS1Selector( const SwFmt *pFmt, String& rSelector, rRefPoolId, &aPseudo ); if( nDeep ) { - if( aToken.getLength() ) + if( !aToken.isEmpty() ) rSelector = String( aToken, RTL_TEXTENCODING_ASCII_US ); else rSelector.Erase(); diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 8cc76ac6ed6c..73de8423589c 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -341,7 +341,7 @@ SwHTMLFmtInfo::SwHTMLFmtInfo( const SwFmt *pF, SwDoc *pDoc, SwDoc *pTemplate, // Den Selektor des Formats holen sal_uInt16 nDeep = SwHTMLWriter::GetCSS1Selector( pFmt, aToken, aClass, nRefPoolId ); - OSL_ENSURE( nDeep ? aToken.getLength()>0 : aToken.getLength()==0, + OSL_ENSURE( nDeep ? !aToken.isEmpty() : aToken.isEmpty(), "Hier stimmt doch was mit dem Token nicht!" ); OSL_ENSURE( nDeep ? nRefPoolId : !nRefPoolId, "Hier stimmt doch was mit der Vergleichs-Vorlage nicht!" ); @@ -642,7 +642,7 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt, // Jetzt wird festgelegt, was aufgrund des Tokens so moeglich ist sal_uInt16 nToken = 0; // Token fuer Tag-Wechsel sal_Bool bOutNewLine = sal_False; // nur ein LF ausgeben? - if( pFmtInfo->aToken.getLength() ) + if( !pFmtInfo->aToken.isEmpty() ) { // Es ist eine HTML-Tag-Vorlage oder die Vorlage ist von einer // solchen abgeleitet @@ -1117,7 +1117,7 @@ void OutHTML_SwFmtOff( Writer& rWrt, const SwHTMLTxtCollOutputInfo& rInfo ) SwHTMLWriter & rHWrt = (SwHTMLWriter&)rWrt; // wenn es kein Token gibt haben wir auch nichts auszugeben - if( !rInfo.aToken.getLength() ) + if( rInfo.aToken.isEmpty() ) { rHWrt.FillNextNumInfo(); const SwHTMLNumRuleInfo& rNextInfo = *rHWrt.GetNextNumInfo(); @@ -1837,7 +1837,7 @@ void HTMLEndPosLst::InsertNoScript( const SfxPoolItem& rItem, const SwCharFmt* pFmt = rChrFmt.GetCharFmt(); const SwHTMLFmtInfo *pFmtInfo = GetFmtInfo( *pFmt, rFmtInfos ); - if( pFmtInfo->aToken.getLength() ) + if( !pFmtInfo->aToken.isEmpty() ) { // das Zeichenvorlagen-Tag muss vor den harten // Attributen ausgegeben werden @@ -3230,7 +3230,7 @@ static Writer& OutHTML_SwTxtCharFmt( Writer& rWrt, const SfxPoolItem& rHt ) { rtl::OStringBuffer sOut; sOut.append('<'); - if( pFmtInfo->aToken.getLength() > 0 ) + if( !pFmtInfo->aToken.isEmpty() ) sOut.append(pFmtInfo->aToken); else sOut.append(OOO_STRING_SVTOOLS_HTML_span); @@ -3268,7 +3268,7 @@ static Writer& OutHTML_SwTxtCharFmt( Writer& rWrt, const SfxPoolItem& rHt ) else { HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), - pFmtInfo->aToken.getLength() ? pFmtInfo->aToken.getStr() + !pFmtInfo->aToken.isEmpty() ? pFmtInfo->aToken.getStr() : OOO_STRING_SVTOOLS_HTML_span, sal_False ); } diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx index c99433a28f55..14d81d4c2b71 100644 --- a/sw/source/filter/html/htmldraw.cxx +++ b/sw/source/filter/html/htmldraw.cxx @@ -856,7 +856,7 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_marquee, sal_False ); - if( aEndTags.getLength() ) + if( !aEndTags.isEmpty() ) rWrt.Strm() << aEndTags.getStr(); return rWrt; diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index 7742f20a0f2f..45dfe8e683c3 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -1195,7 +1195,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt, rHTMLWrt.Strm() << '>'; - if( aEndTags.getLength() ) + if( !aEndTags.isEmpty() ) rWrt.Strm() << aEndTags.getStr(); if( rHTMLWrt.aINetFmts.Count() ) @@ -1488,7 +1488,7 @@ static Writer& OutHTML_FrmFmtAsSpacer( Writer& rWrt, const SwFrmFmt& rFrmFmt ) rtl::OString aEndTags = rHTMLWrt.OutFrmFmtOptions( rFrmFmt, aEmptyStr, HTML_FRMOPTS_SPACER ); rWrt.Strm() << '>'; - if( aEndTags.getLength() ) + if( !aEndTags.isEmpty() ) rWrt.Strm() << aEndTags.getStr(); return rWrt; @@ -1553,7 +1553,7 @@ static Writer& OutHTML_FrmFmtAsDivOrSpan( Writer& rWrt, rHTMLWrt.OutNewLine(); HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), pStr, sal_False ); - if( aEndTags.getLength() ) + if( !aEndTags.isEmpty() ) rWrt.Strm() << aEndTags.getStr(); return rWrt; @@ -1733,7 +1733,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrmFmt& rFrmFmt, const SwStartNode* pSttNd = rWrt.pDoc->GetNodes()[nStt]->GetStartNode(); OSL_ENSURE( pSttNd, "Wo ist der Start-Node" ); - if( !bHeader && aSpacer.getLength() ) + if( !bHeader && !aSpacer.isEmpty() ) { rHTMLWrt.OutNewLine(); HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), aSpacer.getStr() ); @@ -1754,7 +1754,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrmFmt& rFrmFmt, rHTMLWrt.Out_SwDoc( rWrt.pCurPam ); } - if( bHeader && aSpacer.getLength() ) + if( bHeader && !aSpacer.isEmpty() ) { rHTMLWrt.OutNewLine(); HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), aSpacer.getStr() ); diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index a71c2d3450ba..f2638dc09ba2 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -204,7 +204,7 @@ void lcl_html_outEvents( SvStream& rStrm, rtl::OStringBuffer sOut; sOut.append(' '); if( pOpt && (EXTENDED_STYPE != eScriptType || - !pDescs[i].AddListenerParam.getLength()) ) + pDescs[i].AddListenerParam.isEmpty()) ) sOut.append(pOpt); else { @@ -220,7 +220,7 @@ void lcl_html_outEvents( SvStream& rStrm, HTMLOutFuncs::Out_String( rStrm, pDescs[i].ScriptCode, eDestEnc, pNonConvertableChars ); rStrm << '\"'; if( EXTENDED_STYPE == eScriptType && - pDescs[i].AddListenerParam.getLength() ) + !pDescs[i].AddListenerParam.isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_sdaddparam) .append(rtl::OUStringToOString(sListener, @@ -514,7 +514,7 @@ void SwHTMLWriter::OutForm( sal_Bool bOn, uno::Any aTmp = xFormPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Name")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name).append("=\""); Strm() << sOut.makeStringAndClear().getStr(); @@ -526,7 +526,7 @@ void SwHTMLWriter::OutForm( sal_Bool bOn, aTmp = xFormPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("TargetURL")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_action).append("=\""); Strm() << sOut.makeStringAndClear().getStr(); @@ -578,7 +578,7 @@ void SwHTMLWriter::OutForm( sal_Bool bOn, aTmp = xFormPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("TargetFrame")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0)&& - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_target).append("=\""); Strm() << sOut.makeStringAndClear().getStr(); @@ -653,7 +653,7 @@ void SwHTMLWriter::OutHiddenControls( aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Name")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name) .append("=\""); @@ -665,7 +665,7 @@ void SwHTMLWriter::OutHiddenControls( aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("HiddenValue")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_value) .append("=\""); @@ -812,7 +812,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, { const OUString& rVal = *(OUString*)aTmp.getValue(); - if( !rVal.getLength() ) + if( rVal.isEmpty() ) bEmptyValue = sal_True; else if( rVal.compareToAscii( OOO_STRING_SVTOOLS_HTML_on ) != 0 ) sValue = rVal; @@ -844,7 +844,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sValue = *(OUString*)aTmp.getValue(); } @@ -964,7 +964,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, { aTmp = xPropSet->getPropertyValue( sDefaultText ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sValue = *(OUString*)aTmp.getValue(); } @@ -1013,7 +1013,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Name")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name). append(RTL_CONSTASCII_STRINGPARAM("=\"")); @@ -1030,7 +1030,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_disabled); } - if( sValue.getLength() || bEmptyValue ) + if( !sValue.isEmpty() || bEmptyValue ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_value).append( RTL_CONSTASCII_STRINGPARAM("=\"")); @@ -1046,7 +1046,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("ImageURL")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_src). append(RTL_CONSTASCII_STRINGPARAM("=\"")); @@ -1160,7 +1160,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, { aTmp = xPropSet->getPropertyValue( sPropName ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { Font aFixedFont( OutputDevice::GetDefaultFont( DEFAULTFONT_FIXED, LANGUAGE_ENGLISH_US, @@ -1297,7 +1297,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, rHTMLWrt.OutNewLine(); // jede Option bekommt eine eigene Zeile sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_option); - if( sVal.getLength() || bEmptyVal ) + if( !sVal.isEmpty() || bEmptyVal ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_value). append(RTL_CONSTASCII_STRINGPARAM("=\"")); @@ -1330,7 +1330,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultText")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0)&& - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sVal = String( *(OUString*)aTmp.getValue() ); } @@ -1353,7 +1353,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, { aTmp = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Label"))); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && - ((OUString*)aTmp.getValue())->getLength() ) + !((OUString*)aTmp.getValue())->isEmpty() ) { sValue = *(OUString*)aTmp.getValue(); HTMLOutFuncs::Out_String( rWrt.Strm(), sValue, @@ -1361,7 +1361,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, } } - if( aEndTags.getLength() ) + if( !aEndTags.isEmpty() ) rWrt.Strm() << aEndTags.getStr(); // Controls sind nicht absatz-gebunden, deshalb kein LF mehr ausgeben! diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index cb3692bd6b28..31f00de2d0c3 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1033,7 +1033,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, ::rtl::OUString aStr; String aURL; aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginURL")) ); - if( (aAny >>= aStr) && aStr.getLength() ) + if( (aAny >>= aStr) && !aStr.isEmpty() ) { aURL = URIHelper::simpleNormalizedMakeRelative( rWrt.GetBaseURL(), aStr); @@ -1050,7 +1050,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, ::rtl::OUString aType; aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginMimeType")) ); - if( (aAny >>= aType) && aType.getLength() ) + if( (aAny >>= aType) && !aType.isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_type) .append("=\""); @@ -1082,7 +1082,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, // CODEBASE ::rtl::OUString aCd; aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletCodeBase")) ); - if( (aAny >>= aCd) && aCd.getLength() ) + if( (aAny >>= aCd) && !aCd.isEmpty() ) { String sCodeBase( URIHelper::simpleNormalizedMakeRelative(rWrt.GetBaseURL(), aCd) ); if( sCodeBase.Len() ) @@ -1109,7 +1109,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, ::rtl::OUString aAppletName; aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletName")) ); aAny >>= aAppletName; - if( aAppletName.getLength() ) + if( !aAppletName.isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name) .append("=\""); @@ -1248,7 +1248,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_iframe, sal_False ); } - if( aEndTags.getLength() ) + if( !aEndTags.isEmpty() ) rWrt.Strm() << aEndTags.getStr(); return rWrt; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index b4f7f16baec3..b559b74be3a7 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -855,7 +855,7 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() ) xDPS->getDocumentProperties()); OSL_ENSURE(xDocProps.is(), "DocumentProperties is null"); if ( xDocProps.is() && (xDocProps->getAutoloadSecs() > 0) && - (xDocProps->getAutoloadURL().getLength() == 0) ) + (xDocProps->getAutoloadURL().isEmpty()) ) { xDocProps->setAutoloadURL(aPathToFile); } @@ -5480,10 +5480,10 @@ void SwHTMLParser::AddMetaUserDefined( ::rtl::OUString const & i_rMetaName ) { // unless we already have 4 names, append the argument to m_InfoNames ::rtl::OUString* pName // the first empty string in m_InfoNames - (!m_InfoNames[0].getLength() ? &m_InfoNames[0] : - (!m_InfoNames[1].getLength() ? &m_InfoNames[1] : - (!m_InfoNames[2].getLength() ? &m_InfoNames[2] : - (!m_InfoNames[3].getLength() ? &m_InfoNames[3] : 0 )))); + (m_InfoNames[0].isEmpty() ? &m_InfoNames[0] : + (m_InfoNames[1].isEmpty() ? &m_InfoNames[1] : + (m_InfoNames[2].isEmpty() ? &m_InfoNames[2] : + (m_InfoNames[3].isEmpty() ? &m_InfoNames[3] : 0 )))); if (pName) { (*pName) = i_rMetaName; diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 32c26112214e..346247f05949 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1045,7 +1045,7 @@ void SwHTMLWriter::OutBookmarks() // auch nicht eingelesen wird. // erst die SWG spezifischen Daten: - if(dynamic_cast< const ::sw::mark::IBookmark* >(pBookmark) && pBookmark->GetName().getLength() ) + if(dynamic_cast< const ::sw::mark::IBookmark* >(pBookmark) && !pBookmark->GetName().isEmpty() ) OutAnchor( pBookmark->GetName() ); if( ++nBkmkTabPos >= pMarkAccess->getMarksCount() ) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index df37cf0f1c14..18ade4684eda 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -188,7 +188,7 @@ public: // #TODO check if this defaulted m_pSerializer->startElementNS( XML_w, XML_sizeAuto, FSEND ); m_pSerializer->endElementNS( XML_w, XML_sizeAuto ); - if ( rDefault.getLength() ) + if ( !rDefault.isEmpty() ) { m_pSerializer->singleElementNS( XML_w, XML_default, FSNS( XML_w, XML_val ), @@ -202,7 +202,7 @@ public: void WriteFormText( const rtl::OUString& rName, const rtl::OUString& rDefault ) { writeCommonStart( rName ); - if ( rDefault.getLength() ) + if ( !rDefault.isEmpty() ) { m_pSerializer->startElementNS( XML_w, XML_textInput, FSEND ); m_pSerializer->singleElementNS( XML_w, XML_default, @@ -798,7 +798,7 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos ) // Write the bookmark start if any OUString aBkmName( m_sFieldBkm ); - if ( aBkmName.getLength( ) > 0 ) + if ( !aBkmName.isEmpty() ) { m_pSerializer->singleElementNS( XML_w, XML_bookmarkStart, FSNS( XML_w, XML_id ), OString::valueOf( sal_Int32( m_nNextMarkId ) ).getStr( ), @@ -820,7 +820,7 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos ) } // Write the bookmark end if any - if ( aBkmName.getLength( ) > 0 ) + if ( !aBkmName.isEmpty() ) { m_pSerializer->singleElementNS( XML_w, XML_bookmarkEnd, FSNS( XML_w, XML_id ), OString::valueOf( sal_Int32( m_nNextMarkId ) ).getStr( ), @@ -1101,7 +1101,7 @@ void DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, co lang::Locale aLocale( SwBreakIt::Get()->GetLocale( rNode.GetLang( nPos ) ) ); OUString sLang( aLocale.Language ); - if ( aLocale.Country.getLength( ) > 0 ) + if ( !aLocale.Country.isEmpty() ) sLang += OUString(RTL_CONSTASCII_USTRINGPARAM( "-" )) + OUString( aLocale.Country ); m_pSerializer->singleElementNS( XML_w, XML_lid, FSNS( XML_w, XML_val ), @@ -1223,7 +1223,7 @@ bool DocxAttributeOutput::StartURL( const String& rUrl, const String& rTarget ) OUStringToOString( OUString( sMark ), RTL_TEXTENCODING_UTF8 ).getStr( ) ); OUString sTarget( rTarget ); - if ( sTarget.getLength( ) > 0 ) + if ( !sTarget.isEmpty() ) { OString soTarget = OUStringToOString( sTarget, RTL_TEXTENCODING_UTF8 ); m_pHyperlinkAttrList->add(FSNS( XML_w, XML_tgtFrame ), soTarget.getStr()); @@ -2007,7 +2007,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size nImageType = XML_embed; } - if ( aRelId.getLength() == 0 ) + if ( aRelId.isEmpty() ) return; m_pSerializer->startElementNS( XML_w, XML_drawing, @@ -2684,7 +2684,7 @@ void DocxAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, sal_uInt16 // nNumType corresponds to w:fmt. See WW8Export::GetNumId() for more precisions OString aFmt( impl_NumberingType( nNumType ) ); - if ( aFmt.getLength() ) + if ( !aFmt.isEmpty() ) pAttr->add( FSNS( XML_w, XML_fmt ), aFmt.getStr() ); XFastAttributeListRef xAttrs( pAttr ); @@ -2850,7 +2850,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, // format OString aFmt( impl_NumberingType( nNumberingType ) ); - if ( aFmt.getLength() ) + if ( !aFmt.isEmpty() ) m_pSerializer->singleElementNS( XML_w, XML_numFmt, FSNS( XML_w, XML_val ), aFmt.getStr(), FSEND ); @@ -3025,11 +3025,11 @@ void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement ) sIss = OString( "superscript" ); } - if ( sIss.getLength( ) > 0 ) + if ( !sIss.isEmpty() ) m_pSerializer->singleElementNS( XML_w, XML_vertAlign, FSNS( XML_w, XML_val ), sIss.getStr(), FSEND ); - if ( sIss.getLength() == 0 || sIss.match( OString( "baseline" ) ) ) + if ( sIss.isEmpty() || sIss.match( OString( "baseline" ) ) ) { long nHeight = ((SvxFontHeightItem&)m_rExport.GetItem( RES_CHRATR_FONTSIZE )).GetHeight(); @@ -4065,7 +4065,7 @@ void DocxAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert break; } - if ( sAlign.getLength() > 0 ) + if ( !sAlign.isEmpty() ) m_pFlyAttrList->add( FSNS( XML_w, XML_yAlign ), sAlign ); else m_pFlyAttrList->add( FSNS( XML_w, XML_y ), @@ -4121,7 +4121,7 @@ void DocxAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& rFlyHor break; } - if ( sAlign.getLength() > 0 ) + if ( !sAlign.isEmpty() ) m_pFlyAttrList->add( FSNS( XML_w, XML_xAlign ), sAlign ); else m_pFlyAttrList->add( FSNS( XML_w, XML_x ), diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 98049c6fc4ea..6d8930c5b09e 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -258,12 +258,12 @@ void DocxExport::DoComboBox(const rtl::OUString& rName, m_pDocumentFS->singleElementNS( XML_w, XML_enabled, FSEND ); - if ( rHelp.getLength( ) > 0 ) + if ( !rHelp.isEmpty() ) m_pDocumentFS->singleElementNS( XML_w, XML_helpText, FSNS( XML_w, XML_val ), OUStringToOString( rHelp, RTL_TEXTENCODING_UTF8 ).getStr(), FSEND ); - if ( rToolTip.getLength( ) > 0 ) + if ( !rToolTip.isEmpty() ) m_pDocumentFS->singleElementNS( XML_w, XML_statusText, FSNS( XML_w, XML_val ), OUStringToOString( rToolTip, RTL_TEXTENCODING_UTF8 ).getStr(), FSEND ); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index e1d55e22abcf..8534f8200f5d 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -344,18 +344,18 @@ void RtfExport::DoFormText(const SwInputField* pFld ) ::rtl::OUString sStatus = pFld->GetToolTip(); m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST "{ FORMTEXT }"); m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD " {" OOO_STRING_SVTOOLS_RTF_FFTYPE "0" ); - if( sHelp.getLength() ) + if( !sHelp.isEmpty() ) m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFOWNHELP ); - if( sStatus.getLength() ) + if( !sStatus.isEmpty() ) m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFOWNSTAT ); m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFTYPETXT "0" ); - if( sName.getLength() ) + if( !sName.isEmpty() ) m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ").append( OutString( sName, eDefaultEncoding )).append( "}" ); - if( sHelp.getLength() ) + if( !sHelp.isEmpty() ) m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ").append( OutString( sHelp, eDefaultEncoding )).append( "}" ); m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFDEFTEXT " ").append( OutString( sResult, eDefaultEncoding )).append( "}" ); - if( sStatus.getLength() ) + if( !sStatus.isEmpty() ) m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ").append( OutString( sStatus, eDefaultEncoding )).append( "}"); m_pAttrOutput->RunText().append( "}}}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " " ); m_pAttrOutput->RunText().append( OutString( sResult, eDefaultEncoding )).append( "}}" ); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index ad4b03e1c7b4..998197d008c9 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1880,7 +1880,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) rtl::OUString sOleId; uno::Any aValue = it->second; aValue >>= sOleId; - if ( sOleId.getLength( ) > 0 ) + if ( !sOleId.isEmpty() ) OutputLinkedOLE( sOleId ); } } diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 5335ae7c9125..a14279d5f669 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2822,7 +2822,7 @@ namespace //See https://bugs.freedesktop.org/show_bug.cgi?id=34319 for an example void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const rtl::OUString& rAddString) { - if (!rAddString.getLength()) + if (rAddString.isEmpty()) return; uno::Reference<i18n::XBreakIterator> xBI(pBreakIt->GetBreakIter()); @@ -4233,7 +4233,7 @@ void SwWW8ImplReader::ReadDocInfo() rtl::OUString aName = pMedium->GetName(); INetURLObject aURL( aName ); sTemplateURL = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); - if ( sTemplateURL.getLength() > 0 ) + if ( !sTemplateURL.isEmpty() ) xDocProps->setTemplateURL( sTemplateURL ); } } @@ -4253,7 +4253,7 @@ void SwWW8ImplReader::ReadDocInfo() // attempt to convert to url ( won't work for obvious reasons on linux if ( sPath.Len() ) ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, aURL ); - if (!aURL.getLength()) + if (aURL.isEmpty()) xDocProps->setTemplateURL( aURL ); else xDocProps->setTemplateURL( sPath ); @@ -4353,7 +4353,7 @@ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const rtl::OUString& sCreatedF aURL = sGlobalTemplates[ i ]; else osl::FileBase::getFileURLFromSystemPath( sGlobalTemplates[ i ], aURL ); - if ( !aURL.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) || ( sCreatedFrom.getLength() && sCreatedFrom.equals( aURL ) ) ) + if ( !aURL.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) || ( !sCreatedFrom.isEmpty() && sCreatedFrom.equals( aURL ) ) ) continue; // don't try and read the same document as ourselves SotStorageRef rRoot = new SotStorage( aURL, STREAM_STD_READWRITE, STORAGE_TRANSACTED ); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index e39f5c7d9a8b..6a7a02aad34c 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -731,7 +731,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() break; default: rtl::OUString aCode = maFieldStack.back().GetBookmarkCode(); - if ( aCode.getLength() > 0 ) + if ( !aCode.isEmpty() ) { // Unhandled field with stored code SwPosition aEndPos = *pPaM->GetPoint(); @@ -2326,7 +2326,7 @@ bool CanUseRemoteLink(const String &rGrfName) aCnt.getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title"))) >>= aTitle; - bUseRemote = (aTitle.getLength() > 0); + bUseRemote = !aTitle.isEmpty(); } catch ( ... ) { diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index 06cf7e707e2b..2f18072e80d4 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -707,7 +707,7 @@ TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css: if ( bBuiltin ) { rtl::OUString sCommand = helper.MSOCommandToOOCommand( cmdId ); - if ( sCommand.getLength() > 0 ) + if ( !sCommand.isEmpty() ) { beans::PropertyValue aProp; diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index d0be6210d7fd..5a6e5ff996d8 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -831,7 +831,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con StreamPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dummyObjectName")); } - if( StreamPath.getLength() ) + if( !StreamPath.isEmpty() ) { sPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")); xInfoSet->setPropertyValue( sPropName, makeAny( StreamPath ) ); diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 259f9dee9621..fe1395e5f700 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -248,7 +248,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, else aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "dummyObjectName" ) ); - if( aName.getLength() ) + if( !aName.isEmpty() ) { sPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")); xInfoSet->setPropertyValue( sPropName, makeAny( aName ) ); @@ -365,7 +365,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, if ( xModule.is() ) { ::rtl::OUString aModuleID = xModule->getIdentifier(); - bStoreMeta = ( aModuleID.getLength() + bStoreMeta = ( !aModuleID.isEmpty() && ( aModuleID.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.FormDesign" ) ) ) || aModuleID.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.TextReportDesign" ) ) ) ) ); } diff --git a/sw/source/filter/xml/xmlbrsh.cxx b/sw/source/filter/xml/xmlbrsh.cxx index df130d163e28..0753d8ae9603 100644 --- a/sw/source/filter/xml/xmlbrsh.cxx +++ b/sw/source/filter/xml/xmlbrsh.cxx @@ -221,7 +221,7 @@ void SwXMLBrushItemExport::exportXML( const SvxBrushItem& rItem ) rItem, sURL, MID_GRAPHIC_LINK, rUnitConv ) ) { sValue = GetExport().AddEmbeddedGraphicObject( sURL ); - if( sValue.getLength() ) + if( !sValue.isEmpty() ) { GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sValue ); GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); @@ -244,7 +244,7 @@ void SwXMLBrushItemExport::exportXML( const SvxBrushItem& rItem ) { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, sal_True, sal_True ); - if( sURL.getLength() ) + if( !sURL.isEmpty() ) { // optional office:binary-data GetExport().AddEmbeddedGraphicObjectAsBase64( sURL ); diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index f1afbd08db09..5018607ef493 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -169,7 +169,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, for( sal_uInt16 i=0; i < nCount; i++ ) { OUString sPrefix( pUnknown->GetAttrPrefix( i ) ); - if( sPrefix.getLength() ) + if( !sPrefix.isEmpty() ) { OUString sNamespace( pUnknown->GetAttrNamespace( i ) ); diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index 8320b91a5012..5e54d6bd8b1b 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -119,7 +119,7 @@ inline sal_Bool SwXMLConditionParser_Impl::MatchName( OUString& rName ) nPos++; } rName = sBuffer.makeStringAndClear(); - return rName.getLength() > 0; + return !rName.isEmpty(); } inline sal_Bool SwXMLConditionParser_Impl::MatchNumber( sal_uInt32& rNumber ) @@ -132,9 +132,9 @@ inline sal_Bool SwXMLConditionParser_Impl::MatchNumber( sal_uInt32& rNumber ) } OUString sNum( sBuffer.makeStringAndClear() ); - if( sNum.getLength() ) + if( !sNum.isEmpty() ) rNumber = sNum.toInt32(); - return sNum.getLength() > 0; + return !sNum.isEmpty(); } SwXMLConditionParser_Impl::SwXMLConditionParser_Impl( const OUString& rInp ) : @@ -512,7 +512,7 @@ void SwXMLItemSetStyleContext_Impl::SetAttribute( sal_uInt16 nPrefixKey, else if ( IsXMLToken( rLocalName, XML_DATA_STYLE_NAME ) ) { // if we have a valid data style name - if (rValue.getLength() > 0) + if (!rValue.isEmpty()) { sDataStyleName = rValue; bDataStyleIsResolved = sal_False; // needs to be resolved diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index 80d2475e6c07..a57b8955efa8 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -133,7 +133,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily ) // written after cell styles) addDataStyle(nFormat); OUString sDataStyleName = getDataStyleName(nFormat); - if( sDataStyleName.getLength() > 0 ) + if( !sDataStyleName.isEmpty() ) AddAttribute( XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME, sDataStyleName ); } @@ -316,10 +316,10 @@ void SwXMLAutoStylePoolP::exportStyleAttributes( OUString sStyleName; aProperty->maValue >>= sStyleName; // #i70748# - export also empty list styles - if( sStyleName.getLength() ) + if( !sStyleName.isEmpty() ) { OUString sTmp = rExport.GetTextParagraphExport()->GetListAutoStylePool().Find( sStyleName ); - if( sTmp.getLength() ) + if( !sTmp.isEmpty() ) sStyleName = sTmp; } GetExport().AddAttribute( XML_NAMESPACE_STYLE, diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 28051ee2e2ea..bdf879518b26 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -841,7 +841,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue( if( bOk ) pVertOrient->SetVertOrient( nValue ); //#i8855# text::VertOrientation::NONE is stored as empty string and should be applied here - else if(!rValue.getLength()) + else if(rValue.isEmpty()) { pVertOrient->SetVertOrient( text::VertOrientation::NONE ); bOk = sal_True; diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx index a04c95966455..956676721f05 100644 --- a/sw/source/filter/xml/xmlitemi.cxx +++ b/sw/source/filter/xml/xmlitemi.cxx @@ -208,7 +208,7 @@ sal_Bool SwXMLImportTableItemMapper_Impl::handleNoItem( void SwXMLImportTableItemMapper_Impl::finished( SfxItemSet & rSet, SvXMLUnitConverter const& rUnitConverter) const { - if (m_FoMarginValue.getLength()) + if (!m_FoMarginValue.isEmpty()) { sal_uInt16 const Ids[4][2] = { { RES_LR_SPACE, MID_L_MARGIN }, diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx index 4db411c65fb4..18a1b6b02410 100644 --- a/sw/source/filter/xml/xmlithlp.cxx +++ b/sw/source/filter/xml/xmlithlp.cxx @@ -117,7 +117,7 @@ sal_Bool lcl_frmitems_parseXMLBorder( const OUString& rValue, rNamedWidth = USHRT_MAX; sal_Int32 nTemp; - while( aTokens.getNextToken( aToken ) && aToken.getLength() != 0 ) + while( aTokens.getNextToken( aToken ) && !aToken.isEmpty() ) { if( !rHasWidth && rUnitConverter.convertEnum( rNamedWidth, aToken, diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index f3ee9c746279..0a77c1b03c79 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -836,7 +836,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, // if this cell has a formula, export it // (with value and number format) - if (sCellFormula.getLength()>0) + if (!sCellFormula.isEmpty()) { OUString sQValue = GetNamespaceMap().GetQNameByKey( @@ -860,7 +860,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING ); } - else if ( (-1 != nNumberFormat) && (xText->getString().getLength() > 0) ) + else if ( (-1 != nNumberFormat) && !xText->getString().isEmpty() ) { // number format key: // (export values only if cell contains text;) diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 978e5e127a53..43a284b60d14 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -776,7 +776,7 @@ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl( sal_Int32 nWidth = MINLAY; sal_Bool bRelWidth = sal_True; - if( aStyleName.getLength() ) + if( !aStyleName.isEmpty() ) { const SfxPoolItem *pItem; const SfxItemSet *pAutoItemSet = 0; @@ -1339,7 +1339,7 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() ); String sTblName; - if( aName.getLength() ) + if( !aName.isEmpty() ) { const SwTableFmt *pTblFmt = pDoc->FindTblFmtByName( aName ); if( !pTblFmt ) @@ -1533,7 +1533,7 @@ void SwXMLTableContext::InsertColumn( sal_Int32 nWidth2, sal_Bool bRelWidth2, else if( nWidth2 > USHRT_MAX ) nWidth2 = USHRT_MAX; aColumnWidths.push_back( ColumnWidthInfo(nWidth2, bRelWidth2) ); - if( (pDfltCellStyleName && pDfltCellStyleName->getLength() > 0) || + if( (pDfltCellStyleName && !pDfltCellStyleName->isEmpty()) || pColumnDefaultCellStyleNames ) { if( !pColumnDefaultCellStyleNames ) @@ -1657,13 +1657,13 @@ void SwXMLTableContext::InsertCell( const OUString& rStyleName, } OUString sStyleName( rStyleName ); - if( !sStyleName.getLength() ) + if( sStyleName.isEmpty() ) { sStyleName = ((*pRows)[(sal_uInt16)nCurRow])->GetDefaultCellStyleName(); - if( !sStyleName.getLength() && HasColumnDefaultCellStyleNames() ) + if( sStyleName.isEmpty() && HasColumnDefaultCellStyleNames() ) { sStyleName = GetColumnDefaultCellStyleName( nCurCol ); - if( !sStyleName.getLength() ) + if( sStyleName.isEmpty() ) sStyleName = aDfltCellStyleName; } } @@ -2062,7 +2062,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( sal_Bool bNew; SwTableBoxFmt *pBoxFmt2 = GetSharedBoxFormat( pBox, sStyleName, nColWidth, pCell->IsProtected(), - pCell->GetStartNode() && pCell->GetFormula().getLength() == 0 && + pCell->GetStartNode() && pCell->GetFormula().isEmpty() && ! pCell->HasValue(), bNew, &bModifyLocked ); @@ -2071,7 +2071,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( { // set style const SfxItemSet *pAutoItemSet = 0; - if( pCell->GetStartNode() && sStyleName.getLength() && + if( pCell->GetStartNode() && !sStyleName.isEmpty() && GetSwImport().FindAutomaticStyle( XML_STYLE_FAMILY_TABLE_CELL, sStyleName, &pAutoItemSet ) ) { @@ -2092,8 +2092,8 @@ SwTableBox *SwXMLTableContext::MakeTableBox( // then make it a text cell! bool bSuppressNumericContent = false; if( pCell->HasValue() && (pCell->GetValue() == 0.0) && - (pCell->GetFormula().getLength() == 0) && - (sStyleName.getLength() != 0) ) + pCell->GetFormula().isEmpty() && + !sStyleName.isEmpty() ) { // default num format? const SfxPoolItem* pItem = NULL; @@ -2139,7 +2139,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( // the normal case: set formula and value (if available) const OUString& rFormula = pCell->GetFormula(); - if (rFormula.getLength() > 0) + if (!rFormula.isEmpty()) { // formula cell: insert formula if valid SwTblBoxFormula aFormulaItem( rFormula ); @@ -2220,7 +2220,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, const SfxItemSet *pAutoItemSet = 0; const OUString& rStyleName = (*pRows)[(sal_uInt16)nTopRow]->GetStyleName(); if( 1UL == (nBottomRow - nTopRow) && - rStyleName.getLength() && + !rStyleName.isEmpty() && GetSwImport().FindAutomaticStyle( XML_STYLE_FAMILY_TABLE_ROW, rStyleName, &pAutoItemSet ) ) { @@ -2684,7 +2684,7 @@ void SwXMLTableContext::MakeTable() pTableNode->GetTable().SetTableModel( !bHasSubTables ); const SfxItemSet *pAutoItemSet = 0; - if( aStyleName.getLength() && + if( !aStyleName.isEmpty() && rSwImport.FindAutomaticStyle( XML_STYLE_FAMILY_TABLE_TABLE, aStyleName, &pAutoItemSet ) && pAutoItemSet ) diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 2dc565c04f97..c62bce3f9c36 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -165,7 +165,7 @@ void SwXMLTextParagraphExport::exportStyleContent( sBuffer.append( GetXMLToken(eFunc) ); sBuffer.append( (sal_Unicode)'(' ); sBuffer.append( (sal_Unicode)')' ); - if( sVal.getLength() ) + if( !sVal.isEmpty() ) { sBuffer.append( (sal_Unicode)'=' ); sBuffer.append( sVal ); @@ -213,7 +213,7 @@ void SwXMLTextParagraphExport::setTextEmbeddedGraphicURL( const Reference < XPropertySet >& rPropSet, OUString& rURL) const { - if( !rURL.getLength() ) + if( rURL.isEmpty() ) return; SwGrfNode *pGrfNd = GetNoTxtNode( rPropSet )->GetGrfNode(); @@ -473,7 +473,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( pStates++; } - if( sAutoStyle.getLength() ) + if( !sAutoStyle.isEmpty() ) rXMLExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE_NAME, sAutoStyle ); addTextFrameAttributes( rPropSet, sal_False ); @@ -561,12 +561,12 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( ::rtl::OUString aStr; Any aAny2 = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletCodeBase")) ); aAny2 >>= aStr; - if (aStr.getLength() ) + if (!aStr.isEmpty() ) lcl_addURL(rXMLExport, aStr); aAny2 = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletName")) ); aAny2 >>= aStr; - if (aStr.getLength()) + if (!aStr.isEmpty()) rXMLExport.AddAttribute( XML_NAMESPACE_DRAW, XML_APPLET_NAME, aStr ); aAny2 = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletCode")) ); @@ -612,7 +612,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( aAny2 = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginMimeType")) ); aAny2 >>= aStr; - if (aStr.getLength()) + if (!aStr.isEmpty()) rXMLExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIME_TYPE, aStr ); eElementName = XML_PLUGIN; } @@ -633,7 +633,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( aAny2 = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameName")) ); aAny2 >>= aStr; - if (aStr.getLength()) + if (!aStr.isEmpty()) rXMLExport.AddAttribute( XML_NAMESPACE_DRAW, XML_FRAME_NAME, aStr ); eElementName = XML_FLOATING_FRAME; } diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 926f42363c66..4b77b18c4887 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -240,7 +240,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( OUString aObjName( rHRef.copy( nPos+1) ); - if( !aObjName.getLength() ) + if( aObjName.isEmpty() ) return xPropSet; uno::Reference<XUnoTunnel> xCrsrTunnel( GetCursor(), UNO_QUERY ); @@ -378,7 +378,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( if( pDoc->GetDrawModel() ) SwXFrame::GetOrCreateSdrObject( static_cast<SwFlyFrmFmt*>( pXFrame->GetFrmFmt() ) ); // req for z-order - if( rTblName.getLength() ) + if( !rTblName.isEmpty() ) { const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); const SwNodeIndex *pNdIdx = rCntnt.GetCntntIdx(); @@ -457,7 +457,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( sal_Int64 nDrawAspect = 0; const XMLPropStyleContext *pStyle = 0; sal_Bool bHasSizeProps = sal_False; - if( rStyleName.getLength() ) + if( !rStyleName.isEmpty() ) { pStyle = FindAutoFrameStyle( rStyleName ); if( pStyle ) @@ -569,7 +569,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( // We'll need a (valid) URL. If we don't have do not insert the link and return early. // Copy URL into URL oject on the way. INetURLObject aURLObj; - bool bValidURL = rHRef.getLength() != 0 && + bool bValidURL = !rHRef.isEmpty() && aURLObj.SetURL( URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) ); if( !bValidURL ) @@ -654,7 +654,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet( SwApplet_Impl aAppletImpl ( aItemSet ); String sCodeBase; - if( rHRef.getLength() ) + if( !rHRef.isEmpty() ) sCodeBase = GetXMLImport().GetAbsoluteReference( rHRef ); aAppletImpl.CreateApplet ( rCode, rName, bMayScript, sCodeBase, GetXMLImport().GetDocumentBase() ); @@ -701,9 +701,9 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin( // on the way. INetURLObject aURLObj; - bool bValidURL = rHRef.getLength() != 0 && + bool bValidURL = !rHRef.isEmpty() && aURLObj.SetURL( URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) ); - bool bValidMimeType = rMimeType.getLength() != 0; + bool bValidMimeType = !rMimeType.isEmpty(); if( !bValidURL && !bValidMimeType ) return xPropSet; @@ -783,7 +783,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra sal_Bool bIsBorderSet = sal_False; Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET ); const XMLPropStyleContext *pStyle = 0; - if( rStyleName.getLength() ) + if( !rStyleName.isEmpty() ) { pStyle = FindAutoFrameStyle( rStyleName ); if( pStyle ) @@ -1029,7 +1029,7 @@ void SwXMLTextImportHelper::RedlineAdjustStartNodeCursor( sal_Bool bStart) { OUString rId = GetOpenRedlineId(); - if ((NULL != pRedlineHelper) && (rId.getLength() > 0)) + if ((NULL != pRedlineHelper) && !rId.isEmpty()) { uno::Reference<XTextRange> xTextRange( GetCursor()->getStart() ); pRedlineHelper->AdjustStartNodeCursor(rId, bStart, xTextRange ); |