diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-26 15:44:37 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-05-26 16:21:48 +0200 |
commit | e60529fdfe0502f64e3c975f71539b28146943e8 (patch) | |
tree | 902400001f5b699bbda21763a345ecc1be6a49de | |
parent | 8119d0ceb7e5d4c6dba406c998ad05f143f36f67 (diff) |
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>
-rw-r--r-- | include/sfx2/objsh.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 22 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 2 |
3 files changed, 21 insertions, 5 deletions
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 41845be86310..f3c916c28b1e 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 f0f20c59ad9e..74a419b93c7f 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 f4db742b728e..759cc16b987c 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() ) { |