summaryrefslogtreecommitdiff
path: root/forms/source/component
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-04 17:06:38 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-31 16:10:17 +0200
commit966f40eecfc60f20c309bc2477149442d753763a (patch)
treeed72f7b3d2fe609696834d47da120eeb4bd1460c /forms/source/component
parent4830a1bae89a8ed60696503e315ffd42c70dff74 (diff)
Use hasElements to check Sequence emptiness in [e-i]*
Similar to clang-tidy readability-container-size-empty Change-Id: I79e31919db8f4132216f09a7868d18835eeb154b Reviewed-on: https://gerrit.libreoffice.org/71795 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms/source/component')
-rw-r--r--forms/source/component/DatabaseForm.cxx4
-rw-r--r--forms/source/component/ListBox.cxx6
-rw-r--r--forms/source/component/entrylisthelper.cxx18
3 files changed, 14 insertions, 14 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index a92913889217..2367a06b5441 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -1978,7 +1978,7 @@ void ODatabaseForm::reset_impl(bool _bAproveByListeners)
if ( xParentColSupp.is() )
xParentCols = xParentColSupp->getColumns();
- if ( xParentCols.is() && xParentCols->hasElements() && m_aMasterFields.getLength() )
+ if ( xParentCols.is() && xParentCols->hasElements() && m_aMasterFields.hasElements() )
{
try
{
@@ -2211,7 +2211,7 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const css::a
SolarMutexGuard aGuard;
aData = GetDataMultiPartEncoded(Control, MouseEvt, aContentType);
}
- if (!aData.getLength())
+ if (!aData.hasElements())
return;
Sequence<PropertyValue> aArgs(3);
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 9194f846692f..9fd4406e7ded 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -1133,7 +1133,7 @@ namespace frm
Sequence< sal_Int16 > aSelectedIndices;
OSL_VERIFY( m_xAggregateFastSet->getFastPropertyValue( getValuePropertyAggHandle() ) >>= aSelectedIndices );
- if ( !aSelectedIndices.getLength() )
+ if ( !aSelectedIndices.hasElements() )
// nothing selected at all
return s_aEmptyValue;
@@ -1276,7 +1276,7 @@ namespace frm
Any OListBoxModel::getDefaultForReset() const
{
Any aValue;
- if (m_aDefaultSelectSeq.getLength())
+ if (m_aDefaultSelectSeq.hasElements())
aValue <<= m_aDefaultSelectSeq;
else if (m_nNULLPos != -1) // bound Listbox
{
@@ -1755,7 +1755,7 @@ namespace frm
}
else
{
- if ( m_aDefaultSelectSeq.getLength() )
+ if ( m_aDefaultSelectSeq.hasElements() )
setControlValue( makeAny( m_aDefaultSelectSeq ), eOther );
}
}
diff --git a/forms/source/component/entrylisthelper.cxx b/forms/source/component/entrylisthelper.cxx
index fcb66644d6ca..a9c844e9a1e4 100644
--- a/forms/source/component/entrylisthelper.cxx
+++ b/forms/source/component/entrylisthelper.cxx
@@ -89,11 +89,11 @@ namespace frm
if ( ( _rEvent.Position >= 0 )
&& ( _rEvent.Position < static_cast<sal_Int32>(m_aStringItems.size()) )
- && ( _rEvent.Entries.getLength() > 0 )
+ && _rEvent.Entries.hasElements()
)
{
m_aStringItems[ _rEvent.Position ] = _rEvent.Entries[ 0 ];
- if (m_aTypedItems.getLength())
+ if (m_aTypedItems.hasElements())
m_aTypedItems = Sequence<Any>(); // doesn't match anymore
stringItemListChanged( aLock );
}
@@ -106,16 +106,16 @@ namespace frm
OSL_ENSURE( _rEvent.Source == m_xListSource,
"OEntryListHelper::entryRangeInserted: where did this come from?" );
- OSL_ENSURE( ( _rEvent.Position > 0 ) && ( _rEvent.Position < static_cast<sal_Int32>(m_aStringItems.size()) ) && ( _rEvent.Entries.getLength() > 0 ),
+ OSL_ENSURE( ( _rEvent.Position > 0 ) && ( _rEvent.Position < static_cast<sal_Int32>(m_aStringItems.size()) ) && _rEvent.Entries.hasElements(),
"OEntryListHelper::entryRangeRemoved: invalid count and/or position!" );
if ( ( _rEvent.Position > 0 )
&& ( _rEvent.Position < static_cast<sal_Int32>(m_aStringItems.size()) )
- && ( _rEvent.Entries.getLength() > 0 )
+ && _rEvent.Entries.hasElements()
)
{
m_aStringItems.insert(m_aStringItems.begin() + _rEvent.Position, _rEvent.Entries.begin(), _rEvent.Entries.end());
- if (m_aTypedItems.getLength())
+ if (m_aTypedItems.hasElements())
m_aTypedItems = Sequence<Any>(); // doesn't match anymore
stringItemListChanged( aLock );
}
@@ -154,7 +154,7 @@ namespace frm
}
m_aTypedItems = aTmp;
}
- else if (m_aTypedItems.getLength())
+ else if (m_aTypedItems.hasElements())
{
m_aTypedItems = Sequence<Any>(); // doesn't match anymore
}
@@ -273,7 +273,7 @@ namespace frm
else
{
comphelper::sequenceToContainer( m_aStringItems, m_xListSource->getAllListEntries());
- if (m_aTypedItems.getLength())
+ if (m_aTypedItems.hasElements())
m_aTypedItems = Sequence<Any>();
}
stringItemListChanged( _rInstanceLock );
@@ -297,7 +297,7 @@ namespace frm
css::uno::Sequence<OUString> aTmp;
OSL_VERIFY( _rValue >>= aTmp );
comphelper::sequenceToContainer(m_aStringItems, aTmp);
- if (m_aTypedItems.getLength())
+ if (m_aTypedItems.hasElements())
m_aTypedItems = Sequence<Any>(); // doesn't match anymore
stringItemListChanged( _rInstanceLock );
}
@@ -309,7 +309,7 @@ namespace frm
if (!(_rValue >>= m_aTypedItems ))
{
OSL_VERIFY(false);
- if (m_aTypedItems.getLength())
+ if (m_aTypedItems.hasElements())
m_aTypedItems = Sequence<Any>(); // doesn't match anymore
}
// Sets both properties, assuming that TypedItemList belongs to StringItemList.