From 855f52ead7fa361b6a73105d1f0086559a8ed5b6 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Wed, 1 May 2019 00:53:03 +0300 Subject: 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 --- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 10 +++++----- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 48acefb63f14..186dc6923f61 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -89,7 +89,7 @@ void ElementDescriptor::readMultiPageModel( StyleBag * all_styles ) readEvents(); uno::Reference< container::XNameContainer > xPagesContainer( _xProps, uno::UNO_QUERY ); - if ( xPagesContainer.is() && xPagesContainer->getElementNames().getLength() ) + if ( xPagesContainer.is() && xPagesContainer->getElementNames().hasElements() ) { ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument ); pElem->readBullitinBoard( all_styles ); @@ -124,7 +124,7 @@ void ElementDescriptor::readFrameModel( StyleBag * all_styles ) addSubElement( title ); } uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY ); - if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() ) + if ( xControlContainer.is() && xControlContainer->getElementNames().hasElements() ) { ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument ); pElem->readBullitinBoard( all_styles ); @@ -154,7 +154,7 @@ void ElementDescriptor::readPageModel( StyleBag * all_styles ) readDefaults(); readStringAttr( "Title", XMLNS_DIALOGS_PREFIX ":title" ); uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY ); - if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() ) + if ( xControlContainer.is() && xControlContainer->getElementNames().hasElements() ) { ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument ); pElem->readBullitinBoard( all_styles ); @@ -314,7 +314,7 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles ) // string item list Sequence< OUString > itemValues; - if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.getLength() > 0) + if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.hasElements()) { ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument ); @@ -362,7 +362,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles ) readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":source-cell-range" ); // string item list Sequence< OUString > itemValues; - if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.getLength() > 0) + if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.hasElements()) { ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument ); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index 82cf6eca2116..9341952eef35 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -1397,7 +1397,7 @@ void exportDialogModel( // dump out stylebag all_styles.dump( xOut ); - if ( xDialogModel->getElementNames().getLength() ) + if ( xDialogModel->getElementNames().hasElements() ) { // open up bulletinboard OUString aBBoardName( XMLNS_DIALOGS_PREFIX ":bulletinboard" ); -- cgit