[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Feb 22 21:46:12 UTC 2019


 sfx2/source/view/viewfrm.cxx |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 84e1b8da1ea85e5e222e6d071a3fa8828e728721
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sat Mar 10 20:14:37 2018 +0300
Commit:     Aron Budea <aron.budea at collabora.com>
CommitDate: Fri Feb 22 21:37:15 2019 +0100

    tdf#116066: call DoSaveCompleted after SetReadOnlyUI
    
    Reviewed-on: https://gerrit.libreoffice.org/51051
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 7dd704ab1f41086f81136e3987fa7f9aed5ccf5f)
    
    Change-Id: Ided8f12764585b2ba62e4c296af43ac07b9e31ed

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 649d0671bb18..770b69d83815 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -293,7 +293,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()
                 {
                     if (m_bSetRO != m_pSh->IsReadOnlyUI())
@@ -301,9 +305,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();
 
@@ -540,8 +550,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