summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2013-06-17 16:56:12 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-06-28 12:08:40 +0000
commitf042e22f535e3143332eb788f908f06900eeb40d (patch)
tree656818a3df0bd400b77bafee243a6c75c7892efb /sc
parent9722cd44beb3af9c68c5a3904127dc15c3c0cff1 (diff)
fdo#43460 sc: use isEmpty()
Change-Id: I062570091ebea0ad30f09b0358ab664a3ff949ef Reviewed-on: https://gerrit.libreoffice.org/4316 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen3.cxx2
-rw-r--r--sc/source/core/data/postit.cxx4
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/core/tool/dbdata.cxx6
-rw-r--r--sc/source/core/tool/interpr2.cxx2
-rw-r--r--sc/source/filter/oox/pagesettings.cxx2
-rw-r--r--sc/source/filter/oox/querytablebuffer.cxx4
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx2
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx14
-rw-r--r--sc/source/filter/xml/xmltabi.cxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx4
-rw-r--r--sc/source/ui/vba/vbafont.cxx2
-rw-r--r--sc/source/ui/view/dbfunc3.cxx2
14 files changed, 26 insertions, 26 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index a49ea8344914..e10a43ffba9a 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 3c03746db1d2..0e0cde3cc66f 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 bdce061e3fd1..3d6806cfbfcf 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 163e6feba151..0b60852fc3e4 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 b5e8ee8454db..40a82f18450d 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 fd90cc52477f..9e9f9415a981 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 d80d06d2a3fa..cf42cc504763 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 6f87529df254..882948dbce9a 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 ac5d4b33e5c2..3c4a2b10f707 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 a7f014cef506..1069f47605fe 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 c3c770513048..c38b3973af7a 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 440f074fc3e6..635fa1af9713 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 8eceec21ba28..1f6ce312547b 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 96a08ce284f5..622dbcc73ee9 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))