[Libreoffice-commits] core.git: sfx2/source
Mike Kaganski
mike.kaganski at collabora.com
Tue Apr 3 09:37:50 UTC 2018
sfx2/source/view/viewfrm.cxx | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
New commits:
commit 7dd704ab1f41086f81136e3987fa7f9aed5ccf5f
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date: Sat Mar 10 20:14:37 2018 +0300
tdf#116066: call DoSaveCompleted after SetReadOnlyUI
Change-Id: Ided8f12764585b2ba62e4c296af43ac07b9e31ed
Reviewed-on: https://gerrit.libreoffice.org/51051
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
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;
More information about the Libreoffice-commits
mailing list