summaryrefslogtreecommitdiff
path: root/extensions/source/propctrlr
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 /extensions/source/propctrlr
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 'extensions/source/propctrlr')
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx8
-rw-r--r--extensions/source/propctrlr/genericpropertyhandler.cxx2
-rw-r--r--extensions/source/propctrlr/objectinspectormodel.cxx6
-rw-r--r--extensions/source/propctrlr/pcrcommon.hxx2
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx2
-rw-r--r--extensions/source/propctrlr/stringrepresentation.cxx4
6 files changed, 12 insertions, 12 deletions
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index edfb90cfa5f3..ed7348bfaa5d 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -226,7 +226,7 @@ namespace pcr
{
xStringResourceResolver.set( _xComponent->getPropertyValue( "ResourceResolver" ),UNO_QUERY);
if( xStringResourceResolver.is() &&
- xStringResourceResolver->getLocales().getLength() > 0 )
+ xStringResourceResolver->getLocales().hasElements() )
{
xRet = xStringResourceResolver;
}
@@ -1806,7 +1806,7 @@ namespace pcr
Any aListSourceValue( impl_getPropertyValue_throw( PROPERTY_LISTSOURCE ) );
if ( aListSourceValue >>= aListSource )
{
- if ( aListSource.getLength() )
+ if ( aListSource.hasElements() )
sListSource = aListSource[0];
}
else
@@ -1888,7 +1888,7 @@ namespace pcr
{
Sequence< OUString > aEntries;
impl_getPropertyValue_throw( PROPERTY_STRINGITEMLIST ) >>= aEntries;
- bool isEnabled = aEntries.getLength() != 0;
+ bool isEnabled = aEntries.hasElements();
if ( ( m_nClassId == FormComponentType::LISTBOX ) && ( m_eComponentClass == eFormControl ) )
{
@@ -3103,7 +3103,7 @@ namespace pcr
if ( aValue >>= aValueList )
{
m_bPropertyValueIsList = true;
- if ( aValueList.getLength() )
+ if ( aValueList.hasElements() )
sValue = aValueList[0];
return sValue;
}
diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx
index 7e91a0b79d51..267ab9bc6c78 100644
--- a/extensions/source/propctrlr/genericpropertyhandler.cxx
+++ b/extensions/source/propctrlr/genericpropertyhandler.cxx
@@ -468,7 +468,7 @@ namespace pcr
Sequence< Property > aProperties;
if ( xPSI.is() )
aProperties = xPSI->getProperties();
- DBG_ASSERT( aProperties.getLength(), "GenericPropertyHandler::getSupportedProperties: no properties!" );
+ DBG_ASSERT( aProperties.hasElements(), "GenericPropertyHandler::getSupportedProperties: no properties!" );
for ( auto const & property : aProperties )
{
diff --git a/extensions/source/propctrlr/objectinspectormodel.cxx b/extensions/source/propctrlr/objectinspectormodel.cxx
index 5f2a3a694248..f210b848df6a 100644
--- a/extensions/source/propctrlr/objectinspectormodel.cxx
+++ b/extensions/source/propctrlr/objectinspectormodel.cxx
@@ -113,7 +113,7 @@ namespace pcr
void SAL_CALL ObjectInspectorModel::initialize( const Sequence< Any >& _arguments )
{
::osl::MutexGuard aGuard( m_aMutex );
- if ( m_aFactories.getLength() )
+ if ( m_aFactories.hasElements() )
throw AlreadyInitializedException();
StlSyntaxSequence< Any > arguments( _arguments );
@@ -185,14 +185,14 @@ namespace pcr
void ObjectInspectorModel::createWithHandlerFactories( const Sequence< Any >& _rFactories )
{
- impl_verifyArgument_throw( _rFactories.getLength() > 0, 1 );
+ impl_verifyArgument_throw( _rFactories.hasElements(), 1 );
m_aFactories = _rFactories;
}
void ObjectInspectorModel::createWithHandlerFactoriesAndHelpSection( const Sequence< Any >& _rFactories, sal_Int32 _nMinHelpTextLines, sal_Int32 _nMaxHelpTextLines )
{
- impl_verifyArgument_throw( _rFactories.getLength() > 0, 1 );
+ impl_verifyArgument_throw( _rFactories.hasElements(), 1 );
impl_verifyArgument_throw( _nMinHelpTextLines >= 1, 2 );
impl_verifyArgument_throw( _nMaxHelpTextLines >= 1, 3 );
impl_verifyArgument_throw( _nMinHelpTextLines <= _nMaxHelpTextLines, 2 );
diff --git a/extensions/source/propctrlr/pcrcommon.hxx b/extensions/source/propctrlr/pcrcommon.hxx
index 9a596611330b..e200396a6c7e 100644
--- a/extensions/source/propctrlr/pcrcommon.hxx
+++ b/extensions/source/propctrlr/pcrcommon.hxx
@@ -93,7 +93,7 @@ namespace pcr
iterator end() { return UnoBase::getArray() + UnoBase::getLength(); }
sal_Int32 size() const { return UnoBase::getLength(); }
- bool empty() const { return UnoBase::getLength() == 0; }
+ bool empty() const { return !UnoBase::hasElements(); }
};
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index 1e45e28fe190..ca78d761124e 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -1218,7 +1218,7 @@ namespace pcr
if ( !m_aPageIds.empty() )
{
Sequence< PropertyCategoryDescriptor > aCategories( m_xModel->describeCategories() );
- if ( aCategories.getLength() )
+ if ( aCategories.hasElements() )
m_pView->activatePage( m_aPageIds[ aCategories[0].ProgrammaticName ] );
else
// allowed: if we default-created the pages ...
diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx
index b28df28c0e0e..3d2fc67e0efb 100644
--- a/extensions/source/propctrlr/stringrepresentation.cxx
+++ b/extensions/source/propctrlr/stringrepresentation.cxx
@@ -280,7 +280,7 @@ OUString StringRepresentation::convertSimpleToString( const uno::Any& _rValue )
{
try
{
- if ( m_aConstants.getLength() )
+ if ( m_aConstants.hasElements() )
{
sal_Int16 nConstantValue = 0;
if ( _rValue >>= nConstantValue )
@@ -479,7 +479,7 @@ uno::Any StringRepresentation::convertStringToSimple( const OUString& _rValue,co
{
try
{
- if ( m_aConstants.getLength() && m_aValues.getLength() )
+ if ( m_aConstants.hasElements() && m_aValues.hasElements() )
{
const OUString* pIter = m_aValues.getConstArray();
const OUString* pEnd = pIter + m_aValues.getLength();