summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2022-01-24 19:49:30 +0300
committerVasily Melenchuk <vasily.melenchuk@cib.de>2022-01-24 19:49:30 +0300
commit6c2ec06c264f9c8d2e8eab011e82c3bebfe26815 (patch)
tree991c30c6a0d409870c03d1008e8c226ca86b1f1d /sfx2/source
parentad8d4ad6a60d596f865f158ad53dee617a0a1b48 (diff)
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
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/appserv.cxx13
1 files changed, 11 insertions, 2 deletions
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;