diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-04-26 16:15:32 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-04-27 15:44:57 +0200 |
commit | ed4d4d47ea322236199b1f8ff97ddd945b099cbe (patch) | |
tree | ad81cff0cf55f2aad10966fcef0d5d0d94d1d689 /sfx2 | |
parent | a772976f047882918d5386a3ef9226c4aa2aa118 (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>
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 e5bf83088468..d62090bad118 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -596,7 +596,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 ??? |