include/sfx2/objsh.hxx | 2 +- sfx2/source/doc/objmisc.cxx | 22 +++++++++++++++++++--- sfx2/source/doc/objstor.cxx | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-)
New commits: commit e60529fdfe0502f64e3c975f71539b28146943e8 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Fri May 26 15:44:37 2017 +0200 fix impress slide context menu regression from 4a340e36e8d3713806719351f455711c1254a178 "loplugin:constantparam" Change-Id: I3dc34fd438ba7f057e52e888e3ea8053a0b3ea78 Reviewed-on: https://gerrit.libreoffice.org/38073 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> 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() ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits