summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-02 22:56:03 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-03 10:08:31 +0200
commitf20810f7829d9f3b7167df316e1303810b746366 (patch)
tree8a6eb44060c5b4134c24d794e2af3b02b557d885 /sfx2
parentf1ba393af4f08f8502906c9221f8b6f1be2a7bad (diff)
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: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/mailmodel.cxx2
-rw-r--r--sfx2/source/dialog/securitypage.cxx2
-rw-r--r--sfx2/source/doc/docinf.cxx2
-rw-r--r--sfx2/source/doc/docinsert.cxx2
-rw-r--r--sfx2/source/doc/docmacromode.cxx2
-rw-r--r--sfx2/source/doc/doctemplates.cxx10
-rw-r--r--sfx2/source/doc/guisaveas.cxx14
-rw-r--r--sfx2/source/doc/iframe.cxx2
-rw-r--r--sfx2/source/doc/objmisc.cxx4
-rw-r--r--sfx2/source/doc/objserv.cxx2
-rw-r--r--sfx2/source/doc/objstor.cxx6
-rw-r--r--sfx2/source/doc/oleprops.cxx4
-rw-r--r--sfx2/source/doc/printhelper.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx6
-rw-r--r--sfx2/source/doc/sfxmodelfactory.cxx2
-rw-r--r--sfx2/source/notify/eventsupplier.cxx5
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx8
-rw-r--r--sfx2/source/view/viewfrm2.cxx2
19 files changed, 38 insertions, 41 deletions
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 498433ad9f42..8450baad99b4 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -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& )
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index d6db1818e7c6..fcafc1638afc 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -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
diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx
index 943b767151d1..6960064e147b 100644
--- a/sfx2/source/doc/docinf.cxx
+++ b/sfx2/source/doc/docinf.cxx
@@ -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
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index 7b64851e0071..aa9c4c6b3a33 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -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();
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index cc141f298264..41b25170b8a3 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -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 )
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 75dc7112002d..67702b9c0ef5 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -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() )};
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 5c8b57234319..9be232c8d6f5 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -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));
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index b12b78d80678..e9bc3f0aabe9 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -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;
}
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index a176a82ddf37..e0ea4437af31 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -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 );
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 7d5fa32738e6..c93fdb26a8f9 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -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() );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 6ef63cdfbdac..e0feb44ccfae 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -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;
}
diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx
index 474ba9976dd6..05f6c7721289 100644
--- a/sfx2/source/doc/oleprops.cxx
+++ b/sfx2/source/doc/oleprops.cxx
@@ -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;
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 5588fb983bf7..f485f5afae86 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -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;
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 4bd6ab5f83ed..2736a86f2d27 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -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
{
diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx
index 292e2fd480a2..9b2403d00e46 100644
--- a/sfx2/source/doc/sfxmodelfactory.cxx
+++ b/sfx2/source/doc/sfxmodelfactory.cxx
@@ -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!" );
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 840dff455584..0be25c894451 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -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 )
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 6f5671223e79..d143685d7c4b 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -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 );
}
}
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 71573f3e6fe1..897bd9f5b180 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -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 ) );
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index eb226aff59bd..7d62ef08c087 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -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 ) );