sfx2/source/appl/appserv.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
New commits: commit 6c2ec06c264f9c8d2e8eab011e82c3bebfe26815 Author: Vasily Melenchuk <[email protected]> AuthorDate: Mon Jan 24 19:49:30 2022 +0300 Commit: Vasily Melenchuk <[email protected]> CommitDate: Mon Jan 24 19:49:30 2022 +0300 tdf#140020: fix patch for 6.4 version Since 6.4 does not have 65404e2c72ea2 commit, we need another implementation for isSaveLocked() Change-Id: I76d68d57fe8af297bb7e57f86916aa52d531c783 diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 0ddff776ff86..91fd8d941b58 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -236,6 +236,15 @@ namespace TOOLS_INFO_EXCEPTION( "sfx.appl", "trying to load bibliography database"); } } + bool lcl_isSaveLocked(SfxObjectShell * pShell) + { + assert(pShell); + Reference<XModel> xModel = pShell->GetModel(); + if (!xModel.is()) + return false; + comphelper::NamedValueCollection aArgs(xModel->getArgs()); + return aArgs.getOrDefault("LockSave", false); + } } /// Find the correct location of the document (CREDITS.fodt, etc.), and return /// it in rURL if found. @@ -524,7 +533,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) pObjSh = SfxObjectShell::GetNext( *pObjSh ) ) { SfxRequest aReq( SID_SAVEDOC, SfxCallMode::SLOT, pObjSh->GetPool() ); - if ( pObjSh->IsModified() && !pObjSh->isSaveLocked()) + if ( pObjSh->IsModified() && !lcl_isSaveLocked(pObjSh) ) { pObjSh->ExecuteSlot( aReq ); const SfxBoolItem *pItem = dynamic_cast<const SfxBoolItem*>( aReq.GetReturnValue() ); @@ -1094,7 +1103,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) pObjSh; pObjSh = SfxObjectShell::GetNext( *pObjSh ) ) { - if ( pObjSh->IsModified() && !pObjSh->isSaveLocked() ) + if ( pObjSh->IsModified() && !lcl_isSaveLocked(pObjSh) ) { bModified = true; break;
