diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-22 11:52:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-22 15:29:02 +0200 |
commit | 66e234549a15cad1b5b61661fb28c7f827ed6e8b (patch) | |
tree | 98f700f7551082a26331da03db22a2e01f2e4953 /sd | |
parent | bb59b4165456d13eda800098be8b875d93b093d3 (diff) |
Resolves: tdf#140361 use the DisableEditHyperlink state as of menu launch time
at context menu popup time set if the EditHyperlink entry should be
disabled and use that state if queried about it if EditHyperlink is
dispatched from the menu. So ignoring where the mouse currently happens
to be when the menu was dismissed.
The dispatch is done async, if at all, so also trigger an async Query
with Invalidate so at least one Query is ensured to reset the stored
state
similar to tdf#137445 which was for impress/draw
Change-Id: I43a144f1ac0a4db89cc5ab0ebeeae744719f5958
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117636
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/DrawViewShell.hxx | 5 | ||||
-rw-r--r-- | sd/source/ui/view/drviews4.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 288cf24866de..d98164505a93 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -497,7 +497,10 @@ private: void ConfigureAppBackgroundColor( svtools::ColorConfig* pColorConfig = nullptr ); /// return true if "Edit Hyperlink" in context menu should be disabled - bool ShouldDisableEditHyperlink(); + bool ShouldDisableEditHyperlink() const; + /// force "Edit Hyperlink" to true, with the expectation that SID_EDIT_HYPERLINK is + /// later Invalidated to reset it back to its natural value + void EnableEditHyperlink(); // The colour of the area behind the slide (used to be called "Wiese") Color mnAppBackgroundColor; diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 2baed5669dae..ad5d7411a35e 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -832,7 +832,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) { SfxBindings& rBindings = GetViewFrame()->GetBindings(); // tdf#137445 set what the menu popup state for this was - moAtContextMenu_DisableEditHyperlink = bShouldDisableEditHyperlink; + EnableEditHyperlink(); // ensure moAtContextMenu_DisableEditHyperlink will be cleared // in the case that EditHyperlink is not dispatched by the menu rBindings.Invalidate(SID_EDIT_HYPERLINK); @@ -845,6 +845,11 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) } } +void DrawViewShell::EnableEditHyperlink() +{ + moAtContextMenu_DisableEditHyperlink = false; +} + void DrawViewShell::ShowMousePosInfo(const ::tools::Rectangle& rRect, ::sd::Window const * pWin) { diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 141910870d63..dcc57a2ae247 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -282,7 +282,7 @@ void DrawViewShell::GetMarginProperties( SfxItemSet &rSet ) } } -bool DrawViewShell::ShouldDisableEditHyperlink() +bool DrawViewShell::ShouldDisableEditHyperlink() const { if (!mpDrawView) return true; |