[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/inc sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Sep 28 03:19:46 UTC 2020
sw/inc/AnnotationWin.hxx | 3 +++
sw/source/uibase/docvw/AnnotationMenuButton.cxx | 7 +++++++
sw/source/uibase/docvw/AnnotationWin2.cxx | 15 +++++++++++----
3 files changed, 21 insertions(+), 4 deletions(-)
New commits:
commit 730b66f96431a1469ac280eccdc2d24d9d41e4fe
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 17 11:24:37 2020 +0100
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Mon Sep 28 05:19:14 2020 +0200
tdf#136682 set the sidebar of the menubutton as active on execute command
so the command will be executed on the expected sidebar window
Change-Id: Ic7ffe363005292edeb93c5a1220a9bcb97096c4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102772
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index 080d8de42ef0..32630399c9d0 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -194,6 +194,9 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window
bool IsResolved() const;
bool IsThreadResolved();
+ // Set this SwAnnotationWin as the currently active one
+ void SetActiveSidebarWin();
+
/// Find the first annotation for the thread which this annotation is in.
/// This may be the same annotation as this one.
SwAnnotationWin* GetTopReplyNote();
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index f56e745c1641..58e4f7a8a610 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -67,6 +67,13 @@ void AnnotationMenuButton::dispose()
void AnnotationMenuButton::Select()
{
OString sIdent = GetCurItemIdent();
+ if (sIdent.isEmpty())
+ return;
+
+ // tdf#136682 ensure this is the currently active sidebar win so the command
+ // operates in an active sidebar context
+ mrSidebarWin.SetActiveSidebarWin();
+
if (sIdent == "reply")
mrSidebarWin.ExecuteCommand(FN_REPLY);
if (sIdent == "resolve" || sIdent == "unresolve")
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 2801159850ad..f74ff69fdb25 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1326,14 +1326,21 @@ IMPL_LINK( SwAnnotationWin, WindowEventListener, VclWindowEvent&, rEvent, void )
else if ( rEvent.GetId() == VclEventId::WindowActivate &&
rEvent.GetWindow() == mpSidebarTextControl )
{
- const bool bLockView = mrView.GetWrtShell().IsViewLocked();
- mrView.GetWrtShell().LockView( true );
- mrMgr.SetActiveSidebarWin( this );
- mrView.GetWrtShell().LockView( bLockView );
+ SetActiveSidebarWin();
mrMgr.MakeVisible( this );
}
}
+void SwAnnotationWin::SetActiveSidebarWin()
+{
+ if (mrMgr.GetActiveSidebarWin() == this)
+ return;
+ const bool bLockView = mrView.GetWrtShell().IsViewLocked();
+ mrView.GetWrtShell().LockView( true );
+ mrMgr.SetActiveSidebarWin(this);
+ mrView.GetWrtShell().LockView( bLockView );
+}
+
IMPL_LINK(SwAnnotationWin, ScrollHdl, ScrollBar*, pScroll, void)
{
long nDiff = GetOutlinerView()->GetEditView().GetVisArea().Top() - pScroll->GetThumbPos();
More information about the Libreoffice-commits
mailing list