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/core | |
parent | 802d82b6e2acedd3581acbf23407d7f5f742c671 (diff) |
Fix for fdo43460 Part XL getLength() to isEmpty()
Part XL
Modules
sw
Diffstat (limited to 'sw/source/core')
33 files changed, 83 insertions, 83 deletions
diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index 3c659152484c..f9a5ea6b5b9e 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -76,7 +76,7 @@ SwAccessibleNoTextFrame::SwAccessibleNoTextFrame( msTitle = pNd->GetTitle(); msDesc = pNd->GetDescription(); - if ( msDesc.getLength() == 0 && + if ( msDesc.isEmpty() && msTitle != GetName() ) { msDesc = msTitle; @@ -95,7 +95,7 @@ void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem // suppress handling of RES_NAME_CHANGED in case that attribute Title is // used as the accessible name. if ( nWhich != RES_NAME_CHANGED || - msTitle.getLength() == 0 ) + msTitle.isEmpty() ) { SwAccessibleFrameBase::Modify( pOld, pNew ); } @@ -136,7 +136,7 @@ void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem const String& rDesc = pNd->GetDescription(); msDesc = rDesc; - if ( msDesc.getLength() == 0 && + if ( msDesc.isEmpty() && msTitle != GetName() ) { msDesc = msTitle; @@ -174,7 +174,7 @@ OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleName (void) CHECK_FOR_DEFUNC( XAccessibleContext ) - if ( msTitle.getLength() != 0 ) + if ( !msTitle.isEmpty() ) { return msTitle; } diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 30c3165e09c9..59249ad57a92 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -817,7 +817,7 @@ sal_Bool SwAccessibleParagraph::GetTextBoundary( CHECK_FOR_DEFUNC( XAccessibleContext ); osl::MutexGuard aGuard2( aMutex ); - if( !sDesc.getLength() ) + if( sDesc.isEmpty() ) sDesc = GetDescription(); return sDesc; diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx index 72861edc1af5..0f8175ac1c12 100644 --- a/sw/source/core/access/acctextframe.cxx +++ b/sw/source/core/access/acctextframe.cxx @@ -69,7 +69,7 @@ SwAccessibleTextFrame::SwAccessibleTextFrame( msTitle = pFlyFrmFmt->GetObjTitle(); msDesc = pFlyFrmFmt->GetObjDescription(); - if ( msDesc.getLength() == 0 && + if ( msDesc.isEmpty() && msTitle != GetName() ) { msDesc = msTitle; @@ -87,7 +87,7 @@ void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * // #i73249# - suppress handling of RES_NAME_CHANGED // in case that attribute Title is used as the accessible name. if ( nWhich != RES_NAME_CHANGED || - msTitle.getLength() == 0 ) + msTitle.isEmpty() ) { SwAccessibleFrameBase::Modify( pOld, pNew ); } @@ -131,7 +131,7 @@ void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * dynamic_cast<const SwFlyFrmFmt*>( pFlyFrm->GetFmt() ); const String& rDesc = pFlyFrmFmt->GetObjDescription(); msDesc = rDesc; - if ( msDesc.getLength() == 0 && + if ( msDesc.isEmpty() && msTitle != GetName() ) { msDesc = msTitle; @@ -159,7 +159,7 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleName (void) CHECK_FOR_DEFUNC( XAccessibleContext ) - if ( msTitle.getLength() != 0 ) + if ( !msTitle.isEmpty() ) { return msTitle; } diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx index 48ab3b88e554..9f77b6c2c9cd 100644 --- a/sw/source/core/crsr/crossrefbookmark.cxx +++ b/sw/source/core/crsr/crossrefbookmark.cxx @@ -47,7 +47,7 @@ namespace sw { namespace mark "<CrossRefBookmark::CrossRefBookmark(..)>" "- creation of cross-reference bookmark with an expanded PaM that does not expand over exactly one whole paragraph."); SetMarkPos(*rPaM.Start()); - if(!rName.getLength()) + if(rName.isEmpty()) m_aName = MarkBase::GenerateNewName(rPrefix); } diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 4ba652c5ccbb..e88eda064ea6 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -1102,7 +1102,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, { // String ersetzen ?? (nur wenn Text angegeben oder nicht attributiert // gesucht wird) - sal_Bool bReplaceTxt = pSearchOpt && ( pSearchOpt->replaceString.getLength() || + sal_Bool bReplaceTxt = pSearchOpt && ( !pSearchOpt->replaceString.isEmpty() || !pSet->Count() ); sal_Bool bReplaceAttr = pReplSet && pReplSet->Count(); sal_Bool bMoveFirst = !bReplaceAttr; @@ -1245,7 +1245,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, int SwFindParaAttr::IsReplaceMode() const { - return ( pSearchOpt && pSearchOpt->replaceString.getLength() ) || + return ( pSearchOpt && !pSearchOpt->replaceString.isEmpty() ) || ( pReplSet && pReplSet->Count() ); } @@ -1262,7 +1262,7 @@ sal_uLong SwCursor::Find( const SfxItemSet& rSet, sal_Bool bNoCollections, Link aLnk( pDoc->GetOle2Link() ); pDoc->SetOle2Link( Link() ); - sal_Bool bReplace = ( pSearchOpt && ( pSearchOpt->replaceString.getLength() || + sal_Bool bReplace = ( pSearchOpt && ( !pSearchOpt->replaceString.isEmpty() || !rSet.Count() ) ) || (pReplSet && pReplSet->Count()); bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && bReplace; diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 85ef477ccb17..121257ca7d19 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -225,7 +225,7 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes SwMoveFn fnMove, const SwPaM * pRegion, sal_Bool bInReadOnly ) { - if( !rSearchOpt.searchString.getLength() ) + if( rSearchOpt.searchString.isEmpty() ) return sal_False; SwPaM* pPam = MakeRegion( fnMove, pRegion ); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 8c61466eb9f9..41fba1651f1d 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1380,7 +1380,7 @@ void SwDoc::CalculatePagesForPrinting( // please note } - if (aPageRange.getLength() == 0) // empty string -> print all + if (aPageRange.isEmpty()) // empty string -> print all { // set page range to print to 'all pages' aPageRange = OUString::valueOf( (sal_Int32)1 ); @@ -1552,7 +1552,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( const sal_Int32 nContent = rOptions.getIntValue( "PrintContent", 0 ); if (nContent == 1) aPageRange = rOptions.getStringValue( "PageRange", rtl::OUString() ); - if (aPageRange.getLength() == 0) // empty string -> print all + if (aPageRange.isEmpty()) // empty string -> print all { // set page range to print to 'all pages' aPageRange = OUString::valueOf( (sal_Int32)1 ); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index a3ce1310739b..fdbddb521ecf 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -833,7 +833,7 @@ namespace sw { namespace mark ::rtl::OUString MarkManager::getUniqueMarkName(const ::rtl::OUString& rName) const { - OSL_ENSURE(rName.getLength(), + OSL_ENSURE(!rName.isEmpty(), "<MarkManager::getUniqueMarkName(..)>" " - a name should be proposed"); if(!hasMark(rName)) return rName; diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 198e79496001..cb7aa3780f37 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1524,7 +1524,7 @@ void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc ) else ((SwDBNumSetField&)rDBFld).SetCondValid( bPar1 ); - if( rDBFld.GetRealDBData().sDataSource.getLength() ) + if( !rDBFld.GetRealDBData().sDataSource.isEmpty() ) { // Edit a certain database if( RES_DBNEXTSETFLD == nFldType ) @@ -1606,10 +1606,10 @@ SwDBData SwDoc::GetDBData() const SwDBData& SwDoc::GetDBDesc() { - if(!aDBData.sDataSource.getLength()) + if(aDBData.sDataSource.isEmpty()) { const sal_uInt16 nSize = pFldTypes->Count(); - for(sal_uInt16 i = 0; i < nSize && !aDBData.sDataSource.getLength(); ++i) + for(sal_uInt16 i = 0; i < nSize && aDBData.sDataSource.isEmpty(); ++i) { SwFieldType& rFldType = *((*pFldTypes)[i]); sal_uInt16 nWhich = rFldType.Which(); @@ -1642,7 +1642,7 @@ const SwDBData& SwDoc::GetDBDesc() } } } - if(!aDBData.sDataSource.getLength()) + if(aDBData.sDataSource.isEmpty()) aDBData = GetNewDBMgr()->GetAddressDBName(); return aDBData; } diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index acf474842981..b502d1220a01 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -440,7 +440,7 @@ uno::Any SwConvIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) xEmpty, pPageCnt, pPageSt, false, &rArgs ) >>= aConvText; bGoOn = GetCrsrCnt() > 1; - if( aConvText.getLength() ) + if( !aConvText.isEmpty() ) { bGoOn = sal_False; SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() ); @@ -830,7 +830,7 @@ uno::Any SwEditShell::SpellContinue( } --nStartAction; - if( aRet.getLength() || xRet.is() ) + if( !aRet.isEmpty() || xRet.is() ) { // dann die awt::Selection sichtbar machen StartAction(); diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 3a178ed737c4..c47a6059ebe4 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -387,7 +387,7 @@ void SwEditShell::ApplyAutoMark() // ; -> delimiter between entries -> // Format: TextToSearchFor;AlternativeString;PrimaryKey;SecondaryKey;CaseSensitive;WordOnly // Leading and trailing blanks are ignored - if( aRdLine.getLength() && '#' != aRdLine[0] ) + if( !aRdLine.isEmpty() && '#' != aRdLine[0] ) { String sLine( aRdLine, eChrSet ); diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index 26337508485d..66ebfc9c6ff0 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -77,7 +77,7 @@ SwDBFieldType::SwDBFieldType(SwDoc* pDocPtr, const String& rNam, const SwDBData& sColumn(rNam), nRefCnt(0) { - if(aDBData.sDataSource.getLength() || aDBData.sCommand.getLength()) + if(!aDBData.sDataSource.isEmpty() || !aDBData.sCommand.isEmpty()) { sName = aDBData.sDataSource; sName += DB_DELIM; @@ -497,7 +497,7 @@ SwDBNameInfField::SwDBNameInfField(SwFieldType* pTyp, const SwDBData& rDBData, s SwDBData SwDBNameInfField::GetDBData(SwDoc* pDoc) { SwDBData aRet; - if(aDBData.sDataSource.getLength()) + if(!aDBData.sDataSource.isEmpty()) aRet = aDBData; else aRet = pDoc->GetDBData(); @@ -514,7 +514,7 @@ void SwDBNameInfField::SetDBData(const SwDBData & rDBData) String SwDBNameInfField::GetFieldName() const { String sStr( SwField::GetFieldName() ); - if (aDBData.sDataSource.getLength()) + if (!aDBData.sDataSource.isEmpty()) { sStr += ':'; sStr += String(aDBData.sDataSource); diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 8b0ecf0ec759..2f588ae0d32a 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -625,7 +625,7 @@ String SwTemplNameFieldType::Expand(sal_uLong nFmt) const if( FF_UI_NAME == nFmt ) aRet = xDocProps->getTemplateName(); - else if( xDocProps->getTemplateURL().getLength() ) + else if( !xDocProps->getTemplateURL().isEmpty() ) { if( FF_UI_RANGE == nFmt ) { diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx index 87f6d83889a5..fc166cb6eca2 100644 --- a/sw/source/core/layout/dbg_lay.cxx +++ b/sw/source/core/layout/dbg_lay.cxx @@ -380,7 +380,7 @@ void SwImplProtocol::CheckLine( rtl::OString& rLine ) bNo = sal_True; // Diese(n) Funktion/Typ entfernen aTok = aTok.copy(1); } - if( aTok.getLength() ) + if( !aTok.isEmpty() ) { sal_uLong nVal; sscanf( aTok.getStr(), "%li", &nVal ); @@ -442,14 +442,14 @@ void SwImplProtocol::FileInit() if( '\n' == c || '\r' == c ) // Zeilenende { aLine = aLine.trim(); - if( aLine.getLength() ) + if( !aLine.isEmpty() ) CheckLine( aLine ); // Zeile auswerten aLine = rtl::OString(); } else aLine = rtl::OString(c); } - if( aLine.getLength() ) + if( !aLine.isEmpty() ) CheckLine( aLine ); // letzte Zeile auswerten } aStream.Close(); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index c26d0c89873d..a66d224888fc 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -1519,7 +1519,7 @@ SwEnhancedPDFExportHelper::SwEnhancedPDFExportHelper( SwEditShell& rSh, mbSkipEmptyPages( bSkipEmptyPages ), mbEditEngineOnly( bEditEngineOnly ) { - if ( rPageRange.getLength() ) + if ( !rPageRange.isEmpty() ) mpRangeEnum = new StringRangeEnumerator( rPageRange, 0, mrSh.GetPageCount()-1 ); if ( mbSkipEmptyPages ) diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx index 6764f051d748..2441f94a1236 100644 --- a/sw/source/core/text/wrong.cxx +++ b/sw/source/core/text/wrong.cxx @@ -188,7 +188,7 @@ MSHORT SwWrongList::GetWrongPos( xub_StrLen nValue ) const { // For smart tag lists, we may not use a binary search. We return the // position of the first smart tag which coveres nValue - if ( 0 != maList[0].maType.getLength() || maList[0].mpSubList ) + if ( !maList[0].maType.isEmpty() || maList[0].mpSubList ) { std::vector<SwWrongArea>::const_iterator aIter = maList.begin(); while ( aIter != maList.end() ) diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index e8335ee79654..71749fdeb1bc 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1087,7 +1087,7 @@ sal_uInt16 SwTxtNode::Convert( SwConversionArgs &rArgs ) m_Text = aOldTxt; } - return rArgs.aConvText.getLength() ? 1 : 0; + return rArgs.aConvText.isEmpty() ? 0 : 1; } // Die Aehnlichkeiten zu SwTxtNode::Spell sind beabsichtigt ... @@ -1828,7 +1828,7 @@ void SwTxtNode::CountWords( SwDocStat& rStat, const sal_uInt32 nExpandBegin = ModelToViewHelper::ConvertToViewPosition( pConversionMap, nStt ); const sal_uInt32 nExpandEnd = ModelToViewHelper::ConvertToViewPosition( pConversionMap, nEnd ); - if ( aExpandText.getLength() <= 0 ) + if ( aExpandText.isEmpty() ) { OSL_ENSURE(aExpandText.getLength() >= 0, "Node text expansion error: length < 0." ); return; diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 00c7b58e748a..f08cfa0ad176 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -699,7 +699,7 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext) pNd->RestoreMetadata(m_pMetadataUndoStart); } - if (m_sOld.getLength()) + if (!m_sOld.isEmpty()) { pNd->InsertText( m_sOld, aIdx ); } diff --git a/sw/source/core/unocore/XMLRangeHelper.cxx b/sw/source/core/unocore/XMLRangeHelper.cxx index e77b416a86c8..8b49a5ea7a60 100644 --- a/sw/source/core/unocore/XMLRangeHelper.cxx +++ b/sw/source/core/unocore/XMLRangeHelper.cxx @@ -287,7 +287,7 @@ bool lcl_getCellRangeAddressFromXMLString( sTableSecondName ); } if( bResult && - sTableSecondName.getLength() && + !sTableSecondName.isEmpty() && ! sTableSecondName.equals( rOutRange.aTableName )) bResult = false; } @@ -364,7 +364,7 @@ OUString getXMLStringFromCellRange( const CellRange & rRange ) ::rtl::OUStringBuffer aBuffer; - if( (rRange.aTableName).getLength()) + if( !rRange.aTableName.isEmpty()) { bool bNeedsEscaping = ( rRange.aTableName.indexOf( aQuote ) > -1 ); bool bNeedsQuoting = bNeedsEscaping || ( rRange.aTableName.indexOf( aSpace ) > -1 ); diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 551b083a13bc..9b335687ceba 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -244,7 +244,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) SwUnoInternalPaM aPam(*m_pImpl->m_pDoc); ::sw::XTextRangeToSwPaM(aPam, xTextRange); UnoActionContext aCont(m_pImpl->m_pDoc); - if (!m_pImpl->m_sMarkName.getLength()) + if (m_pImpl->m_sMarkName.isEmpty()) { m_pImpl->m_sMarkName = OUString(RTL_CONSTASCII_USTRINGPARAM("Bookmark")); } diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 048faf85bbef..6238767f910a 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -638,7 +638,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData // get sub-ranges and check that they all are from the very same table sal_Bool bOk = GetSubranges( aRangeRepresentation, aSubRanges, sal_True ); - if (!bOk && pDoc && aChartOleObjectName.getLength() ) + if (!bOk && pDoc && !aChartOleObjectName.isEmpty() ) { //try to correct the range here //work around wrong writer ranges ( see Issue 58464 ) @@ -667,7 +667,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData //thus the first row is missing and an invalid row at the end is added. //Therefore we need to shift the range one row up SwRangeDescriptor aDesc; - if (aRangeRepresentation.getLength() == 0) + if (aRangeRepresentation.isEmpty()) return xRes; // we cant handle this thus returning an empty references aRangeRepresentation = aRangeRepresentation.copy( 1 ); // get rid of '.' to have only the cell range left FillRangeDescriptor( aDesc, aRangeRepresentation ); @@ -1336,7 +1336,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume OUString aSortedCellRanges; for (sal_Int32 i = 0; i < nSortedRanges; ++i) { - if (aSortedCellRanges.getLength()) + if (!aSortedCellRanges.isEmpty()) aSortedCellRanges += OUString::valueOf( (sal_Unicode) ';'); aSortedCellRanges += pSortedRanges[i]; } @@ -1376,7 +1376,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume if (nLabelSeqLen > 0) // == 0 means no label sequence in use bFirstCellIsLabel = sal_True; // - OSL_ENSURE( aSortedCellRanges.getLength(), "CellRangeRepresentation missing" ); + OSL_ENSURE( !aSortedCellRanges.isEmpty(), "CellRangeRepresentation missing" ); OUString aBrokenCellRangeForExport( GetBrokenCellRangeForExport( aSortedCellRanges ) ); // aResult.realloc(5); @@ -1385,7 +1385,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume aResult[nProps++].Value <<= bFirstCellIsLabel; aResult[nProps ].Name = C2U("CellRangeRepresentation"); aResult[nProps++].Value <<= aSortedCellRanges; - if (0 != aBrokenCellRangeForExport.getLength()) + if (!aBrokenCellRangeForExport.isEmpty()) { aResult[nProps ].Name = C2U("BrokenCellRangeForExport"); aResult[nProps++].Value <<= aBrokenCellRangeForExport; @@ -1857,7 +1857,7 @@ rtl::OUString SAL_CALL SwChartDataProvider::convertRangeFromXML( const rtl::OUSt XMLRangeHelper::CellRange aCellRange( XMLRangeHelper::getCellRangeFromXMLString( aRange )); // check that there is only one table used in all ranges - if (aFirstFoundTable.getLength() == 0) + if (aFirstFoundTable.isEmpty()) aFirstFoundTable = aCellRange.aTableName; if (aCellRange.aTableName != aFirstFoundTable) throw lang::IllegalArgumentException(); diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 4996bd3114a5..3ea75523f9af 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -114,7 +114,7 @@ public: rtl::OUString SAL_CALL getCodeNameForObject( const uno::Reference< uno::XInterface >& xIf ) throw( uno::RuntimeException ) { // Initialise the code name - if ( msThisDocumentCodeName.getLength() == 0 ) + if ( msThisDocumentCodeName.isEmpty() ) { try { diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 47be88b4cf20..b4a5c6dd5e3b 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -786,9 +786,9 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, uno::Reference < io::XStream > xStream; uno::Reference < io::XInputStream > xInputStream; - if( !sFileName.getLength() ) + if( sFileName.isEmpty() ) aMediaDescriptor[comphelper::MediaDescriptor::PROP_URL()] >>= sFileName; - if( !sFileName.getLength() ) + if( sFileName.isEmpty() ) aMediaDescriptor[comphelper::MediaDescriptor::PROP_FILENAME()] >>= sFileName; aMediaDescriptor[comphelper::MediaDescriptor::PROP_INPUTSTREAM()] >>= xInputStream; aMediaDescriptor[comphelper::MediaDescriptor::PROP_STREAM()] >>= xStream; @@ -800,7 +800,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, if ( !xInputStream.is() && xStream.is() ) xInputStream = xStream->getInputStream(); - if(!pDocSh || (!sFileName.getLength() && !xInputStream.is())) + if(!pDocSh || (sFileName.isEmpty() && !xInputStream.is())) return; SfxObjectFactory& rFact = pDocSh->GetFactory(); @@ -833,7 +833,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, pMed = xReadStorage.is() ? new SfxMedium(xReadStorage, sBaseURL, 0 ) : new SfxMedium(sFileName, STREAM_READ, sal_True, 0, 0 ); - if( sBaseURL.getLength() ) + if( !sBaseURL.isEmpty() ) pMed->GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, sBaseURL ) ); SfxFilterMatcher aMatcher( rFact.GetFilterContainer()->GetName() ); @@ -864,9 +864,9 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, pMed = new SfxMedium(sFileName, STREAM_READ, sal_True, pFilter, 0); } } - if(sFilterOptions.getLength()) + if(!sFilterOptions.isEmpty()) pMed->GetItemSet()->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, sFilterOptions ) ); - if( sBaseURL.getLength()) + if(!sBaseURL.isEmpty()) pMed->GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, sBaseURL ) ); } @@ -883,7 +883,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, SwReader* pRdr; SfxItemSet* pSet = pMed->GetItemSet(); pSet->Put(SfxBoolItem(FN_API_CALL, sal_True)); - if(sPassword.getLength()) + if(!sPassword.isEmpty()) pSet->Put(SfxStringItem(SID_PASSWORD, sPassword)); Reader *pRead = pDocSh->StartConvertFrom( *pMed, &pRdr, 0, pUnoCrsr); if( pRead ) @@ -954,7 +954,7 @@ sal_Bool DocInsertStringSplitCR( { OSL_ENSURE( nIdx - nStartIdx >= 0, "index negative!" ); aTxt = rText.Copy( nStartIdx, nIdx - nStartIdx ); - if (aTxt.getLength() && + if (!aTxt.isEmpty() && !rDoc.InsertString( rNewCursor, aTxt, nInsertFlags )) { OSL_FAIL( "Doc->Insert(Str) failed." ); @@ -969,7 +969,7 @@ sal_Bool DocInsertStringSplitCR( nIdx = rText.Search( '\r', nStartIdx ); } aTxt = rText.Copy( nStartIdx ); - if (aTxt.getLength() && + if (!aTxt.isEmpty() && !rDoc.InsertString( rNewCursor, aTxt, nInsertFlags )) { OSL_FAIL( "Doc->Insert(Str) failed." ); diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 8bd69c19bfcf..3e1cb79e1a8e 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -335,7 +335,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) pNewDoc->DeleteAndJoin(aPam); aPam.DeleteMark(); SwFmtFtn aFootNote(m_pImpl->m_bIsEndnote); - if (m_pImpl->m_sLabel.getLength()) + if (!m_pImpl->m_sLabel.isEmpty()) { aFootNote.SetNumStr(m_pImpl->m_sLabel); } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index f4fd5d7a9d51..de9d4331f5f9 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1435,7 +1435,7 @@ SwXDocumentIndex::setName(const OUString& rName) throw (uno::RuntimeException) { SolarMutexGuard g; - if (!rName.getLength()) + if (rName.isEmpty()) { throw uno::RuntimeException(); } @@ -1805,7 +1805,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) break; case TOX_USER: { - if (!m_pImpl->m_sUserIndexName.getLength()) + if (m_pImpl->m_sUserIndexName.isEmpty()) { pTOXType = pDoc->GetTOXType( m_pImpl->m_eTOXType, 0 ); } @@ -1845,30 +1845,30 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) //which must now return sal_True ::sw::XTextRangeToSwPaM(aPam, xTextRange); SwTOXMark aMark (pTOXType); - if (m_pImpl->m_sAltText.getLength()) + if (!m_pImpl->m_sAltText.isEmpty()) { aMark.SetAlternativeText(m_pImpl->m_sAltText); } switch (m_pImpl->m_eTOXType) { case TOX_INDEX: - if (m_pImpl->m_sPrimaryKey.getLength()) + if (!m_pImpl->m_sPrimaryKey.isEmpty()) { aMark.SetPrimaryKey(m_pImpl->m_sPrimaryKey); } - if (m_pImpl->m_sSecondaryKey.getLength()) + if (!m_pImpl->m_sSecondaryKey.isEmpty()) { aMark.SetSecondaryKey(m_pImpl->m_sSecondaryKey); } - if (m_pImpl->m_sTextReading.getLength()) + if (!m_pImpl->m_sTextReading.isEmpty()) { aMark.SetTextReading(m_pImpl->m_sTextReading); } - if (m_pImpl->m_sPrimaryKeyReading.getLength()) + if (!m_pImpl->m_sPrimaryKeyReading.isEmpty()) { aMark.SetPrimaryKeyReading(m_pImpl->m_sPrimaryKeyReading); } - if (m_pImpl->m_sSecondaryKeyReading.getLength()) + if (!m_pImpl->m_sSecondaryKeyReading.isEmpty()) { aMark.SetSecondaryKeyReading(m_pImpl->m_sSecondaryKeyReading); } @@ -2850,7 +2850,7 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, throw lang::IllegalArgumentException(); } aToken.cTabFillChar = - (sFillChar.getLength()) ? sFillChar[0] : ' '; + sFillChar.isEmpty() ? ' ' : sFillChar[0]; } else if (pProperties[j].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Text"))) diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 6d6f3c1ff37b..3262b35f7a09 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -885,7 +885,7 @@ throw (uno::RuntimeException) m_pImpl->m_rDoc.DeleteAndJoin(aCursor); } - if (rText.getLength()) + if (!rText.isEmpty()) { SwUnoCursorHelper::DocInsertStringSplitCR( m_pImpl->m_rDoc, aCursor, rText, bForceExpandHints); @@ -1727,7 +1727,7 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString) { pDoc->DeleteAndJoin(rCursor); } - if (rString.getLength()) + if (!rString.isEmpty()) { String aText(rString); const bool bSuccess( SwUnoCursorHelper::DocInsertStringSplitCR( diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index a9cbe42f4bf0..c4e9d6144633 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -331,7 +331,7 @@ SwXParagraph::attachToText(SwXText & rParent, SwTxtNode & rTxtNode) rTxtNode.Add(m_pImpl.get()); rTxtNode.SetXParagraph(uno::Reference<text::XTextContent>(this)); m_pImpl->m_xParentText = &rParent; - if (m_pImpl->m_sText.getLength()) + if (!m_pImpl->m_sText.isEmpty()) { try { setString(m_pImpl->m_sText); } catch(...){} diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index fececdb91365..977730e83641 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -448,7 +448,7 @@ void SwXRedline::setPropertyValue( const OUString& rPropertyName, const uno::Any { OSL_FAIL("currently not available"); OUString sTmp; aValue >>= sTmp; - if(!sTmp.getLength()) + if(sTmp.isEmpty()) throw lang::IllegalArgumentException(); } else if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_SUCCESSOR_DATA))) diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 836c6790111d..bfb786f0707d 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -299,14 +299,14 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) UnoActionContext aCont(pDoc); pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_INSSECTION, NULL ); - if (!m_pImpl->m_sName.getLength()) + if (m_pImpl->m_sName.isEmpty()) { m_pImpl->m_sName = C2U("TextSection"); } SectionType eType = (m_pImpl->m_pProps->m_bDDE) ? DDE_LINK_SECTION - : ((m_pImpl->m_pProps->m_sLinkFileName.getLength() || - m_pImpl->m_pProps->m_sSectionRegion.getLength()) + : ((!m_pImpl->m_pProps->m_sLinkFileName.isEmpty() || + !m_pImpl->m_pProps->m_sSectionRegion.isEmpty()) ? FILE_LINK_SECTION : CONTENT_SECTION); // index header section? if (m_pImpl->m_bIndexHeader) @@ -405,7 +405,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) // XML import must hide sections depending on their old // condition status - if (m_pImpl->m_pProps->m_sCondition.getLength() != 0) + if (!m_pImpl->m_pProps->m_sCondition.isEmpty()) { pRet->SetCondHidden(m_pImpl->m_pProps->m_bCondHidden); } @@ -690,12 +690,12 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, else { if (pSectionData->GetType() != FILE_LINK_SECTION && - aLink.FileURL.getLength()) + !aLink.FileURL.isEmpty()) { pSectionData->SetType(FILE_LINK_SECTION); } ::rtl::OUStringBuffer sFileNameBuf; - if (aLink.FileURL.getLength()) + if (!aLink.FileURL.isEmpty()) { sFileNameBuf.append( URIHelper::SmartRel2Abs( pFmt->GetDoc()->GetDocShell()->GetMedium() @@ -730,7 +730,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, else { if (pSectionData->GetType() != FILE_LINK_SECTION && - sLink.getLength()) + !sLink.isEmpty()) { pSectionData->SetType(FILE_LINK_SECTION); } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 76cf9c8cf488..d347c0cf93c5 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1925,7 +1925,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex( { // #i93725# // do not accept "empty" font - if ( pDesc->Name.getLength() > 0 ) + if ( !pDesc->Name.isEmpty() ) { Font aFont; SvxUnoFontDescriptor::ConvertToFont( *pDesc, aFont ); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 9b8b4959e67c..5e6375458429 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -380,7 +380,7 @@ void SwXStyleFamilies::loadStylesFromURL(const OUString& rURL, sal_Bool bLoadStyleOverwrite = sal_True; sal_Bool bLoadStyleNumbering = sal_True; sal_Bool bLoadStyleFrame = sal_True; - if(IsValid() && rURL.getLength()) + if(IsValid() && !rURL.isEmpty()) { const uno::Any* pVal; int nCount = aOptions.getLength(); @@ -1974,7 +1974,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, { OUString sName; rValue >>= sName; - SwRegisterItem aReg( sName.getLength() != 0); + SwRegisterItem aReg( !sName.isEmpty() ); aReg.SetWhich(SID_SWREGISTER_MODE); rBase.GetItemSet().Put(aReg); String aString; @@ -2000,7 +2000,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, SwStyleNameMapper::FillUIName(sTmp, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True ); pRuby->SetCharFmtName( sTmp ); pRuby->SetCharFmtId( 0 ); - if(sTmp.getLength()) + if(!sTmp.isEmpty()) { sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( sTmp, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); pRuby->SetCharFmtId(nId); @@ -2063,7 +2063,7 @@ put_itemset: OUString sNewNumberingRuleName; rValue >>= sNewNumberingRuleName; String sTmp( sNewNumberingRuleName ); - if ( sNewNumberingRuleName.getLength() == 0 || + if ( sNewNumberingRuleName.isEmpty() || sTmp != pDoc->GetOutlineNumRule()->GetName() ) { rBase.mxNewBase->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 42cf9b21c993..a928d15b3a62 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -709,7 +709,7 @@ void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt, double lcl_getValue( SwXCell &rCell ) { double fRet; - if(rCell.IsValid() && rCell.getString().getLength()!=0) + if(rCell.IsValid() && !rCell.getString().isEmpty()) fRet = rCell.pBox->GetFrmFmt()->GetTblBoxValue().GetValue(); else ::rtl::math::setNan( &fRet ); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 180dd3738551..db82b1815f89 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1404,7 +1404,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) pCursor->MovePara( fnParaCurr, fnParaEnd ); m_pImpl->m_pDoc->DontExpandFmt( *pCursor->Start() ); - if (rText.getLength()) + if (!rText.isEmpty()) { const xub_StrLen nContentPos = pCursor->GetPoint()->nContent.GetIndex(); SwUnoCursorHelper::DocInsertStringSplitCR( |