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

Use hasElements to check Sequence emptiness in cppcanvas..desktop

Similar to clang-tidy readability-container-size-empty

Change-Id: I81c0ff78d2ecc7d984e3ed5e5ce60efe327fc162
Reviewed-on: https://gerrit.libreoffice.org/71799
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6c31c2b0
......@@ -392,8 +392,8 @@ namespace cppcanvas
const OutDevState& rState( rParms.mrStates.getState() );
if( (!rState.isLineColorSet &&
!rState.isFillColorSet) ||
(rState.lineColor.getLength() == 0 &&
rState.fillColor.getLength() == 0) )
(!rState.lineColor.hasElements() &&
!rState.fillColor.hasElements()) )
{
return false;
}
......@@ -1813,7 +1813,7 @@ namespace cppcanvas
case MetaActionType::POINT:
{
const OutDevState& rState( rStates.getState() );
if( rState.lineColor.getLength() )
if( rState.lineColor.hasElements() )
{
std::shared_ptr<Action> pPointAction(
internal::PointActionFactory::createPointAction(
......@@ -1837,7 +1837,7 @@ namespace cppcanvas
case MetaActionType::PIXEL:
{
const OutDevState& rState( rStates.getState() );
if( rState.lineColor.getLength() )
if( rState.lineColor.hasElements() )
{
std::shared_ptr<Action> pPointAction(
internal::PointActionFactory::createPointAction(
......@@ -1862,7 +1862,7 @@ namespace cppcanvas
case MetaActionType::LINE:
{
const OutDevState& rState( rStates.getState() );
if( rState.lineColor.getLength() )
if( rState.lineColor.hasElements() )
{
MetaLineAction* pLineAct = static_cast<MetaLineAction*>(pCurrAct);
......@@ -2048,8 +2048,8 @@ namespace cppcanvas
case MetaActionType::POLYLINE:
{
const OutDevState& rState( rStates.getState() );
if( rState.lineColor.getLength() ||
rState.fillColor.getLength() )
if( rState.lineColor.hasElements() ||
rState.fillColor.hasElements() )
{
MetaPolyLineAction* pPolyLineAct = static_cast<MetaPolyLineAction*>(pCurrAct);
......@@ -2395,8 +2395,8 @@ namespace cppcanvas
case MetaActionType::Transparent:
{
const OutDevState& rState( rStates.getState() );
if( rState.lineColor.getLength() ||
rState.fillColor.getLength() )
if( rState.lineColor.hasElements() ||
rState.fillColor.hasElements() )
{
MetaTransparentAction* pAct = static_cast<MetaTransparentAction*>(pCurrAct);
::basegfx::B2DPolyPolygon aPoly( pAct->GetPolyPolygon().getB2DPolyPolygon() );
......
......@@ -155,7 +155,7 @@ namespace cppcanvas
rendering::RenderState aLocalState( maState );
::canvas::tools::prependToRenderState(aLocalState, rTransformation);
if( maFillColor.getLength() )
if( maFillColor.hasElements() )
{
// TODO(E3): Use DBO's finalizer here,
// fillPolyPolygon() might throw
......@@ -169,7 +169,7 @@ namespace cppcanvas
aLocalState.DeviceColor = aTmpColor;
}
if( aLocalState.DeviceColor.getLength() )
if( aLocalState.DeviceColor.hasElements() )
{
rCachedPrimitive = mpCanvas->getUNOCanvas()->drawPolyPolygon( mxPolyPoly,
mpCanvas->getViewState(),
......
......@@ -155,7 +155,7 @@ namespace cppcanvas
void initLayoutWidth(double& rLayoutWidth, const uno::Sequence<double>& rOffsets)
{
ENSURE_OR_THROW(rOffsets.getLength(),
ENSURE_OR_THROW(rOffsets.hasElements(),
"::cppcanvas::internal::initLayoutWidth(): zero-length array" );
rLayoutWidth = *(std::max_element(rOffsets.begin(), rOffsets.end()));
}
......@@ -236,7 +236,7 @@ namespace cppcanvas
const OutDevState& rState,
const ::basegfx::B2DHomMatrix* pTextTransform )
{
ENSURE_OR_THROW( rOffsets.getLength(),
ENSURE_OR_THROW( rOffsets.hasElements(),
"::cppcanvas::internal::initArrayAction(): zero-length DX array" );
const ::basegfx::B2DPoint aLocalStartPoint(
......
......@@ -288,7 +288,7 @@ Any ComponentContext::lookupMap( OUString const & rName )
Reference< lang::XSingleComponentFactory > xFac;
if (usesService >>= xFac) // try via factory
{
xInstance = args.getLength()
xInstance = args.hasElements()
? xFac->createInstanceWithArgumentsAndContext( args, this )
: xFac->createInstanceWithContext( this );
}
......@@ -298,7 +298,7 @@ Any ComponentContext::lookupMap( OUString const & rName )
if (usesService >>= xFac2)
{
// try via old XSingleServiceFactory
xInstance = args.getLength()
xInstance = args.hasElements()
? xFac2->createInstanceWithArguments( args )
: xFac2->createInstance();
}
......@@ -308,7 +308,7 @@ Any ComponentContext::lookupMap( OUString const & rName )
if ((usesService >>= serviceName) &&
!serviceName.isEmpty())
{
xInstance = args.getLength()
xInstance = args.hasElements()
? m_xSMgr->createInstanceWithArgumentsAndContext(
serviceName, args, this )
: m_xSMgr->createInstanceWithContext(
......
......@@ -186,7 +186,7 @@ Reference< XInterface > OSingleFactoryHelper::createInstanceWithArgumentsAndCont
}
else
{
if ( rArguments.getLength() )
if ( rArguments.hasElements() )
{
// dispose the here created UNO object before throwing out exception
// to avoid risk of memory leaks #i113722#
......@@ -747,7 +747,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory()
Sequence< OUString > ORegistryFactoryHelper::getSupportedServiceNames()
{
MutexGuard aGuard( aMutex );
if( aServiceNames.getLength() == 0 )
if( !aServiceNames.hasElements() )
{
// not yet loaded
try
......
......@@ -203,7 +203,7 @@ cppuhelper::WrapperConstructorFn mapConstructorFn(
void *const ctxt = mapTo.mapInterface(
context,
cppu::UnoType<css::uno::XComponentContext>::get());
if (args.getLength() > 0) {
if (args.hasElements()) {
std::abort(); // TODO map args
}
void * instance = nullptr;
......
......@@ -122,7 +122,7 @@ static typelib_TypeDescription * createCTD(
const Reference< XStructTypeDescription > & xType )
{
typelib_TypeDescription * pRet = nullptr;
if (xType.is() && xType->getTypeParameters().getLength() == 0)
if (xType.is() && !xType->getTypeParameters().hasElements())
{
typelib_TypeDescription * pBaseType = createCTD(
access, xType->getBaseType() );
......@@ -171,7 +171,7 @@ static typelib_TypeDescription * createCTD(
// string is held by rMemberNames
rInit.aBase.pMemberName = pMemberNames[nPos].pData;
rInit.bParameterizedType = templateMemberTypes.getLength() != 0
rInit.bParameterizedType = templateMemberTypes.hasElements()
&& (templateMemberTypes[nPos]->getTypeClass()
== TypeClass_UNKNOWN);
}
......
......@@ -1690,7 +1690,7 @@ Enumeration::nextTypeDescription()
}
bool Enumeration::matches(css::uno::TypeClass tc) const {
if (types_.getLength() == 0) {
if (!types_.hasElements()) {
return true;
}
for (sal_Int32 i = 0; i != types_.getLength(); ++i) {
......
......@@ -101,7 +101,7 @@ css::uno::Reference< css::graphic::XGraphic > SvxConfigPageHelper::GetGraphic(
aGraphicSeq =
xImageManager->getImages( GetImageType(), aImageCmdSeq );
if ( aGraphicSeq.getLength() > 0 )
if ( aGraphicSeq.hasElements() )
{
result = aGraphicSeq[0];
}
......
......@@ -2725,7 +2725,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog(weld::Window *pWindow,
{
name[ 0 ] = elem.first;
uno::Sequence< uno::Reference< graphic::XGraphic> > graphics = m_xImportedImageManager->getImages( SvxConfigPageHelper::GetImageType(), name );
if ( graphics.getLength() > 0 )
if ( graphics.hasElements() )
{
m_aGraphics.push_back(graphics[0]);
Image img(graphics[0]);
......@@ -2771,7 +2771,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog(weld::Window *pWindow,
// added to the list
}
if ( graphics.getLength() > 0 )
if ( graphics.hasElements() )
{
Image img(graphics[0]);
if (!img.GetBitmapEx().IsEmpty())
......
......@@ -142,7 +142,7 @@ IMPL_LINK_NOARG(SignSignatureLineDialog, loadImage, weld::Button&, void)
if (xFilePicker->execute())
{
Sequence<OUString> aSelectedFiles = xFilePicker->getSelectedFiles();
if (aSelectedFiles.getLength() < 1)
if (!aSelectedFiles.hasElements())
return;
Reference<XGraphicProvider> xProvider = GraphicProvider::create(xContext);
......
......@@ -1612,7 +1612,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, const css
pAction->SetErrorMove(nOldErrorStart, nOldErrorEnd);
const SpellErrorAttrib* pOldAttrib = static_cast<const SpellErrorAttrib*>(
pTextEngine->FindAttrib( TextPaM(0, nOldErrorStart), TEXTATTR_SPELL_ERROR ));
pAction->SetErrorLanguageSelected(pOldAttrib && pOldAttrib->GetErrorDescription().aSuggestions.getLength() &&
pAction->SetErrorLanguageSelected(pOldAttrib && pOldAttrib->GetErrorDescription().aSuggestions.hasElements() &&
LanguageTag( pOldAttrib->GetErrorDescription().aLocale).getLanguageType() ==
GetSpellDialog()->m_pLanguageLB->GetSelectedLanguage());
AddUndoAction(std::move(pAction));
......
......@@ -1192,7 +1192,7 @@ namespace svx
_rOrg.getLength(),
ConversionDirection_FROM_LEFT,
css::i18n::TextConversionOption::NONE );
bRet = _rEntries.getLength() > 0;
bRet = _rEntries.hasElements();
}
catch( const IllegalArgumentException& )
{
......
......@@ -320,7 +320,7 @@ short SvInsertOleDlg::run()
uno::Reference< io::XInputStream > SvInsertOleDlg::GetIconIfIconified( OUString* pGraphicMediaType )
{
if ( m_aIconMetaFile.getLength() )
if ( m_aIconMetaFile.hasElements() )
{
if ( pGraphicMediaType )
*pGraphicMediaType = m_aIconMediaType;
......
......@@ -357,7 +357,7 @@ IMPL_LINK_NOARG(ScreenshotAnnotationDlg_Impl, saveButtonHandler, Button*, void)
maLastFolderURL = xFilePicker->getDisplayDirectory();
const uno::Sequence< OUString > files(xFilePicker->getSelectedFiles());
if (files.getLength())
if (files.hasElements())
{
OUString aConfirmedName = files[0];
......
......@@ -752,7 +752,7 @@ void SvxScriptOrgDialog::createEntry(weld::TreeIter& rEntry)
{
aNewName = aNewStdName + OUString::number(i);
bool bFound = false;
if(childNodes.getLength() > 0 )
if(childNodes.hasElements() )
{
OUString nodeName = childNodes[0]->getName();
sal_Int32 extnPos = nodeName.lastIndexOf( '.' );
......
......@@ -79,13 +79,13 @@ uno::Sequence< uno::Reference< linguistic2::XMeaning > > SvxThesaurusDialog::que
xThesaurus->queryMeanings( rTerm, rLocale, rProperties ) );
// text with '.' at the end?
if ( 0 == aMeanings.getLength() && rTerm.endsWith(".") )
if ( !aMeanings.hasElements() && rTerm.endsWith(".") )
{
// try again without trailing '.' chars. It may be a word at the
// end of a sentence and not an abbreviation...
OUString aTxt(comphelper::string::stripEnd(rTerm, '.'));
aMeanings = xThesaurus->queryMeanings( aTxt, rLocale, rProperties );
if (aMeanings.getLength())
if (aMeanings.hasElements())
{
rTerm = aTxt;
}
......
......@@ -235,7 +235,7 @@ void SvxChartOptions::ImplCommit()
uno::Sequence< OUString > aNames = GetPropertyNames();
uno::Sequence< uno::Any > aValues( aNames.getLength());
if( aValues.getLength() >= 1 )
if( aValues.hasElements() )
{
// 1. default colors for series
// convert list to sequence
......
......@@ -580,7 +580,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
const Sequence< Locale > aLocales( aInfo.xSpell->getLocales() );
//! suppress display of entries with no supported languages (see feature 110994)
if (aLocales.getLength())
if (aLocales.hasElements())
{
lcl_MergeLocales( aAllServiceLocales, aLocales );
lcl_MergeDisplayArray( *this, aInfo );
......@@ -604,7 +604,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
const Sequence< Locale > aLocales( aInfo.xGrammar->getLocales() );
//! suppress display of entries with no supported languages (see feature 110994)
if (aLocales.getLength())
if (aLocales.hasElements())
{
lcl_MergeLocales( aAllServiceLocales, aLocales );
lcl_MergeDisplayArray( *this, aInfo );
......@@ -627,7 +627,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
const Sequence< Locale > aLocales( aInfo.xHyph->getLocales() );
//! suppress display of entries with no supported languages (see feature 110994)
if (aLocales.getLength())
if (aLocales.hasElements())
{
lcl_MergeLocales( aAllServiceLocales, aLocales );
lcl_MergeDisplayArray( *this, aInfo );
......@@ -650,7 +650,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
const Sequence< Locale > aLocales( aInfo.xThes->getLocales() );
//! suppress display of entries with no supported languages (see feature 110994)
if (aLocales.getLength())
if (aLocales.hasElements())
{
lcl_MergeLocales( aAllServiceLocales, aLocales );
lcl_MergeDisplayArray( *this, aInfo );
......@@ -665,22 +665,22 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cSpell, pAllLocales[nLocale]);
SetChecked( aCfgSvcs );
if (aCfgSvcs.getLength())
if (aCfgSvcs.hasElements())
aCfgSpellTable[ nLang ] = aCfgSvcs;
aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cGrammar, pAllLocales[nLocale]);
SetChecked( aCfgSvcs );
if (aCfgSvcs.getLength())
if (aCfgSvcs.hasElements())
aCfgGrammarTable[ nLang ] = aCfgSvcs;
aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cHyph, pAllLocales[nLocale]);
SetChecked( aCfgSvcs );
if (aCfgSvcs.getLength())
if (aCfgSvcs.hasElements())
aCfgHyphTable[ nLang ] = aCfgSvcs;
aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cThes, pAllLocales[nLocale]);
SetChecked( aCfgSvcs );
if (aCfgSvcs.getLength())
if (aCfgSvcs.hasElements())
aCfgThesTable[ nLang ] = aCfgSvcs;
}
}
......
......@@ -270,7 +270,7 @@ MailMergeCfg_Impl::MailMergeCfg_Impl() :
Sequence<OUString> aNames { "EMailSupported" };
const Sequence< Any > aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
if(aValues.getLength() && pValues[0].hasValue())
if(aValues.hasElements() && pValues[0].hasValue())
pValues[0] >>= bIsEmailSupported;
}
......
......@@ -306,7 +306,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
OUString sInherentTableTypeRestriction( getTableTypeRestriction() );
if ( !sInherentTableTypeRestriction.isEmpty() )
{
if ( _rTableTypeFilter.getLength() != 0 )
if ( _rTableTypeFilter.hasElements() )
{
const OUString* tableType = _rTableTypeFilter.getConstArray();
const OUString* tableTypeEnd = tableType + _rTableTypeFilter.getLength();
......@@ -328,7 +328,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
else
{
// no container-inherent restriction for the table types
if ( _rTableTypeFilter.getLength() == 0 )
if ( !_rTableTypeFilter.hasElements() )
{ // no externally-provided table type filter => use the default filter
getAllTableTypeFilter( aTableTypeFilter );
}
......
......@@ -191,7 +191,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
{
if(!_rUpdateTableName.isEmpty() && xTables->hasByName(_rUpdateTableName))
xTables->getByName(_rUpdateTableName) >>= m_aUpdateTable;
else if(xTables->getElementNames().getLength())
else if(xTables->getElementNames().hasElements())
{
aUpdateTableName = xTables->getElementNames()[0];
xTables->getByName(aUpdateTableName) >>= m_aUpdateTable;
......
......@@ -1531,7 +1531,7 @@ namespace
const Sequence< PropertyValue >* pOrEnd = pOrIter + filter.getLength();
while ( pOrIter != pOrEnd )
{
if ( pOrIter->getLength() )
if ( pOrIter->hasElements() )
{
sRet.append(L_BRACKET);
const PropertyValue* pAndIter = pOrIter->getConstArray();
......
......@@ -198,7 +198,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
// Unreachable
}
if ( !aProperties.getLength() )
if ( !aProperties.hasElements() )
{
OSL_FAIL( "No properties!" );
ucbhelper::cancelCommandExecution(
......
......@@ -611,7 +611,7 @@ sal_Bool ODatabaseContext::hasElements()
MutexGuard aGuard(m_aMutex);
::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed);
return 0 != getElementNames().getLength();
return getElementNames().hasElements();
}
// css::container::XEnumerationAccess
......
......@@ -213,7 +213,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
if ( xElements.is() )
sPersistentName = ::dbtools::createUniqueName(xElements,sPersistentName);
const bool bNeedClassID = (0 == aClassID.getLength()) && sURL.isEmpty() ;
const bool bNeedClassID = !aClassID.hasElements() && sURL.isEmpty() ;
if ( xCopyFrom.is() )
{
Sequence<Any> aIni(2);
......@@ -265,13 +265,13 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
pElementImpl = aFind->second;
::rtl::Reference< ODocumentDefinition > pDocDef = new ODocumentDefinition( *this, m_aContext, pElementImpl, m_bFormsContainer );
if ( aClassID.getLength() )
if ( aClassID.hasElements() )
{
pDocDef->initialLoad( aClassID, aCreationArgs, xConnection );
}
else
{
OSL_ENSURE( aCreationArgs.getLength() == 0, "ODocumentContainer::createInstance: additional creation args are lost, if you do not provide a class ID." );
OSL_ENSURE( !aCreationArgs.hasElements(), "ODocumentContainer::createInstance: additional creation args are lost, if you do not provide a class ID." );
}
xContent = pDocDef.get();
......
......@@ -354,7 +354,7 @@ OUString ODocumentDefinition::GetDocumentServiceFromMediaType( const OUString& _
::comphelper::MimeConfigurationHelper aConfigHelper( _rContext );
sResult = aConfigHelper.GetDocServiceNameFromMediaType( _rMediaType );
_rClassId = comphelper::MimeConfigurationHelper::GetSequenceClassIDRepresentation(aConfigHelper.GetExplicitlyRegisteredObjClassID( _rMediaType ));
if ( !_rClassId.getLength() && !sResult.isEmpty() )
if ( !_rClassId.hasElements() && !sResult.isEmpty() )
{
Reference< XNameAccess > xObjConfig = aConfigHelper.GetObjConfiguration();
if ( xObjConfig.is() )
......@@ -409,8 +409,8 @@ ODocumentDefinition::ODocumentDefinition( const Reference< XInterface >& _rxCont
void ODocumentDefinition::initialLoad( const Sequence< sal_Int8 >& i_rClassID, const Sequence< PropertyValue >& i_rCreationArgs,
const Reference< XConnection >& i_rConnection )
{
OSL_ENSURE( i_rClassID.getLength(), "ODocumentDefinition::initialLoad: illegal class ID!" );
if ( !i_rClassID.getLength() )
OSL_ENSURE( i_rClassID.hasElements(), "ODocumentDefinition::initialLoad: illegal class ID!" );
if ( !i_rClassID.hasElements() )
return;
loadEmbeddedObject( i_rConnection, i_rClassID, i_rCreationArgs, false, false );
......@@ -1028,7 +1028,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co
{
Sequence<Any> aIni;
aCommand.Argument >>= aIni;
if ( !aIni.getLength() )
if ( !aIni.hasElements() )
{
OSL_FAIL( "Wrong argument count!" );
ucbhelper::cancelCommandExecution(
......@@ -1543,7 +1543,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_
bool bSetSize = false;
sal_Int32 nEntryConnectionMode = EntryInitModes::DEFAULT_INIT;
Sequence< sal_Int8 > aClassID = _aClassID;
if ( aClassID.getLength() )
if ( aClassID.hasElements() )
{
nEntryConnectionMode = EntryInitModes::TRUNCATE_INIT;
bSetSize = true;
......@@ -1566,7 +1566,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_
throw aWFE;
}
}
if ( !aClassID.getLength() )
if ( !aClassID.hasElements() )
{
if ( m_bForm )
aClassID = MimeConfigurationHelper::GetSequenceClassID(SO3_SW_CLASSID);
......@@ -1577,7 +1577,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_
}
}
OSL_ENSURE( aClassID.getLength(),"No Class ID" );
OSL_ENSURE( aClassID.hasElements(),"No Class ID" );
Sequence< PropertyValue > aEmbeddedObjectDescriptor;
Sequence< PropertyValue > aLoadArgs( fillLoadArgs(
......
......@@ -184,7 +184,7 @@ namespace dbaccess
Any aReturn;
const Sequence< PropertyValue >& rEventDesc( elementPos->second );
if ( rEventDesc.getLength() > 0 )
if ( rEventDesc.hasElements() )
aReturn <<= rEventDesc;
return aReturn;
}
......
......@@ -662,7 +662,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
typedef std::vector< ColumnDescription > ColumnDescriptions;
ColumnDescriptions aColumns;
bool bFirstColumnIsCategory = _bHasCategories;
if ( i_aColumnNames.getLength() )
if ( i_aColumnNames.hasElements() )
{
// some normalizations ...
uno::Sequence< OUString > aImposedColumnNames( i_aColumnNames );
......@@ -683,7 +683,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
// column. This, this results in a ColumnDescriptions array like <"", "col2", "col3">, where you'd expect
// <"col1", "col2", "col3">.
// Fix this with some heuristics:
if ( ( aImposedColumnNames.getLength() > 0 ) && ( !aImposedColumnNames[0].isEmpty() ) )
if ( aImposedColumnNames.hasElements() && ( !aImposedColumnNames[0].isEmpty() ) )
{
const sal_Int32 nAssumedRowSetColumnIndex = _bHasCategories ? 1 : 0;
if ( nAssumedRowSetColumnIndex < aRowSetColumnNames.getLength() )
......@@ -699,7 +699,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
if ( _bHasCategories && aColumns.empty() )
{
if ( aRowSetColumnNames.getLength() )
if ( aRowSetColumnNames.hasElements() )
aColumns.emplace_back( aRowSetColumnNames[0] );
else
aColumns.emplace_back( sColumnName );
......
......@@ -133,7 +133,7 @@ void OXMLDataSourceSetting::EndElement()
{
if ( !m_aSetting.Name.isEmpty() )
{
if ( m_bIsList && m_aInfoSequence.getLength() )
if ( m_bIsList && m_aInfoSequence.hasElements() )
m_aSetting.Value <<= m_aInfoSequence;
// if our property is of type string, but was empty, ensure that
......
......@@ -517,14 +517,14 @@ void ODBExport::exportApplicationConnectionSettings(const TSettingsMap& _aSettin
Reference<XPropertySet> xProp(getDataSource());
Sequence< OUString> aValue;
xProp->getPropertyValue(PROPERTY_TABLEFILTER) >>= aValue;
if ( aValue.getLength() )
if ( aValue.hasElements() )
{
SvXMLElementExport aElem2(*this,XML_NAMESPACE_DB, XML_TABLE_FILTER, true, true);
exportSequence(aValue,XML_TABLE_INCLUDE_FILTER,XML_TABLE_FILTER_PATTERN);
}
xProp->getPropertyValue(PROPERTY_TABLETYPEFILTER) >>= aValue;
if ( aValue.getLength() )
if ( aValue.hasElements() )
exportSequence(aValue,XML_TABLE_TYPE_FILTER,XML_TABLE_TYPE);
exportDataSourceSettings();
......@@ -687,7 +687,7 @@ void ODBExport::exportDataSourceSettings()
{
Sequence<Any> aSeq;
aIter->Value >>= aSeq;
if ( aSeq.getLength() )
if ( aSeq.hasElements() )
sTypeName = lcl_implGetPropertyXMLType(aSeq[0].getValueType());
}
......@@ -773,7 +773,7 @@ void ODBExport::exportSequence(const Sequence< OUString>& _aValue
,::xmloff::token::XMLTokenEnum _eTokenType)
{
Reference<XPropertySet> xProp(getDataSource());
if ( _aValue.getLength() )
if ( _aValue.hasElements() )
{
SvXMLElementExport aElem(*this,XML_NAMESPACE_DB, _eTokenFilter, true, true);
......@@ -1295,7 +1295,7 @@ void ODBExport::GetConfigurationSettings(Sequence<PropertyValue>& aProps)
Any aValue = xProp->getPropertyValue(PROPERTY_LAYOUTINFORMATION);
Sequence< PropertyValue > aPropValues;
aValue >>= aPropValues;
if ( aPropValues.getLength() )
if ( aPropValues.hasElements() )
{
aProps.realloc(nLength + 1);
aProps[nLength].Name = "layout-settings";
......
......@@ -946,7 +946,7 @@ void ODBFilter::setPropertyInfo()
aDataSourceSettings.merge( ::comphelper::NamedValueCollection( aInfo ), true );
aDataSourceSettings >>= aInfo;
if ( aInfo.getLength() )
if ( aInfo.hasElements() )
{
try
{
......
......@@ -1038,7 +1038,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
break;
case SID_DB_APP_PASTE_SPECIAL:
{
if ( !aArgs.getLength() )
if ( !aArgs.hasElements() )
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(getFrameWeld()));
......@@ -2690,7 +2690,7 @@ sal_Bool SAL_CALL OApplicationController::select( const Any& _aSelection )
// BEGIN compatibility
Sequence< NamedValue > aCurrentSelection;
if ( (_aSelection >>= aCurrentSelection) && aCurrentSelection.getLength() )
if ( (_aSelection >>= aCurrentSelection) && aCurrentSelection.hasElements() )
{
ElementType eType = E_NONE;
const NamedValue* pIter = aCurrentSelection.getConstArray();
......@@ -2803,7 +2803,7 @@ Any SAL_CALL OApplicationController::getSelection( )
if ( eType != E_NONE )
{
getContainer()->describeCurrentSelectionForType( eType, aCurrentSelection );
if ( aCurrentSelection.getLength() == 0 )
if ( !aCurrentSelection.hasElements() )
{ // if no objects are selected, add an entry to the sequence which describes the overall category
// which is selected currently
aCurrentSelection.realloc(1);
......
......@@ -171,7 +171,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, con
SAL_WARN("dbaccess.ui", "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnType) !");
sControlType = "TextField";
}
OSL_ENSURE(aControlProps.getLength(), "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnProperties) !");
OSL_ENSURE(aControlProps.hasElements(), "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnProperties) !");
// create the col
Reference< css::form::XGridColumnFactory > xColFactory(getControlModel(), UNO_QUERY);
......
......@@ -1951,7 +1951,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue
aDescriptor[DataAccessDescriptorProperty::CommandType] = xProp->getPropertyValue(PROPERTY_COMMAND_TYPE);
aDescriptor[DataAccessDescriptorProperty::Connection] = xProp->getPropertyValue(PROPERTY_ACTIVE_CONNECTION);
aDescriptor[DataAccessDescriptorProperty::Cursor] <<= xCursorClone;
if ( aSelection.getLength() )
if ( aSelection.hasElements() )
{
aDescriptor[DataAccessDescriptorProperty::Selection] <<= aSelection;
aDescriptor[DataAccessDescriptorProperty::BookmarkSelection] <<= false;
......
......@@ -772,7 +772,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
Sequence< Any> aTypeSettings;
aTypeSettings = aProperties.getOrDefault("TypeInfoSettings",aTypeSettings);
// here we have a special entry for types from oracle
if ( aTypeSettings.getLength() )
if ( aTypeSettings.hasElements() )
{
aRelevantSettings.insert(PropertyValue("TypeInfoSettings", 0, makeAny(aTypeSettings), PropertyState_DIRECT_VALUE));
}
......
......@@ -167,7 +167,7 @@ namespace dbaui
void OTableSubscriptionPage::implCompleteTablesCheck( const css::uno::Sequence< OUString >& _rTableFilter )
{
if (!_rTableFilter.getLength())
if (!_rTableFilter.hasElements())
{ // no tables visible
CheckAll(false);
}
......