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

Use hasElements to check Sequence emptiness in sfx2..svx

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

Change-Id: Icabd773f3b924d465b33e8581175f1fcf70c282e
Reviewed-on: https://gerrit.libreoffice.org/71704
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst f1ba393a
......@@ -432,7 +432,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
uno::Sequence< OUString > aExtensions = aTypeNamePropsHM.getUnpackedValueOrDefault(
"Extensions",
::uno::Sequence< OUString >() );
if ( aExtensions.getLength() )
if ( aExtensions.hasElements() )
aExtension = aExtensions[0];
}
catch ( css::container::NoSuchElementException& )
......
......@@ -292,7 +292,7 @@ void SfxSecurityPage_Impl::Reset_Impl()
uno::Sequence< sal_Int8 > aPasswordHash;
// check if password is available
if (pCurDocShell->GetProtectionHash( aPasswordHash ) &&
aPasswordHash.getLength() > 0)
aPasswordHash.hasElements())
m_bOrigPasswordIsConfirmed = false; // password found, needs to be confirmed later on
}
else
......
......@@ -235,7 +235,7 @@ bool SaveOlePropertySet(
rGlobSect.SetStringValue( PROPID_REVNUMBER,
OUString::number( i_xDocProps->getEditingCycles() ) );
if ( i_pThumb && i_pThumb->getLength() )
if ( i_pThumb && i_pThumb->hasElements() )
rGlobSect.SetThumbnailValue( PROPID_THUMBNAIL, *i_pThumb );
// save the property set
......
......@@ -171,7 +171,7 @@ static void impl_FillURLList( sfx2::FileDialogHelper const * _pFileDlg, std::vec
Sequence < OUString > aPathSeq = _pFileDlg->GetSelectedFiles();
if ( aPathSeq.getLength() )
if ( aPathSeq.hasElements() )
{
_rpURLList.clear();
......
......@@ -311,7 +311,7 @@ namespace sfx2
const OUString aStdLibName( "Standard" );
const OUString aVBAProject( "VBAProject" );
Sequence< OUString > aElements = xContainer->getElementNames();
if ( aElements.getLength() )
if ( aElements.hasElements() )
{
sal_Int32 nElements = aElements.getLength();
for( sal_Int32 i = 0; i < nElements; ++i )
......
......@@ -1352,7 +1352,7 @@ OUString SfxDocTplService_Impl::CreateNewGroupFsys( const OUString& rGroupName,
{
OUString aResultURL;
if ( maTemplateDirs.getLength() )
if ( maTemplateDirs.hasElements() )
{
OUString aTargetPath = maTemplateDirs[ maTemplateDirs.getLength() - 1 ];
......@@ -1509,7 +1509,7 @@ bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName )
if ( aGroupTargetURL.isEmpty() )
return false; // nothing is allowed to be removed
if ( !maTemplateDirs.getLength() )
if ( !maTemplateDirs.hasElements() )
return false;
// check that the fs location is in writable folder and this is not a "My templates" folder
......@@ -1622,7 +1622,7 @@ bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
if ( aGroupTargetURL.isEmpty() )
return false;
if ( !maTemplateDirs.getLength() )
if ( !maTemplateDirs.hasElements() )
return false;
// check that the fs location is in writable folder and this is not a "My templates" folder
......@@ -1723,7 +1723,7 @@ bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
if ( getProperty( aTemplateToRemove, TARGET_URL, aValue ) )
aValue >>= aTemplateToRemoveTargetURL;
if ( aGroupTargetURL.isEmpty() || !maTemplateDirs.getLength()
if ( aGroupTargetURL.isEmpty() || !maTemplateDirs.hasElements()
|| (!aTemplateToRemoveTargetURL.isEmpty() && isInternalTemplateDir(aTemplateToRemoveTargetURL)) )
return false; // it is not allowed to remove the template
}
......@@ -1788,7 +1788,7 @@ bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
SequenceAsHashMap aTypeProps( xTypeDetection->getByName( aTypeName ) );
uno::Sequence< OUString > aAllExt =
aTypeProps.getUnpackedValueOrDefault("Extensions", Sequence< OUString >() );
if ( !aAllExt.getLength() )
if ( !aAllExt.hasElements() )
throw uno::RuntimeException();
const OUString aMediaType {aTypeProps.getUnpackedValueOrDefault("MediaType", OUString() )};
......
......@@ -434,7 +434,7 @@ const ::comphelper::SequenceAsHashMap& ModelData_Impl::GetModuleProps()
{
uno::Sequence< beans::PropertyValue > aModuleProps;
m_pOwner->GetModuleManager()->getByName( GetModuleName() ) >>= aModuleProps;
if ( !aModuleProps.getLength() )
if ( !aModuleProps.hasElements() )
throw uno::RuntimeException(); // TODO;
m_pModulePropsHM.reset( new ::comphelper::SequenceAsHashMap( aModuleProps ) );
}
......@@ -490,7 +490,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceDefaultFilter
{
uno::Sequence< beans::PropertyValue > aFilterProps;
uno::Sequence< beans::PropertyValue > aProps = GetDocServiceDefaultFilter();
if ( aProps.getLength() )
if ( aProps.hasElements() )
{
::comphelper::SequenceAsHashMap aFiltHM( aProps );
SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aFiltHM.getUnpackedValueOrDefault("Flags",
......@@ -547,7 +547,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetPreselectedFilter_Impl(
{
aFilterProps = GetDocServiceDefaultFilterCheckFlags( nMust, nDont );
if ( !aFilterProps.getLength() )
if ( !aFilterProps.hasElements() )
{
// the default filter was not found, use just the first acceptable one
aFilterProps = GetDocServiceAnyFilter( nMust, nDont );
......@@ -1136,13 +1136,13 @@ OUString ModelData_Impl::GetRecommendedExtension( const OUString& aTypeName )
if ( xTypeDetection.is() )
{
uno::Sequence< beans::PropertyValue > aTypeNameProps;
if ( ( xTypeDetection->getByName( aTypeName ) >>= aTypeNameProps ) && aTypeNameProps.getLength() )
if ( ( xTypeDetection->getByName( aTypeName ) >>= aTypeNameProps ) && aTypeNameProps.hasElements() )
{
::comphelper::SequenceAsHashMap aTypeNamePropsHM( aTypeNameProps );
uno::Sequence< OUString > aExtensions = aTypeNamePropsHM.getUnpackedValueOrDefault(
"Extensions",
::uno::Sequence< OUString >() );
if ( aExtensions.getLength() )
if ( aExtensions.hasElements() )
return aExtensions[0];
}
}
......@@ -1422,8 +1422,8 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
// preselect a filter for the storing process
uno::Sequence< beans::PropertyValue > aFilterProps = aModelData.GetPreselectedFilter_Impl( nStoreMode );
DBG_ASSERT( aFilterProps.getLength(), "No filter for storing!\n" );
if ( !aFilterProps.getLength() )
DBG_ASSERT( aFilterProps.hasElements(), "No filter for storing!\n" );
if ( !aFilterProps.hasElements() )
throw task::ErrorCodeIOException(
"SfxStoringHelper::GUIStoreModel: ERRCODE_IO_INVALIDPARAMETER",
uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_INVALIDPARAMETER));
......
......@@ -149,7 +149,7 @@ IFrameObject::IFrameObject(const uno::Reference < uno::XComponentContext >& rxCo
: mxContext( rxContext )
, maPropMap( lcl_GetIFramePropertyMap_Impl() )
{
if ( aArguments.getLength() )
if ( aArguments.hasElements() )
aArguments[0] >>= mxObj;
}
......
......@@ -1060,7 +1060,7 @@ void SfxObjectShell::FinishedLoading( SfxLoadedFlags nFlags )
pImpl->nFlagsInProgress |= SfxLoadedFlags::MAINDOCUMENT;
static_cast<SfxHeaderAttributes_Impl*>(GetHeaderAttributes())->SetAttributes();
if ( ( GetModifyPasswordHash() || GetModifyPasswordInfo().getLength() ) && !IsModifyPasswordEntered() )
if ( ( GetModifyPasswordHash() || GetModifyPasswordInfo().hasElements() ) && !IsModifyPasswordEntered() )
SetReadOnly();
// Salvage
......@@ -1758,7 +1758,7 @@ bool SfxObjectShell_Impl::hasTrustedScriptingSignature( bool bAllowUIToAddAuthor
{
uno::Sequence< security::DocumentSignatureInformation > aInfo = rDocShell.GetDocumentSignatureInformation( true, xSigner );
if ( aInfo.getLength() )
if ( aInfo.hasElements() )
{
if ( nScriptingSignatureState == SignatureState::UNKNOWN )
nScriptingSignatureState = SfxObjectShell::ImplCheckSignaturesInformation( aInfo );
......
......@@ -516,7 +516,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
pDocInfoItem->UpdateDocumentInfo(getDocProperties());
const uno::Sequence< document::CmisProperty >& aNewCmisProperties =
pDocInfoItem->GetCmisProperties( );
if ( aNewCmisProperties.getLength( ) > 0 )
if ( aNewCmisProperties.hasElements( ) )
xCmisDoc->updateCmisProperties( aNewCmisProperties );
SetUseUserData( pDocInfoItem->IsUseUserData() );
SetUseThumbnailSave( pDocInfoItem-> IsUseThumbnailSave() );
......
......@@ -679,7 +679,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
bWarnMediaTypeFallback = false;
}
if ( bWarnMediaTypeFallback || !xStorage->getElementNames().getLength() )
if ( bWarnMediaTypeFallback || !xStorage->getElementNames().hasElements() )
SetError(ERRCODE_IO_BROKENPACKAGE);
}
catch( uno::Exception& )
......@@ -1434,7 +1434,7 @@ bool SfxObjectShell::SaveTo_Impl
try
{
Sequence < util::RevisionTag > aVersions = rMedium.GetVersionList();
if ( aVersions.getLength() )
if ( aVersions.hasElements() )
{
// copy the version streams
const OUString aVersionsName( "Versions" );
......@@ -2908,7 +2908,7 @@ HiddenInformation SfxObjectShell::GetHiddenInformationState( HiddenInformation n
HiddenInformation nState = HiddenInformation::NONE;
if ( nStates & HiddenInformation::DOCUMENTVERSIONS )
{
if ( GetMedium()->GetVersionList().getLength() )
if ( GetMedium()->GetVersionList().hasElements() )
nState |= HiddenInformation::DOCUMENTVERSIONS;
}
......
......@@ -190,7 +190,7 @@ public:
explicit SfxOleThumbnailProperty( sal_Int32 nPropId,
const uno::Sequence<sal_Int8> & i_rData);
bool IsValid() const { return mData.getLength() > 0; }
bool IsValid() const { return mData.hasElements(); }
private:
virtual void ImplLoad( SvStream& rStrm ) override;
......@@ -211,7 +211,7 @@ class SfxOleBlobProperty : public SfxOlePropertyBase
public:
explicit SfxOleBlobProperty( sal_Int32 nPropId,
const uno::Sequence<sal_Int8> & i_rData);
bool IsValid() const { return mData.getLength() > 0; }
bool IsValid() const { return mData.hasElements(); }
private:
virtual void ImplLoad( SvStream& rStrm ) override;
......
......@@ -152,7 +152,7 @@ SfxPrintHelper::SfxPrintHelper()
void SAL_CALL SfxPrintHelper::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
{
if ( !aArguments.getLength() )
if ( !aArguments.hasElements() )
return;
css::uno::Reference < css::frame::XModel > xModel;
......
......@@ -1979,7 +1979,7 @@ Any SAL_CALL SfxBaseModel::getTransferData( const datatransfer::DataFlavor& aFla
const sal_uInt32 nLen = pStream->TellEnd();
Sequence< sal_Int8 > aSeq( nLen );
pStream->ReadBytes(aSeq.getArray(), nLen);
if( aSeq.getLength() )
if( aSeq.hasElements() )
aAny <<= aSeq;
}
catch ( Exception& )
......@@ -2944,7 +2944,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
if ( m_pData->m_pObjectShell->IsDocShared() )
{
uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.getUnpackedValueOrDefault("EncryptionData", uno::Sequence< beans::NamedValue >() );
if ( !aNewEncryptionData.getLength() )
if ( !aNewEncryptionData.hasElements() )
{
aNewEncryptionData = ::comphelper::OStorageHelper::CreatePackageEncryptionData( aArgHash.getUnpackedValueOrDefault("Password", OUString()) );
}
......@@ -2952,7 +2952,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
uno::Sequence< beans::NamedValue > aOldEncryptionData;
(void)GetEncryptionData_Impl( pMedium->GetItemSet(), aOldEncryptionData );
if ( !aOldEncryptionData.getLength() && !aNewEncryptionData.getLength() )
if ( !aOldEncryptionData.hasElements() && !aNewEncryptionData.hasElements() )
throw;
else
{
......
......@@ -166,7 +166,7 @@ namespace sfx2
);
aStrippedArguments.realloc( pStrippedArgsEnd - pStrippedArgs );
if ( aStrippedArguments.getLength() )
if ( aStrippedArguments.hasElements() )
{
Reference< XInitialization > xModelInit( xInstance, UNO_QUERY );
OSL_ENSURE( xModelInit.is(), "SfxModelFactory::createInstanceWithArguments: no XInitialization!" );
......
......@@ -162,10 +162,7 @@ sal_Bool SAL_CALL SfxEvents_Impl::hasElements()
{
::osl::MutexGuard aGuard( maMutex );
if ( maEventNames.getLength() )
return true;
else
return false;
return maEventNames.hasElements();
}
void SfxEvents_Impl::Execute( uno::Any const & aEventData, const document::DocumentEvent& aTrigger, SfxObjectShell* pDoc )
......
......@@ -1342,7 +1342,7 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
{
Sequence< PropertyValue > aViewData;
OSL_VERIFY( xViewData->getByIndex( nViewDataIndex ) >>= aViewData );
if ( aViewData.getLength() > 0 )
if ( aViewData.hasElements() )
m_pData->m_pViewShell->ReadUserDataSequence( aViewData );
}
}
......
......@@ -216,7 +216,7 @@ bool IsSignPDF(const SfxObjectShellRef& xObjSh)
bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHandler >& xHandler, const OUString& aPath, const std::shared_ptr<const SfxFilter>& pFilter, sal_uInt32 nPasswordHash, const uno::Sequence< beans::PropertyValue >& aInfo )
{
// TODO/LATER: In future the info should replace the direct hash completely
bool bResult = ( !nPasswordHash && !aInfo.getLength() );
bool bResult = ( !nPasswordHash && !aInfo.hasElements() );
SAL_WARN_IF( !(pFilter && ( pFilter->GetFilterFlags() & SfxFilterFlags::PASSWORDTOMODIFY )), "sfx.view",
"PasswordToModify feature is active for a filter that does not support it!");
......@@ -242,7 +242,7 @@ bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHandler >
if ( pPasswordRequest->isPassword() )
{
if ( aInfo.getLength() )
if ( aInfo.hasElements() )
{
bResult = ::comphelper::DocPasswordHelper::IsModifyPasswordCorrect( pPasswordRequest->getPasswordToModify(), aInfo );
}
......@@ -358,7 +358,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
else
{
if ( pSh->IsReadOnlyMedium()
&& ( pSh->GetModifyPasswordHash() || pSh->GetModifyPasswordInfo().getLength() )
&& ( pSh->GetModifyPasswordHash() || pSh->GetModifyPasswordInfo().hasElements() )
&& !pSh->IsModifyPasswordEntered() )
{
const OUString aDocumentName = INetURLObject( pMed->GetOrigURL() ).GetMainURL( INetURLObject::DecodeMechanism::WithCharset );
......@@ -1896,7 +1896,7 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc
{
Reference< XModel > xDocument( i_rDoc.GetModel(), UNO_SET_THROW );
::comphelper::NamedValueCollection aTransformLoadArgs( i_rLoadArgs.getLength() ? i_rLoadArgs : xDocument->getArgs() );
::comphelper::NamedValueCollection aTransformLoadArgs( i_rLoadArgs.hasElements() ? i_rLoadArgs : xDocument->getArgs() );
aTransformLoadArgs.put( "Model", xDocument );
if ( i_nViewId )
aTransformLoadArgs.put( "ViewId", sal_uInt16( i_nViewId ) );
......
......@@ -305,7 +305,7 @@ void SfxViewFrame::GetState_Impl( SfxItemSet &rSet )
break;
case SID_OBJECT:
if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() )
if ( GetViewShell() && GetViewShell()->GetVerbs().hasElements() && !GetObjectShell()->IsInPlaceActive() )
{
uno::Any aAny(GetViewShell()->GetVerbs());
rSet.Put( SfxUnoAnyItem( sal_uInt16( SID_OBJECT ), aAny ) );
......
......@@ -126,16 +126,16 @@ Any SAL_CALL CmdMailMsg::getByName( const OUString& aName )
else if( aName == "to" && !m_aRecipient.isEmpty() )
return makeAny( m_aRecipient );
else if( aName == "cc" && m_CcRecipients.getLength() )
else if( aName == "cc" && m_CcRecipients.hasElements() )
return makeAny( m_CcRecipients );
else if( aName == "bcc" && m_BccRecipients.getLength() )
else if( aName == "bcc" && m_BccRecipients.hasElements() )
return makeAny( m_BccRecipients );
else if( aName == "subject" && !m_aSubject.isEmpty() )
return makeAny( m_aSubject );
else if( aName == "attachment" && m_Attachments.getLength() )
else if( aName == "attachment" && m_Attachments.hasElements() )
return makeAny( m_Attachments );
throw NoSuchElementException("key not found: " + aName,
......@@ -158,16 +158,16 @@ Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames( )
if( !m_aRecipient.isEmpty() )
aRet[nItems++] = "to";
if( m_CcRecipients.getLength() )
if( m_CcRecipients.hasElements() )
aRet[nItems++] = "cc";
if( m_BccRecipients.getLength() )
if( m_BccRecipients.hasElements() )
aRet[nItems++] = "bcc";
if( !m_aSubject.isEmpty() )
aRet[nItems++] = "subject";
if( m_Attachments.getLength() )
if( m_Attachments.hasElements() )
aRet[nItems++] = "attachment";
aRet.realloc( nItems );
......@@ -187,16 +187,16 @@ Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames( )
else if( aName == "to" && !m_aRecipient.isEmpty() )
return true;
else if( aName == "cc" && m_CcRecipients.getLength() )
else if( aName == "cc" && m_CcRecipients.hasElements() )
return true;
else if( aName == "bcc" && m_BccRecipients.getLength() )
else if( aName == "bcc" && m_BccRecipients.hasElements() )
return true;
else if( aName == "subject" && !m_aSubject.isEmpty() )
return true;
else if( aName == "attachment" && m_Attachments.getLength() )
else if( aName == "attachment" && m_Attachments.hasElements() )
return true;
return false;
......@@ -210,7 +210,7 @@ Type SAL_CALL CmdMailMsg::getElementType( )
sal_Bool SAL_CALL CmdMailMsg::hasElements( )
{
return 0 != getElementNames().getLength();
return getElementNames().hasElements();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1337,7 +1337,7 @@ void SmViewShell::Insert( SfxMedium& rMedium )
uno::Reference <embed::XStorage> xStorage = rMedium.GetStorage();
uno::Reference <container::XNameAccess> xNameAccess(xStorage, uno::UNO_QUERY);
if (xNameAccess.is() && xNameAccess->getElementNames().getLength())
if (xNameAccess.is() && xNameAccess->getElementNames().hasElements())
{
if (xNameAccess->hasByName("content.xml") || xNameAccess->hasByName("Content.xml"))
{
......
......@@ -268,7 +268,7 @@ sal_Bool CompoundIdlClassImpl::isAssignableFrom( const Reference< XIdlClass > &
else
{
const Sequence< Reference< XIdlClass > > & rSeq = xType->getSuperclasses();
if (rSeq.getLength())
if (rSeq.hasElements())
{
OSL_ENSURE( rSeq.getLength() == 1, "### unexpected len of super classes!" );
return isAssignableFrom( rSeq[0] );
......
......@@ -739,7 +739,7 @@ InterfaceIdlClassImpl::~InterfaceIdlClassImpl()
Sequence< Reference< XIdlClass > > InterfaceIdlClassImpl::getSuperclasses()
{
::osl::MutexGuard aGuard(getMutexAccess());
if (_xSuperClasses.getLength() == 0) {
if (!_xSuperClasses.hasElements()) {
typelib_InterfaceTypeDescription * pType = getTypeDescr();
_xSuperClasses.realloc(pType->nBaseTypes);
for (sal_Int32 i = 0; i < pType->nBaseTypes; ++i) {
......
......@@ -105,7 +105,7 @@ void deleteAllLinkReferences(const Reference < XSimpleRegistry >& xReg,
Sequence<OUString> linkNames = xKey->getAsciiListValue();
if (!linkNames.getLength())
if (!linkNames.hasElements())
return;
const OUString* pLinkNames = linkNames.getConstArray();
......@@ -156,7 +156,7 @@ void deleteAllLinkReferences(const Reference < XSimpleRegistry >& xReg,
{
xLinkParent = xReg->getRootKey()->openKey(aLinkParent);
if (xLinkParent.is() && (xLinkParent->getKeyNames().getLength() == 0))
if (xLinkParent.is() && !xLinkParent->getKeyNames().hasElements())
{
aLinkName = aLinkParent;
......@@ -165,7 +165,8 @@ void deleteAllLinkReferences(const Reference < XSimpleRegistry >& xReg,
sEnd = aLinkName.lastIndexOf( '/' );
aLinkParent = aLinkName.copy(0, sEnd);
} else
}
else
{
break;
}
......@@ -423,7 +424,7 @@ void deletePathIfPossible(const Reference < XRegistryKey >& xRootKey,
{
Sequence<OUString> keyNames(xRootKey->openKey(path)->getKeyNames());
if (keyNames.getLength() == 0 &&
if (!keyNames.hasElements() &&
xRootKey->openKey(path)->getValueType() == RegistryValueType_NOT_DEFINED)
{
xRootKey->deleteKey(path);
......@@ -555,7 +556,7 @@ void prepareUserKeys(const Reference < XSimpleRegistry >& xDest,
Sequence<OUString> keyNames = xKey->getKeyNames();
OUString relativKey;
if (keyNames.getLength())
if (keyNames.hasElements())
relativKey = keyNames.getConstArray()[0].copy(xKey->getKeyName().getLength()+1);
if (keyNames.getLength() == 1 &&
......@@ -579,7 +580,7 @@ void prepareUserKeys(const Reference < XSimpleRegistry >& xDest,
{
Sequence< Reference < XRegistryKey> > subKeys = xKey->openKeys();
if (subKeys.getLength())
if (subKeys.hasElements())
{
hasSubKeys = true;
const Reference < XRegistryKey > * pSubKeys = subKeys.getConstArray();
......@@ -629,7 +630,7 @@ void deleteAllImplementations( const Reference < XSimpleRegistry >& xReg,
{
Sequence < Reference < XRegistryKey > > subKeys = xSource->openKeys();
if (subKeys.getLength() > 0)
if (subKeys.hasElements())
{
const Reference < XRegistryKey> * pSubKeys = subKeys.getConstArray();
Reference < XRegistryKey > xImplKey;
......@@ -662,7 +663,7 @@ void deleteAllImplementations( const Reference < XSimpleRegistry >& xReg,
{
Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys();
if (subKeys2.getLength())
if (subKeys2.hasElements())
{
const Reference < XRegistryKey > * pSubKeys2 = subKeys2.getConstArray();
......@@ -692,7 +693,7 @@ void deleteAllImplementations( const Reference < XSimpleRegistry >& xReg,
}
subKeys = xSource->openKeys();
if (subKeys.getLength() == 0)
if (!subKeys.hasElements())
{
OUString path(xSource->getKeyName());
xSource->closeKey();
......@@ -777,7 +778,7 @@ void deleteAllServiceEntries( const Reference < XSimpleRegistry >& xReg,
{
Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys();
if (subKeys.getLength() > 0)
if (subKeys.hasElements())
{
const Reference < XRegistryKey > * pSubKeys = subKeys.getConstArray();
Reference < XRegistryKey > xServiceKey;
......@@ -832,7 +833,7 @@ void deleteAllServiceEntries( const Reference < XSimpleRegistry >& xReg,
}
subKeys = xSource->openKeys();
if (subKeys.getLength() == 0)
if (!subKeys.hasElements())
{
OUString path(xSource->getKeyName());
xSource->closeKey();
......@@ -992,7 +993,7 @@ void prepareRegistry(
{
Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys();
if (!subKeys.getLength())
if (!subKeys.hasElements())
{
throw InvalidRegistryException(
"prepareRegistry(): source registry is empty" );
......@@ -1037,7 +1038,7 @@ void prepareRegistry(
{
Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys();
if (subKeys2.getLength())
if (subKeys2.hasElements())
{
const Reference < XRegistryKey > * pSubKeys2 = subKeys2.getConstArray();
......@@ -1077,7 +1078,7 @@ void prepareRegistry(
// update link entries in REGISTRY_LINKS section
Sequence<OUString> linkNames = xKey->getAsciiListValue();
if (linkNames.getLength())
if (linkNames.hasElements())
{
const OUString* pLinkNames = linkNames.getConstArray();
......@@ -1103,7 +1104,7 @@ void findImplementations( const Reference < XRegistryKey > & xSource,
Reference < XRegistryKey > xKey = xSource->openKey(
slash_UNO_slash_SERVICES );
if (xKey.is() && (xKey->getKeyNames().getLength() > 0))
if (xKey.is() && xKey->getKeyNames().hasElements())
{
isImplKey = true;
......@@ -1126,7 +1127,7 @@ void findImplementations( const Reference < XRegistryKey > & xSource,
{
Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys();
if (subKeys.getLength() > 0)
if (subKeys.hasElements())
{
const Reference < XRegistryKey >* pSubKeys = subKeys.getConstArray();
......
......@@ -1978,7 +1978,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
{
// Get methods must not have any parameters
Sequence< Reference<XIdlClass> > getParams = rxMethod_i->getParameterTypes();
if( getParams.getLength() > 0 )
if( getParams.hasElements() )
{
continue;
}
......
......@@ -802,7 +802,7 @@ Reference< XInterface > FactoryImpl::createAdapter(
const Sequence< Type > & rTypes )
{
Reference< XInterface > xRet;
if (xReceiver.is() && rTypes.getLength())
if (xReceiver.is() && rTypes.hasElements())
{
t_ptr_set * adapter_set;
AdapterImpl * that;
......
......@@ -90,7 +90,7 @@ Sequence< OUString > retrieveAsciiValueList(
{
Sequence< OUString > seq2 = retrieveAsciiValueList( xTempReg, keyName );
if( seq2.getLength() )
if( seq2.hasElements() )
{
sal_Int32 n1Len = seq.getLength();
sal_Int32 n2Len = seq2.getLength();
......@@ -978,7 +978,7 @@ Reference<XEnumeration > OServiceManager::createContentEnumeration(
check_undisposed();
Sequence< Reference< XInterface > > factories(
OServiceManager::queryServiceFactories( aServiceName, m_xContext ) );
if (factories.getLength())
if (factories.hasElements())
return new ServiceEnumeration_Impl( factories );
else
return Reference< XEnumeration >();
......@@ -1371,7 +1371,7 @@ void ORegistryServiceManager::initialize(const Sequence< Any >& Arguments)
{
check_undisposed();
MutexGuard aGuard( m_mutex );
if (Arguments.getLength() > 0)
if (Arguments.hasElements())
{
m_xRootKey.clear();
Arguments[ 0 ] >>= m_xRegistry;
......@@ -1413,7 +1413,7 @@ Sequence< Reference< XInterface > > ORegistryServiceManager::queryServiceFactori
{
Sequence< Reference< XInterface > > ret(
OServiceManager::queryServiceFactories( aServiceName, xContext ) );
if (ret.getLength())
if (ret.hasElements())
{
return ret;
}
......
......@@ -146,7 +146,7 @@ void SvtCJKOptions_Impl::SetAll(bool bSet)
void SvtCJKOptions_Impl::Load()
{
Sequence<OUString> &rPropertyNames = PropertyNames::get();
if(!rPropertyNames.getLength())
if(!rPropertyNames.hasElements())
{
rPropertyNames.realloc(9);
OUString* pNames = rPropertyNames.getArray();
......
......@@ -230,7 +230,7 @@ void SvtCTLOptions_Impl::ImplCommit()
void SvtCTLOptions_Impl::Load()
{
Sequence< OUString >& rPropertyNames = PropertyNames::get();
if ( !rPropertyNames.getLength() )
if ( !rPropertyNames.hasElements() )
{
rPropertyNames.realloc(6);
OUString* pNames = rPropertyNames.getArray();
......
......@@ -199,7 +199,7 @@ SvtSystemLanguageOptions::SvtSystemLanguageOptions() :
uno::Sequence< OUString > aPropertyNames { "SystemLocale" };
uno::Sequence< uno::Any > aValues = GetProperties( aPropertyNames );
if ( aValues.getLength() )
if ( aValues.hasElements() )
{
aValues[0]>>= m_sWin16SystemLocale;
}
......
......@@ -135,11 +135,11 @@ void SAL_CALL OFSStreamContainer::release()
// XTypeProvider
uno::Sequence< uno::Type > SAL_CALL OFSStreamContainer::getTypes()
{
if ( m_aTypes.getLength() == 0 )
if ( !m_aTypes.hasElements() )