Kaydet (Commit) 966f40ee authored tarafından Arkadiy Illarionov's avatar Arkadiy Illarionov Kaydeden (comit) Noel Grandin

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: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 4830a1ba
......@@ -1208,7 +1208,7 @@ namespace accessibility
bool bSupplementalMode = false;
uno::Sequence< OUString > aPropertyNames = rRequestedAttributes;
if (aPropertyNames.getLength() == 0)
if (!aPropertyNames.hasElements())
{
bSupplementalMode = true;
aPropertyNames = getAttributeNames();
......
......@@ -541,7 +541,7 @@ namespace editeng
if (!m_bIsInteractive)
{
// silent conversion (e.g. for simplified/traditional Chinese)...
if(m_aCurrentSuggestions.getLength()>0)
if(m_aCurrentSuggestions.hasElements())
implChange( m_aCurrentSuggestions.getConstArray()[0] );
}
else if (bAutoChange)
......
......@@ -577,7 +577,7 @@ uno::Any SAL_CALL SvxUnoTextField::queryAggregation( const uno::Type & rType )
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextField::getTypes()
{
if( maTypeSequence.getLength() == 0 )
if( !maTypeSequence.hasElements() )
{
maTypeSequence = comphelper::concatSequences(
OComponentHelper::getTypes(),
......
......@@ -1760,7 +1760,7 @@ sal_Bool SAL_CALL OCommonEmbeddedObject::isStored()
if (!xNA.is())
return false;
return xNA->getElementNames().getLength() > 0;
return xNA->getElementNames().hasElements();
}
......
......@@ -115,7 +115,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
if (!aObject.hasElements() && aMediaType == MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII)
aObject = m_aConfigHelper.GetObjectPropsByMediaType(MIMETYPE_VND_SUN_XML_BASE_ASCII);
if ( !aObject.getLength() )
if ( !aObject.hasElements() )
throw io::IOException(); // unexpected mimetype of the storage
xResult.set(static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
......@@ -164,7 +164,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
throw io::IOException(); // TODO:
}
uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByFilter( aFilterName );
if ( !aObject.getLength() )
if ( !aObject.hasElements() )
throw io::IOException(); // unexpected mimetype of the storage
......@@ -204,7 +204,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
4 );
uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByClassID( aClassID );
if ( !aObject.getLength() )
if ( !aObject.hasElements() )
throw io::IOException(); // unexpected mimetype of the storage
xResult.set( static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
......@@ -245,7 +245,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
2 );
uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByClassID( aClassID );
if ( !aObject.getLength() )
if ( !aObject.hasElements() )
throw io::IOException(); // unexpected mimetype of the storage
uno::Sequence< beans::PropertyValue > aTempMedDescr( lArguments );
......@@ -302,7 +302,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
throw io::IOException(); // TODO:
}
uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByFilter( aFilterName );
if ( !aObject.getLength() )
if ( !aObject.hasElements() )
throw io::IOException(); // unexpected mimetype of the storage
......@@ -350,7 +350,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
3 );
uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByClassID( aClassID );
if ( !aObject.getLength() )
if ( !aObject.hasElements() )
throw io::IOException(); // unexpected mimetype of the storage
OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, aObject );
......@@ -415,7 +415,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::crea
const uno::Sequence< beans::PropertyValue >& /*lObjArgs*/ )
{
uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByClassID( aClassID );
if ( !aObject.getLength() )
if ( !aObject.hasElements() )
throw io::IOException(); // unexpected mimetype of the storage
uno::Reference< uno::XInterface > xResult(
......
......@@ -135,7 +135,7 @@ Any SAL_CALL InvocationToAllListenerMapper::invoke(const OUString& FunctionName,
Reference< XIdlClass > xReturnType = xMethod->getReturnType();
Sequence< Reference< XIdlClass > > aExceptionSeq = xMethod->getExceptionTypes();
if( ( xReturnType.is() && xReturnType->getTypeClass() != TypeClass_VOID ) ||
aExceptionSeq.getLength() > 0 )
aExceptionSeq.hasElements() )
{
bApproveFiring = true;
}
......
......@@ -300,7 +300,7 @@ DBChangeDialogConfig_Impl::~DBChangeDialogConfig_Impl()
const Sequence<OUString>& DBChangeDialogConfig_Impl::GetDataSourceNames()
{
if(!aSourceNames.getLength())
if(!aSourceNames.hasElements())
{
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference<XDatabaseContext> xDBContext = DatabaseContext::create(xContext);
......
......@@ -259,7 +259,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame,
{
DBChangeDialogConfig_Impl aConfig;
const Sequence<OUString> aSources = aConfig.GetDataSourceNames();
if(aSources.getLength())
if(aSources.hasElements())
aBibDesc.sDataSource = aSources.getConstArray()[0];
}
......@@ -564,7 +564,7 @@ sal_Bool BibliographyLoader::hasElements()
{
Reference< XResultSet > xCursor = GetDataCursor();
Reference< XNameAccess > xColumns = GetDataColumns();
return xColumns.is() && (xColumns->getElementNames().getLength() != 0);
return xColumns.is() && xColumns->getElementNames().hasElements();
}
Reference< XPropertySetInfo > BibliographyLoader::getPropertySetInfo()
......
......@@ -148,7 +148,7 @@ static Reference< XNameAccess > getColumns(const Reference< XForm > & _rxForm)
if (xSupplyCols.is())
xReturn = xSupplyCols->getColumns();
if (!xReturn.is() || (xReturn->getElementNames().getLength() == 0))
if (!xReturn.is() || !xReturn->getElementNames().hasElements())
{ // no ....
xReturn = nullptr;
// -> get the table the form is bound to and ask it for their columns
......@@ -706,7 +706,7 @@ Reference< XForm > BibDataManager::createDatabaseForm(BibDBDescriptor& rDesc)
if (xTables.is())
aTableNameSeq = xTables->getElementNames();
if(aTableNameSeq.getLength() > 0)
if(aTableNameSeq.hasElements())
{
if(!rDesc.sTableOrQuery.isEmpty())
aActiveDataTable = rDesc.sTableOrQuery;
......@@ -830,7 +830,7 @@ OUString BibDataManager::getQueryField()
if(aFieldString.isEmpty())
{
const Sequence< OUString > aSeq = getQueryFields();
if(aSeq.getLength()>0)
if(aSeq.hasElements())
{
aFieldString=aSeq[0];
}
......@@ -892,7 +892,7 @@ void BibDataManager::setActiveDataSource(const OUString& rURL)
Reference< XNameAccess > xAccess = xSupplyTables->getTables();
aTableNameSeq = xAccess->getElementNames();
}
if(aTableNameSeq.getLength() > 0)
if(aTableNameSeq.hasElements())
{
aActiveDataTable = aTableNameSeq[0];
aVal <<= aActiveDataTable;
......
......@@ -625,7 +625,7 @@ namespace dbp
return false;
}
return 0 != m_aContext.aFieldNames.getLength();
return m_aContext.aFieldNames.hasElements();
}
......@@ -683,7 +683,7 @@ namespace dbp
bool OControlWizard::needDatasourceSelection()
{
// lemme see ...
return (0 == getContext().aFieldNames.getLength());
return !getContext().aFieldNames.hasElements();
// if we got fields, the data source is valid ...
}
......
......@@ -100,7 +100,7 @@ namespace dbp
return GBW_STATE_OPTIONVALUES;
case GBW_STATE_OPTIONVALUES:
if (getContext().aFieldNames.getLength())
if (getContext().aFieldNames.hasElements())
return GBW_STATE_DBFIELD;
else
return GBW_STATE_FINALIZE;
......@@ -131,7 +131,7 @@ namespace dbp
if (!m_bVisitedDB)
{ // try to generate a default for the DB field
// (simply use the first field in the DB names collection)
if (getContext().aFieldNames.getLength())
if (getContext().aFieldNames.hasElements())
m_aSettings.sDBField = getContext().aFieldNames[0];
}
m_bVisitedDB = true;
......@@ -180,7 +180,7 @@ namespace dbp
get(m_pMoveLeft, "toleft");
get(m_pExistingRadios, "radiobuttons");
if (getContext().aFieldNames.getLength())
if (getContext().aFieldNames.hasElements())
{
enableFormDatasourceDisplay();
}
......
......@@ -99,7 +99,7 @@ namespace logging
{
::osl::MutexGuard aGuard( m_aMutex );
if ( arguments.getLength() == 0 )
if ( !arguments.hasElements() )
{ // create() - nothing to init
m_aHandlerHelper.setIsInitialized();
return;
......
......@@ -196,7 +196,7 @@ namespace logging
if ( !sServiceName.isEmpty() )
{
bool bSuccess = false;
if ( aSettings.getLength() )
if ( aSettings.hasElements() )
{
Sequence< Any > aConstructionArgs(1);
aConstructionArgs[0] <<= aSettings;
......
......@@ -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;
}
......
......@@ -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 )
{
......
......@@ -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 );
......
......@@ -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(); }
};
......
......@@ -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 ...
......
......@@ -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();
......
......@@ -1570,7 +1570,7 @@ CacheItem FilterCache::impl_loadItem(const css::uno::Reference< css::container::
css::uno::Sequence< OUString > &rNames = m_aTypeProps[eOption];
// read standard properties of a filter
if (rNames.getLength() > 0)
if (rNames.hasElements())
{
css::uno::Reference< css::beans::XMultiPropertySet >
xPropSet( xItem, css::uno::UNO_QUERY_THROW);
......@@ -1594,7 +1594,7 @@ CacheItem FilterCache::impl_loadItem(const css::uno::Reference< css::container::
css::uno::Sequence< OUString > &rNames = m_aStandardProps[eOption];
// read standard properties of a filter
if (rNames.getLength() > 0)
if (rNames.hasElements())
{
css::uno::Reference< css::beans::XMultiPropertySet >
xPropSet( xItem, css::uno::UNO_QUERY_THROW);
......
......@@ -3068,7 +3068,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
if ( rrProp.Value >>= aSegments )
{
// creating seginfo
if ( static_cast<sal_uInt16>(aSegments.getLength()) )
if ( aSegments.hasElements() )
{
sal_uInt16 j, nElements = static_cast<sal_uInt16>(aSegments.getLength());
sal_uInt16 nElementSize = 2;
......@@ -3205,7 +3205,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
uno::Sequence<drawing::EnhancedCustomShapeTextFrame> aPathTextFrames;
if ( rrProp.Value >>= aPathTextFrames )
{
if ( static_cast<sal_uInt16>(aPathTextFrames.getLength()) )
if ( aPathTextFrames.hasElements() )
{
sal_uInt16 j, nElements = static_cast<sal_uInt16>(aPathTextFrames.getLength());
sal_uInt16 nElementSize = 16;
......@@ -3657,7 +3657,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
if ( aPathCoordinatesProp >>= aCoordinates )
{
// creating the vertices
if (aCoordinates.getLength() > 0)
if (aCoordinates.hasElements())
{
sal_uInt16 j, nElements = static_cast<sal_uInt16>(aCoordinates.getLength());
sal_uInt16 nElementSize = 8;
......
......@@ -324,7 +324,7 @@ void TBCData::ImportToolBarControl( CustomToolBarImportHelper& helper, std::vect
uno::Reference< ui::XImageManager > xImageManager( helper.getAppCfgManager()->getImageManager(), uno::UNO_QUERY_THROW );
// 0 = default image size
uno::Sequence< uno::Reference< graphic::XGraphic > > sImages = xImageManager->getImages( 0, sCmds );
if ( sImages.getLength() && sImages[0].is() )
if ( sImages.hasElements() && sImages[0].is() )
helper.addIcon( sImages[0], sCommand );
}
}
......
......@@ -301,11 +301,11 @@ void PDFExportStreamDoc::write( const Reference< XOutputStream >& xStream )
Reference< css::frame::XStorable > xStore( m_xSrcDoc, UNO_QUERY );
if( xStore.is() )
{
Sequence< beans::PropertyValue > aArgs( 2 + ((m_aPreparedPassword.getLength() > 0) ? 1 : 0) );
Sequence< beans::PropertyValue > aArgs( 2 + (m_aPreparedPassword.hasElements() ? 1 : 0) );
aArgs.getArray()[0].Name = "FilterName";
aArgs.getArray()[1].Name = "OutputStream";
aArgs.getArray()[1].Value <<= xStream;
if( m_aPreparedPassword.getLength() )
if( m_aPreparedPassword.hasElements() )
{
aArgs.getArray()[2].Name = "EncryptionData";
aArgs.getArray()[2].Value <<= m_aPreparedPassword;
......@@ -740,7 +740,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
aContext.Encryption.CanExtractForAccessibility = mbCanExtractForAccessibility;
if( mbEncrypt && ! xEnc.is() )
xEnc = vcl::PDFWriter::InitEncryption( aPermissionPassword, aOpenPassword );
if( mbEncrypt && !aPermissionPassword.isEmpty() && ! aPreparedPermissionPassword.getLength() )
if( mbEncrypt && !aPermissionPassword.isEmpty() && ! aPreparedPermissionPassword.hasElements() )
aPreparedPermissionPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aPermissionPassword );
}
// after this point we don't need the legacy clear passwords anymore
......
......@@ -71,7 +71,7 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
/* we don't get FilterData if we are exporting directly
to pdf, but we have to use the last user settings (especially for the CompressMode) */
if ( !aFilterData.getLength() )
if ( !aFilterData.hasElements() )
{
FilterConfigItem aCfgItem( "Office.Common/Filter/PDF/Export/" );
aCfgItem.ReadBool( "UseLosslessCompression", false );
......
......@@ -335,8 +335,7 @@ void SAL_CALL XmlFilterAdaptor::setTargetDocument( const Reference< css::lang::X
void SAL_CALL XmlFilterAdaptor::initialize( const Sequence< Any >& aArguments )
{
Sequence < PropertyValue > aAnySeq;
sal_Int32 nLength = aArguments.getLength();
if ( nLength && ( aArguments[0] >>= aAnySeq ) )
if ( aArguments.hasElements() && ( aArguments[0] >>= aAnySeq ) )
{
comphelper::SequenceAsHashMap aMap(aAnySeq);
msFilterName = aMap.getUnpackedValueOrDefault(
......
......@@ -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);
......
......@@ -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 );
}
}
......
......@@ -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.
......
......@@ -388,7 +388,7 @@ void OInterfaceContainer::transformEvents()
// get the script events for this object
aChildEvents = m_xEventAttacher->getScriptEvents( i );
if ( aChildEvents.getLength() )
if ( aChildEvents.hasElements() )
{
// do the transformation
::std::for_each( aChildEvents.begin(), aChildEvents.end(), TransformEventTo52Format() );
......
......@@ -89,7 +89,7 @@ namespace frm
checkDisposed();
OSL_ENSURE( _rURL.Complete == getFeatureURL().Complete, "OAttributeDispatcher::dispatch: invalid URL!" );
SAL_WARN_IF( _rArguments.getLength(), "forms.richtext",
SAL_WARN_IF( _rArguments.hasElements(), "forms.richtext",
"OAttributeDispatcher::dispatch: found arguments, but can't handle arguments at all"
" (URL: " << _rURL.Complete << ")");
......
......@@ -989,7 +989,7 @@ OUString FormulaDlg_Impl::RepairFormula(const OUString& aFormula)
{
UpdateTokenArray(aFormula);
if ( m_aTokenList.getLength() )
if ( m_aTokenList.hasElements() )
{
const table::CellAddress aRefPos(m_pHelper->getReferencePosition());
const OUString sFormula( m_pHelper->getFormulaParser()->printFormula( m_aTokenList, aRefPos));
......
......@@ -509,7 +509,7 @@ namespace svt
Sequence < OUString > aTemplateList;
_rValue >>= aTemplateList;
if ( aTemplateList.getLength() )
if ( aTemplateList.hasElements() )
{
for ( long i=0; i < aTemplateList.getLength(); i++ )
_pListbox->InsertEntry( aTemplateList[i] );
......
......@@ -93,7 +93,7 @@ FilterEntry::FilterEntry( const OUString& _rTitle, const UnoFilterList& _rSubFil
bool FilterEntry::hasSubFilters( ) const
{
return ( 0 < m_aSubFilters.getLength() );
return m_aSubFilters.hasElements();
}
......@@ -910,7 +910,7 @@ void SAL_CALL SvtFilePicker::appendFilterGroup( const OUString& sGroupTitle,
// ensure that we have a filter list
OUString sInitialCurrentFilter;
if ( aFilters.getLength() )
if ( aFilters.hasElements() )
sInitialCurrentFilter = aFilters[0].First;
ensureFilterList( sInitialCurrentFilter );
......@@ -978,7 +978,7 @@ void SAL_CALL SvtFilePicker::initialize( const Sequence< Any >& _rArguments )
m_nServiceType = TemplateDescription::FILEOPEN_SIMPLE;
if ( _rArguments.getLength() >= 1 )
if ( _rArguments.hasElements() )
{
// compatibility: one argument, type sal_Int16 , specifies the service type
int index = 0;
......
......@@ -652,7 +652,7 @@ void RemoteFilesDialog::EnableControls()
UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, Reference< XInteractionHandler>() );
if( aURLEntries.UserList.getLength() )
if( aURLEntries.UserList.hasElements() )
{
m_pAddMenu->EnableItem( "change_password" );
}
......@@ -872,7 +872,7 @@ IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, void )
UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler );
if( aURLEntries.Url == sUrl && aURLEntries.UserList.getLength() )
if( aURLEntries.Url == sUrl && aURLEntries.UserList.hasElements() )
{
OUString sUserName = aURLEntries.UserList[0].UserName;
......@@ -914,7 +914,7 @@ IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, void )
UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler );
if( aURLEntries.Url == sUrl && aURLEntries.UserList.getLength() )
if( aURLEntries.Url == sUrl && aURLEntries.UserList.hasElements() )
{
OUString sUserName = aURLEntries.UserList[0].UserName;
......
......@@ -290,7 +290,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback, LinkParamNone*, void)
// NOTE: There is a race between checking this and connections being created/destroyed before
// we close the frame / terminate the app.
css::uno::Reference<css::bridge::XBridgeFactory2> bridgeFac( css::bridge::BridgeFactory::create(xContext) );
bool bHasActiveConnections = bridgeFac->getExistingBridges().getLength() > 0;
bool bHasActiveConnections = bridgeFac->getExistingBridges().hasElements();
// a) If the current frame (where the close dispatch was requested for) does not have
// any parent frame ... it will close this frame only. Such frame isn't part of the
......