diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-28 12:32:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-28 21:10:34 +0200 |
commit | 091f244d4d68ea9973a502632c6aeee19d702139 (patch) | |
tree | 9ebd536d2575385e75c0543eb14c6ee66f83d20c /sw/source/uibase/docvw/AnnotationMenuButton.cxx | |
parent | fb48e9cca4b4ba26d20e1fdd0f9ee65e7ef54210 (diff) |
Related: tdf#136985 restore focus to doc it wasn't initially in the comment
after processing a menu command if we grabbed focus to a comment at the start
of the the menu command processing
Change-Id: I6cf4b59fc0c5d3e09578cb0466b15ae358cfb0ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103547
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase/docvw/AnnotationMenuButton.cxx')
-rw-r--r-- | sw/source/uibase/docvw/AnnotationMenuButton.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx index 9ee6ac0ec805..663141839d00 100644 --- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx +++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx @@ -72,7 +72,7 @@ void AnnotationMenuButton::Select() // tdf#136682 ensure this is the currently active sidebar win so the command // operates in an active sidebar context - mrSidebarWin.SetActiveSidebarWin(); + bool bSwitchedFocus = mrSidebarWin.SetActiveSidebarWin(); if (sIdent == "reply") mrSidebarWin.ExecuteCommand(FN_REPLY); @@ -90,6 +90,10 @@ void AnnotationMenuButton::Select() mrSidebarWin.ExecuteCommand(FN_DELETE_ALL_NOTES); else if (sIdent == "formatall") mrSidebarWin.ExecuteCommand(FN_FORMAT_ALL_NOTES); + + if (bSwitchedFocus) + mrSidebarWin.UnsetActiveSidebarWin(); + mrSidebarWin.GrabFocusToDocument(); } void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt ) |