summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-03-10 20:14:37 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-04-03 11:37:29 +0200
commit7dd704ab1f41086f81136e3987fa7f9aed5ccf5f (patch)
treeea7774b0a57608f896fa3cd72292da459f2eff0a /sfx2/source
parent8c50aff2175e85c54957d98ce32af40a3a87e168 (diff)
tdf#116066: call DoSaveCompleted after SetReadOnlyUI
Change-Id: Ided8f12764585b2ba62e4c296af43ac07b9e31ed Reviewed-on: https://gerrit.libreoffice.org/51051 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/view/viewfrm.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index c61076dfa0f1..a38e47f518a3 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -275,7 +275,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
{
SfxViewFrame* m_pFrame;
SfxObjectShell* m_pSh;
+ SfxMedium* m_pMed = nullptr;
bool m_bSetRO;
+ ReadOnlyUIGuard(SfxViewFrame* pFrame, SfxObjectShell* p_Sh)
+ : m_pFrame(pFrame), m_pSh(p_Sh), m_bSetRO(p_Sh->IsReadOnlyUI())
+ {}
~ReadOnlyUIGuard() COVERITY_NOEXCEPT_FALSE
{
if (m_bSetRO != m_pSh->IsReadOnlyUI())
@@ -283,9 +287,15 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
m_pSh->SetReadOnlyUI(m_bSetRO);
if (!m_bSetRO)
m_pFrame->RemoveInfoBar("readonly");
+ if (m_pMed)
+ {
+ // tdf#116066: DoSaveCompleted should be called after SetReadOnlyUI
+ m_pSh->DoSaveCompleted(m_pMed);
+ m_pSh->Broadcast(SfxHint(SfxHintId::ModeChanged));
+ }
}
}
- } aReadOnlyUIGuard{ this, pSh, pSh->IsReadOnlyUI() };
+ } aReadOnlyUIGuard(this, pSh);
SfxMedium* pMed = pSh->GetMedium();
@@ -522,8 +532,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
else
{
- pSh->DoSaveCompleted( pMed );
- pSh->Broadcast( SfxHint(SfxHintId::ModeChanged) );
+ aReadOnlyUIGuard.m_pMed = pMed;
rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), true ) );
rReq.Done( true );
return;