sfx2/source/view/viewfrm.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit a5dae844003e80411ffbfe0d873fdccfb9c3d560
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Apr 26 16:15:32 2023 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu May 4 10:18:40 2023 +0200

    tdf#151715 sfx2: do not use FORCERELOAD for document stored in /tmp
    
    This does not fix the actual bug, but is a workaround for a bug
    somewhere in the Notebookbar code that was exposed by commit
    5b5fb5e9c0580ecb70cf65882865bdaf16498fa5 "sfx2: do reload on SID_EDITDOC
    in SfxViewFrame::ExecReload_Impl()".
    
    For an ODF file, the Notebookbar is switched to editable by the call to
    SetReadOnlyUI() from ReadOnlyUIGuard, but the XLS file takes a different
    path and SetReadOnlyUI() is called in line 819.
    
    Here the SfxViewFrame is not yet connected to the SfxObjectShell so
    unsurprisingly it does not affect the UI; more surprising is that moving
    the call to around line 859 leads to the SfxHintId::ModeChanged event
    being handled in SfxViewFrame::Notify() with lots of things invalidated,
    but the NotebookBar is entirely unimpressed by that.
    
    Change-Id: I16f321bb3444eeae76348e20816af02938c3f46b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151089
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 2837bc81a4bc7fbc1421de78868a337ff8000edd)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151114
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index f20d4932494a..7effa9cc301b 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -595,7 +595,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
             }
 
             rReq.AppendItem( SfxBoolItem(SID_FORCERELOAD,
-                    rReq.GetSlot() == SID_EDITDOC || bNeedsReload) );
+                    (rReq.GetSlot() == SID_EDITDOC
+                     // tdf#151715 exclude files loaded from /tmp to avoid 
Notebookbar bugs
+                     && (!pSh->IsOriginallyReadOnlyMedium() || 
pSh->IsOriginallyLoadedReadOnlyMedium()))
+                    || bNeedsReload) );
             rReq.AppendItem( SfxBoolItem( SID_SILENT, true ));
 
             [[fallthrough]]; //TODO ???

Reply via email to