summaryrefslogtreecommitdiff
path: root/vbahelper/source/msforms
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-01 00:53:03 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-02 09:53:48 +0200
commit855f52ead7fa361b6a73105d1f0086559a8ed5b6 (patch)
tree042fb792f2c64666ef5fa01436ccafd728860eca /vbahelper/source/msforms
parent0c434b06a3792a6429fbe718a0231c48597c1ff5 (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 'vbahelper/source/msforms')
-rw-r--r--vbahelper/source/msforms/vbacombobox.cxx4
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx2
-rw-r--r--vbahelper/source/msforms/vbalistbox.cxx4
3 files changed, 5 insertions, 5 deletions
diff --git a/vbahelper/source/msforms/vbacombobox.cxx b/vbahelper/source/msforms/vbacombobox.cxx
index 78ceafb5ea88..851cee0a4098 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -93,7 +93,7 @@ ScVbaComboBox::getListIndex()
m_xProps->getPropertyValue( "StringItemList" ) >>= sItems;
// should really return the item that has focus regardless of
// it been selected
- if ( sItems.getLength() > 0 )
+ if ( sItems.hasElements() )
{
OUString sText = getText();
sal_Int32 nLen = sItems.getLength();
@@ -106,7 +106,7 @@ ScVbaComboBox::getListIndex()
}
}
- }
+ }
SAL_INFO("vbahelper", "getListIndex returning -1" );
return uno::makeAny( sal_Int32( -1 ) );
}
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 99c6b41fea33..d33916f8d5af 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -538,7 +538,7 @@ void SAL_CALL ScVbaControl::fireEvent( const script::ScriptEvent& rEvt )
uno::Reference< uno::XInterface > xIf( xControlShape->getControl(), uno::UNO_QUERY_THROW );
evt.ScriptCode = xNameQuery->getCodeNameForObject( xIf );
// handle if we passed in our own arguments
- if ( !rEvt.Arguments.getLength() )
+ if ( !rEvt.Arguments.hasElements() )
evt.Arguments[ 0 ] <<= aEvt;
xScriptListener->firing( evt );
}
diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx
index da919b42dad1..13c878440193 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -47,7 +47,7 @@ ScVbaListBox::getListIndex()
{
uno::Sequence< sal_Int16 > sSelection;
m_xProps->getPropertyValue( "SelectedItems" ) >>= sSelection;
- if ( sSelection.getLength() == 0 )
+ if ( !sSelection.hasElements() )
return uno::Any( sal_Int32( -1 ) );
return uno::Any( sSelection[ 0 ] );
}
@@ -62,7 +62,7 @@ ScVbaListBox::getValue()
if( getMultiSelect() )
throw uno::RuntimeException( "Attribute use invalid." );
uno::Any aRet;
- if ( sSelection.getLength() )
+ if ( sSelection.hasElements() )
aRet <<= sItems[ sSelection[ 0 ] ];
return aRet;
}