diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-05-01 00:53:03 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-02 09:53:48 +0200 |
commit | 855f52ead7fa361b6a73105d1f0086559a8ed5b6 (patch) | |
tree | 042fb792f2c64666ef5fa01436ccafd728860eca /xmloff/source/chart | |
parent | 0c434b06a3792a6429fbe718a0231c48597c1ff5 (diff) |
Use hasElements to check Sequence emptiness in [v-x]*
Similar to clang-tidy readability-container-size-empty
Change-Id: I71e7af4ac3043d8d40922e99f8a4798f0993294c
Reviewed-on: https://gerrit.libreoffice.org/71603
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/chart')
-rw-r--r-- | xmloff/source/chart/SchXMLAxisContext.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLChartContext.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 14 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLImport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLTableContext.cxx | 6 |
5 files changed, 16 insertions, 16 deletions
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx index 29992bb8ca2e..f55877609937 100644 --- a/xmloff/source/chart/SchXMLAxisContext.cxx +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -529,7 +529,7 @@ void SchXMLAxisContext::CreateAxis() if( xCooSysCnt.is() ) { uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); - if( aCooSysSeq.getLength() ) + if( aCooSysSeq.hasElements() ) { bool bSwapXandYAxis = false; Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); @@ -732,7 +732,7 @@ void SchXMLAxisContext::CorrectAxisPositions( const Reference< chart2::XChartDoc { Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xNewDoc->getFirstDiagram(), uno::UNO_QUERY_THROW ); uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); - if( aCooSysSeq.getLength() ) + if( aCooSysSeq.hasElements() ) { Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); if( xCooSys.is() ) diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index b7f0a2ff8087..7c3d355f9c64 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -93,7 +93,7 @@ void lcl_MoveDataToCandleStickSeries( { uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aLabeledSeq( xDataSource->getDataSequences()); - if( aLabeledSeq.getLength()) + if( aLabeledSeq.hasElements()) { lcl_setRoleAtLabeledSequence( aLabeledSeq[0], rRole ); @@ -121,7 +121,7 @@ void lcl_setRoleAtFirstSequence( if( xSource.is()) { uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSeq( xSource->getDataSequences()); - if( aSeq.getLength()) + if( aSeq.hasElements()) lcl_setRoleAtLabeledSequence( aSeq[0], rRole ); } } @@ -156,7 +156,7 @@ void lcl_removeEmptyChartTypeGroups( const uno::Reference< chart2::XChartDocumen for( sal_Int32 nJ=aCTSeq.getLength(); nJ-- && (nRemainingGroups > 1); ) { uno::Reference< chart2::XDataSeriesContainer > xDSCnt( aCTSeq[nJ], uno::UNO_QUERY_THROW ); - if( xDSCnt->getDataSeries().getLength() == 0 ) + if( !xDSCnt->getDataSeries().hasElements() ) { // note: iterator stays valid as we have a local sequence xCTCnt->removeChartType( aCTSeq[nJ] ); diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 337864d809fb..6507cb91b926 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -665,7 +665,7 @@ bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSeque try { xProp->getPropertyValue("HiddenValues") >>= aHiddenValues; - if( !aHiddenValues.getLength() ) + if( !aHiddenValues.hasElements() ) return true; } catch( const uno::Exception& ) @@ -673,7 +673,7 @@ bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSeque return true; } } - return xDataSequence->getData().getLength(); + return xDataSequence->getData().hasElements(); } typedef vector< OUString > tStringVector; @@ -1230,7 +1230,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument > } //column-mapping or row-mapping - if( maSequenceMapping.getLength() ) + if( maSequenceMapping.hasElements() ) { enum XMLTokenEnum eTransToken = ::xmloff::token::XML_ROW_MAPPING; if( mbRowSourceColumns ) @@ -1633,7 +1633,7 @@ void SchXMLExportHelper_Impl::exportTable() if( nC < nComplexCount ) { const Sequence< uno::Any >& rComplexLabel = rComplexColumnDescriptions[nC]; - if( rComplexLabel.getLength()>0 ) + if( rComplexLabel.hasElements() ) { double fValue=0.0; if( rComplexLabel[0] >>=fValue ) @@ -1688,7 +1688,7 @@ void SchXMLExportHelper_Impl::exportTable() if( nC < nComplexCount ) { const Sequence< uno::Any >& rComplexLabel = rComplexRowDescriptions[nC]; - if( rComplexLabel.getLength()>0 ) + if( rComplexLabel.hasElements() ) { double fValue=0.0; if( rComplexLabel[0] >>=fValue ) @@ -1762,7 +1762,7 @@ Reference< chart2::XCoordinateSystem > lcl_getCooSys( const Reference< chart2::X if(xCooSysCnt.is()) { Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); - if(aCooSysSeq.getLength()>0) + if(aCooSysSeq.hasElements()) xCooSys = aCooSysSeq[0]; } return xCooSys; @@ -2493,7 +2493,7 @@ namespace } else { - if( !aData.getLength() ) + if( !aData.hasElements() ) aData = xDataSequence->getData(); OUString aString; sal_Int32 nCount = aData.getLength(); diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 57e4e5fe05a7..bc3219ee0115 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -454,7 +454,7 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries( uno::UNO_QUERY ); if( xCurrentType.is()) { - if( bPushLastChartType && aChartTypes.getLength()) + if( bPushLastChartType && aChartTypes.hasElements()) { sal_Int32 nIndex( aChartTypes.getLength() - 1 ); aChartTypes.realloc( aChartTypes.getLength() + 1 ); diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index 9dceca28faed..cb0423c92976 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -379,7 +379,7 @@ void SchXMLTableContext::EndElement() void SchXMLTableContext::setRowPermutation( const uno::Sequence< sal_Int32 > & rPermutation ) { maRowPermutation = rPermutation; - mbHasRowPermutation = ( rPermutation.getLength() > 0 ); + mbHasRowPermutation = rPermutation.hasElements(); if( mbHasRowPermutation && mbHasColumnPermutation ) { @@ -391,7 +391,7 @@ void SchXMLTableContext::setRowPermutation( const uno::Sequence< sal_Int32 > & r void SchXMLTableContext::setColumnPermutation( const uno::Sequence< sal_Int32 > & rPermutation ) { maColumnPermutation = rPermutation; - mbHasColumnPermutation = ( rPermutation.getLength() > 0 ); + mbHasColumnPermutation = rPermutation.hasElements(); if( mbHasColumnPermutation && mbHasRowPermutation ) { @@ -716,7 +716,7 @@ static void lcl_ApplyCellToComplexLabel( const SchXMLCell& rCell, Sequence< uno: rComplexLabel.realloc(1); rComplexLabel[0] <<= rCell.aString; } - else if( rCell.aComplexString.getLength() && rCell.eType == SCH_CELL_TYPE_COMPLEX_STRING ) + else if( rCell.aComplexString.hasElements() && rCell.eType == SCH_CELL_TYPE_COMPLEX_STRING ) { sal_Int32 nCount = rCell.aComplexString.getLength(); rComplexLabel.realloc( nCount ); |