fix impress slide context menu
regression from 4a340e36e8d3713806719351f455711c1254a178
"loplugin:constantparam"
Change-Id: I3dc34fd438ba7f057e52e888e3ea8053a0b3ea78
Reviewed-on: https://gerrit.libreoffice.org/38073
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 41845be..f3c916c 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -458,7 +458,7 @@ public:
// Transfer IFace
bool IsAbortingImport() const;
void FinishedLoading();
void FinishedLoading( SfxLoadedFlags nWhich = SfxLoadedFlags::ALL );
virtual void SetFormatSpecificCompatibilityOptions( const OUString& /*rFilterTypeName*/ ) { /* Do not do anything here; Derived classes must overload to do actual work */ };
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index f0f20c5..74a419b 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1045,7 +1045,7 @@ void SfxObjectShell::InitOwnModel_Impl()
}
}
void SfxObjectShell::FinishedLoading()
void SfxObjectShell::FinishedLoading( SfxLoadedFlags nFlags )
{
std::shared_ptr<const SfxFilter> pFlt = pMedium->GetFilter();
if( pFlt )
@@ -1055,7 +1055,7 @@ void SfxObjectShell::FinishedLoading()
bool bSetModifiedTRUE = false;
const SfxStringItem* pSalvageItem = SfxItemSet::GetItem<SfxStringItem>(pMedium->GetItemSet(), SID_DOC_SALVAGE, false);
if( !(pImpl->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT )
if( ( nFlags & SfxLoadedFlags::MAINDOCUMENT ) && !(pImpl->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT )
&& !(pImpl->nFlagsInProgress & SfxLoadedFlags::MAINDOCUMENT ))
{
pImpl->nFlagsInProgress |= SfxLoadedFlags::MAINDOCUMENT;
@@ -1083,7 +1083,23 @@ void SfxObjectShell::FinishedLoading()
pImpl->nFlagsInProgress &= ~SfxLoadedFlags::MAINDOCUMENT;
}
pImpl->nLoadedFlags |= SfxLoadedFlags::MAINDOCUMENT;
if( ( nFlags & SfxLoadedFlags::IMAGES ) && !(pImpl->nLoadedFlags & SfxLoadedFlags::IMAGES )
&& !(pImpl->nFlagsInProgress & SfxLoadedFlags::IMAGES ))
{
pImpl->nFlagsInProgress |= SfxLoadedFlags::IMAGES;
uno::Reference<document::XDocumentProperties> xDocProps(
getDocProperties());
const OUString url(xDocProps->getAutoloadURL());
sal_Int32 delay(xDocProps->getAutoloadSecs());
SetAutoLoad( INetURLObject(url), delay * 1000,
(delay > 0) || !url.isEmpty() );
if( !bSetModifiedTRUE && IsEnableSetModified() )
SetModified( false );
Invalidate( SID_SAVEASDOC );
pImpl->nFlagsInProgress &= ~SfxLoadedFlags::IMAGES;
}
pImpl->nLoadedFlags |= nFlags;
if ( pImpl->nFlagsInProgress == SfxLoadedFlags::NONE )
{
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index f4db742..759cc16 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -830,7 +830,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
if ( !( pImpl->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) &&
( !pMedium->GetFilter() || pMedium->GetFilter()->UsesStorage() )
)
FinishedLoading();
FinishedLoading( SfxLoadedFlags::MAINDOCUMENT );
if( IsOwnStorageFormat(*pMed) && pMed->GetFilter() )
{