sc/source/core/data/documen3.cxx | 2 +- sc/source/core/data/postit.cxx | 4 ++-- sc/source/core/tool/compiler.cxx | 2 +- sc/source/core/tool/dbdata.cxx | 6 +++--- sc/source/core/tool/interpr2.cxx | 2 +- sc/source/filter/oox/pagesettings.cxx | 2 +- sc/source/filter/oox/querytablebuffer.cxx | 4 ++-- sc/source/filter/xml/XMLStylesExportHelper.cxx | 2 +- sc/source/filter/xml/xmlexprt.cxx | 14 +++++++------- sc/source/filter/xml/xmltabi.cxx | 2 +- sc/source/ui/docshell/docsh.cxx | 4 ++-- sc/source/ui/unoobj/chart2uno.cxx | 4 ++-- sc/source/ui/vba/vbafont.cxx | 2 +- sc/source/ui/view/dbfunc3.cxx | 2 +- 14 files changed, 26 insertions(+), 26 deletions(-)
New commits: commit f042e22f535e3143332eb788f908f06900eeb40d Author: Jelle van der Waa <je...@vdwaa.nl> Date: Mon Jun 17 16:56:12 2013 +0200 fdo#43460 sc: use isEmpty() Change-Id: I062570091ebea0ad30f09b0358ab664a3ff949ef Reviewed-on: https://gerrit.libreoffice.org/4316 Reviewed-by: Fridrich Strba <fridr...@documentfoundation.org> Tested-by: Fridrich Strba <fridr...@documentfoundation.org> diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index a49ea83..e10a43f 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -1941,7 +1941,7 @@ void ScDocument::DoMergeContents( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, aCellStr = GetString(nCol, nRow, nTab); if (!aCellStr.isEmpty()) { - if (aTotal.getLength()) + if (!aTotal.isEmpty()) aTotal.append(' '); aTotal.append(aCellStr); } diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 3c03746..0e0cde3 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -777,13 +777,13 @@ SdrCaptionObj* ScNoteUtil::CreateTempCaption( const ScPostIt* pNote = rDoc.GetNotes(rPos.Tab())->findByAddress( rPos ); if( pNote && !pNote->IsCaptionShown() ) { - if( aBuffer.getLength() > 0 ) + if( !aBuffer.isEmpty() ) aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\n--------\n" ) ).append( pNote->GetText() ); pNoteCaption = pNote->GetOrCreateCaption( rPos ); } // create a caption if any text exists - if( !pNoteCaption && (aBuffer.getLength() == 0) ) + if( !pNoteCaption && aBuffer.isEmpty() ) return 0; // prepare visible rectangle (add default distance to all borders) diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index bdce061..3d6806c 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -5101,7 +5101,7 @@ void ScCompiler::CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* _pT default: ; // nothing } - if ( aBuffer.getLength() ) + if ( !aBuffer.isEmpty() ) rBuffer.append(aBuffer.makeStringAndClear()); else rBuffer.append(ScGlobal::GetRscString(STR_NO_NAME_REF)); diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 163e6fe..0b60852 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -234,19 +234,19 @@ OUString ScDBData::GetOperations() const if (mpSortParam->maKeyState[0].bDoSort) { - if (aBuf.getLength()) + if (!aBuf.isEmpty()) aBuf.appendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); aBuf.append(ScGlobal::GetRscString(STR_OPERATION_SORT)); } if (mpSubTotal->bGroupActive[0] && !mpSubTotal->bRemoveOnly) { - if (aBuf.getLength()) + if (!aBuf.isEmpty()) aBuf.appendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); aBuf.append(ScGlobal::GetRscString(STR_OPERATION_SUBTOTAL)); } - if (!aBuf.getLength()) + if (aBuf.isEmpty()) aBuf.append(ScGlobal::GetRscString(STR_OPERATION_NONE)); return aBuf.makeStringAndClear(); diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index b5e8ee8..40a82f1 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -3085,7 +3085,7 @@ void ScInterpreter::ScBahtText() aText.insert(0, aBlock.makeStringAndClear()); } - if (aText.getLength() > 0) + if (!aText.isEmpty()) aText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_BAHT) ); // generate text for Satang value diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx index fd90cc5..9e9f941 100644 --- a/sc/source/filter/oox/pagesettings.cxx +++ b/sc/source/filter/oox/pagesettings.cxx @@ -786,7 +786,7 @@ void HeaderFooterParser::setAttributes() void HeaderFooterParser::appendText() { - if( maBuffer.getLength() > 0 ) + if( !maBuffer.isEmpty() ) { getEndPos()->gotoEnd( sal_False ); getEndPos()->setString( maBuffer.makeStringAndClear() ); diff --git a/sc/source/filter/oox/querytablebuffer.cxx b/sc/source/filter/oox/querytablebuffer.cxx index d80d06d..cf42cc5 100644 --- a/sc/source/filter/oox/querytablebuffer.cxx +++ b/sc/source/filter/oox/querytablebuffer.cxx @@ -93,7 +93,7 @@ void lclAppendWebQueryTableName( OUStringBuffer& rTables, const OUString& rTable { if( !rTableName.isEmpty() ) { - if( rTables.getLength() > 0 ) + if( !rTables.isEmpty() ) rTables.append( sal_Unicode( ';' ) ); rTables.appendAscii( RTL_CONSTASCII_STRINGPARAM( "HTML__" ) ).append( rTableName ); } @@ -103,7 +103,7 @@ void lclAppendWebQueryTableIndex( OUStringBuffer& rTables, sal_Int32 nTableIndex { if( nTableIndex > 0 ) { - if( rTables.getLength() > 0 ) + if( !rTables.isEmpty() ) rTables.append( sal_Unicode( ';' ) ); rTables.appendAscii( RTL_CONSTASCII_STRINGPARAM( "HTML_" ) ).append( nTableIndex ); } diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 6f87529..882948d 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -329,7 +329,7 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport, sTemp.append(sText[i]); ++i; } - if (sTemp.getLength()) + if (!sTemp.isEmpty()) { SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, true, false); rExport.GetTextParagraphExport()->exportText(sTemp.makeStringAndClear(), bPrevCharWasSpace); diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index ac5d4b3..3c4a2b1 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1515,7 +1515,7 @@ void ScXMLExport::SetBodyAttributes() } } ::sax::Converter::encodeBase64(aBuffer, aPassHash); - if (aBuffer.getLength()) + if (!aBuffer.isEmpty()) { AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); if ( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) @@ -2667,7 +2667,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe ::sax::Converter::encodeBase64(aBuffer, aHash); eHashUsed = PASSHASH_XL; } - if (aBuffer.getLength()) + if (!aBuffer.isEmpty()) { AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); if ( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) @@ -3746,19 +3746,19 @@ void ScXMLExport::WriteNamedRange(ScRangeName* pRangeName) sBufferRangeType.append(GetXMLToken(XML_REPEAT_COLUMN)); if ((nRangeType & sheet::NamedRangeFlag::ROW_HEADER) == sheet::NamedRangeFlag::ROW_HEADER) { - if (sBufferRangeType.getLength() > 0) + if (!sBufferRangeType.isEmpty()) sBufferRangeType.appendAscii(" "); sBufferRangeType.append(GetXMLToken(XML_REPEAT_ROW)); } if ((nRangeType & sheet::NamedRangeFlag::FILTER_CRITERIA) == sheet::NamedRangeFlag::FILTER_CRITERIA) { - if (sBufferRangeType.getLength() > 0) + if (!sBufferRangeType.isEmpty()) sBufferRangeType.appendAscii(" "); sBufferRangeType.append(GetXMLToken(XML_FILTER)); } if ((nRangeType & sheet::NamedRangeFlag::PRINT_AREA) == sheet::NamedRangeFlag::PRINT_AREA) { - if (sBufferRangeType.getLength() > 0) + if (!sBufferRangeType.isEmpty()) sBufferRangeType.appendAscii(" "); sBufferRangeType.append(GetXMLToken(XML_PRINT_RANGE)); } @@ -4498,7 +4498,7 @@ void ScXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& { ::sax::Converter::encodeBase64(aTrackedChangesKey, GetDocument()->GetChangeTrack()->GetProtection()); - if (aTrackedChangesKey.getLength()) + if (!aTrackedChangesKey.isEmpty()) ++nPropsToAdd; } @@ -4522,7 +4522,7 @@ void ScXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& { sal_Int32 nCount(rProps.getLength()); rProps.realloc(nCount + nPropsToAdd); - if (aTrackedChangesKey.getLength()) + if (!aTrackedChangesKey.isEmpty()) { rProps[nCount].Name = OUString("TrackedChangesProtectionKey"); rProps[nCount].Value <<= aTrackedChangesKey.makeStringAndClear(); diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index a7f014c..1069f47 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -122,7 +122,7 @@ static bool lcl_isExternalRefCache(const OUString& rName, OUString& rUrl, OUStri if (bInUrl) return false; - if (aTabNameBuf.getLength() == 0) + if (aTabNameBuf.isEmpty()) return false; rExtTabName = aTabNameBuf.makeStringAndClear(); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index c3c7705..c38b397 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -990,14 +990,14 @@ static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLa const sal_Unicode c = p[i]; if (c == sal_Unicode(' ')) { - if (aBuf.getLength()) + if (!aBuf.isEmpty()) aTokens.push_back( aBuf.makeStringAndClear() ); } else aBuf.append(c); } - if (aBuf.getLength()) + if (!aBuf.isEmpty()) aTokens.push_back( aBuf.makeStringAndClear() ); rLang = LanguageType( 0 ); diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 440f074..635fa1a 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -126,7 +126,7 @@ OUString lcl_createTableNumberList( const ::std::list< SCTAB > & rTableList ) OUStringBuffer aBuffer; ::std::for_each( rTableList.begin(), rTableList.end(), lcl_appendTableNumber( aBuffer )); // remove last trailing ' ' - if( aBuffer.getLength() > 0 ) + if( !aBuffer.isEmpty() ) aBuffer.setLength( aBuffer.getLength() - 1 ); return aBuffer.makeStringAndClear(); } @@ -2277,7 +2277,7 @@ OUString SAL_CALL ScChart2DataProvider::convertRangeFromXML( const OUString& sXM if ( aUIString.GetChar(0) == (sal_Unicode) '.' ) aUIString.Erase( 0, 1 ); - if( sRet.getLength() ) + if( !sRet.isEmpty() ) sRet.append( (sal_Unicode) ';' ); sRet.append( aUIString ); } diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index 8eceec2..1f6ce31 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -336,7 +336,7 @@ ScVbaFont::getFontStyle() throw ( uno::RuntimeException ) getItalic() >>= bValue; if( bValue ) { - if( aStyles.getLength() ) + if( !aStyles.isEmpty() ) aStyles.appendAscii(" "); aStyles.appendAscii("Italic"); } diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 96a08ce..622dbcc 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -1320,7 +1320,7 @@ static OUString lcl_replaceMemberNameInSubtotal(const OUString& rSubtotal, const aWordBuf.append(c); } - if (aWordBuf.getLength() > 0) + if (!aWordBuf.isEmpty()) { OUString aWord = aWordBuf.makeStringAndClear(); if (aWord.equals(rMemberName)) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits