summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-03 19:51:47 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-12 14:18:12 +0200
commit038e4b3b1e10d072b432cb06234521ae9a262a70 (patch)
tree6fb8087fd6a11fea6440dae91e8419043ad5f784 /sc/source/ui/unoobj
parent7bc6a7187c26690c64acb397e68d921be71e362e (diff)
Use hasElements to check Sequence emptiness in sax..sdext
Similar to clang-tidy readability-container-size-empty Change-Id: If6a567708d3c59355d54933fad23c85195846624 Reviewed-on: https://gerrit.libreoffice.org/71763 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx2
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx8
-rw-r--r--sc/source/ui/unoobj/docuno.cxx2
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx8
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx2
5 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 0c726ab498af..c51eb115b0aa 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -5051,7 +5051,7 @@ void SAL_CALL ScCellRangeObj::setArrayTokens( const uno::Sequence<sheet::Formula
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- if ( rTokens.getLength() )
+ if ( rTokens.hasElements() )
{
if ( ScTableSheetObj::getImplementation( static_cast<cppu::OWeakObject*>(this) ) )
{
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index a7b20ce1e03c..ea575923bd68 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1521,7 +1521,7 @@ ScChart2DataProvider::createDataSource(
}
uno::Reference< chart2::data::XLabeledDataSequence > xChartSeries = lcl_createLabeledDataSequenceFromTokens(
std::move(aValueTokens), std::move(aLabelTokens), m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transferred!
- if ( xChartSeries.is() && xChartSeries->getValues().is() && xChartSeries->getValues()->getData().getLength() )
+ if ( xChartSeries.is() && xChartSeries->getValues().is() && xChartSeries->getValues()->getData().hasElements() )
{
aSeqs.push_back( xChartSeries );
}
@@ -2031,7 +2031,7 @@ uno::Reference< sheet::XRangeSelection > SAL_CALL ScChart2DataProvider::getRange
sal_Bool SAL_CALL ScChart2DataProvider::createDataSequenceByFormulaTokensPossible(
const Sequence<sheet::FormulaToken>& aTokens )
{
- if (aTokens.getLength() <= 0)
+ if (!aTokens.hasElements())
return false;
ScTokenArray aCode;
@@ -2089,7 +2089,7 @@ ScChart2DataProvider::createDataSequenceByFormulaTokens(
const Sequence<sheet::FormulaToken>& aTokens )
{
uno::Reference<chart2::data::XDataSequence> xResult;
- if (aTokens.getLength() <= 0)
+ if (!aTokens.hasElements())
return xResult;
ScTokenArray aCode;
@@ -2875,7 +2875,7 @@ uno::Sequence< uno::Any> SAL_CALL ScChart2DataSequence::getData()
BuildDataCache();
- if (!m_aMixedDataCache.getLength())
+ if (!m_aMixedDataCache.hasElements())
{
// Build a cache for the 1st time...
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index ae2d063fcfcb..7443bf3ba018 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2886,7 +2886,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstanceWithArguments
SolarMutexGuard aGuard;
uno::Reference<uno::XInterface> xInt(create(ServiceSpecifier, &aArgs));
- if ( aArgs.getLength() )
+ if ( aArgs.hasElements() )
{
// used only for cell value binding so far - it can be initialized after creating
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 40af3ba2d59b..4cd31ca6aae9 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -214,14 +214,14 @@ void ScTableConditionalFormat::FillFormat( ScConditionalFormat& rFormat,
if ( !aData.maPosStr.isEmpty() )
pCoreEntry->SetSrcString( aData.maPosStr );
- if ( aData.maTokens1.getLength() )
+ if ( aData.maTokens1.hasElements() )
{
ScTokenArray aTokenArray;
if ( ScTokenConversion::ConvertToTokenArray(*pDoc, aTokenArray, aData.maTokens1) )
pCoreEntry->SetFormula1(aTokenArray);
}
- if ( aData.maTokens2.getLength() )
+ if ( aData.maTokens2.hasElements() )
{
ScTokenArray aTokenArray;
if ( ScTokenConversion::ConvertToTokenArray(*pDoc, aTokenArray, aData.maTokens2) )
@@ -634,14 +634,14 @@ ScValidationData* ScTableValidationObj::CreateValidationData( ScDocument* pDoc,
pRet->SetIgnoreBlank(bIgnoreBlank);
pRet->SetListType(nShowList);
- if ( aTokens1.getLength() )
+ if ( aTokens1.hasElements() )
{
ScTokenArray aTokenArray;
if ( ScTokenConversion::ConvertToTokenArray(*pDoc, aTokenArray, aTokens1) )
pRet->SetFormula1(aTokenArray);
}
- if ( aTokens2.getLength() )
+ if ( aTokens2.hasElements() )
{
ScTokenArray aTokenArray;
if ( ScTokenConversion::ConvertToTokenArray(*pDoc, aTokenArray, aTokens2) )
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index c4493df34536..eec400c28695 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -1592,7 +1592,7 @@ sal_Bool SAL_CALL ScExternalDocLinkObj::hasElements()
SolarMutexGuard aGuard;
// #i116940# be consistent with getByName: count only table names which have a cache already
- return ( getElementNames().getLength() > 0 );
+ return getElementNames().hasElements();
}
sal_Int32 SAL_CALL ScExternalDocLinkObj::getTokenIndex()