diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-04-26 16:15:32 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-05-04 10:18:40 +0200 |
commit | a5dae844003e80411ffbfe0d873fdccfb9c3d560 (patch) | |
tree | e9b1a5b33666638ebb1e47206da8cda9234b115e /sfx2 | |
parent | 96e42f06fbde7a52251fc9f0fede1790fc467ef6 (diff) |
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.stahl@allotropia.de>
(cherry picked from commit 2837bc81a4bc7fbc1421de78868a337ff8000edd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151114
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
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 ??? |