summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-12-17 14:44:51 +0100
committerAndras Timar <andras.timar@collabora.com>2021-04-08 16:42:03 +0200
commit61707d7b758a6555f9fec1eb8ccc928dd15cfd07 (patch)
treec6567675a0092ef63bd83f8d6dc0f664ab18411d
parentaac96250cfbae2a596438ec32a47c724e4a428ef (diff)
lok: don't use focus window to request help
Use clicked button instead - what leads to the correct window. If only focused window was taken into account sometimes it caused incorrect help link to be used. Change-Id: I645dc1ffa6a6d6d363ea5f9874fa830c441516c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107882 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108429 Tested-by: Jenkins
-rw-r--r--vcl/source/app/salvtables.cxx5
-rw-r--r--vcl/source/control/button.cxx2
-rw-r--r--vcl/source/window/dialog.cxx2
3 files changed, 4 insertions, 5 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 4b7ccce0153c..42912823c372 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -76,8 +76,7 @@
#include <window.h>
#include <wizdlg.hxx>
#include <salvtables.hxx>
-
-#include <boost/property_tree/ptree.hpp>
+#include <comphelper/lok.hxx>
SalFrame::SalFrame()
: m_pWindow(nullptr)
@@ -6850,7 +6849,7 @@ void SalInstanceWindow::help()
{
//show help for widget with keyboard focus
vcl::Window* pWidget = ImplGetSVData()->mpWinData->mpFocusWin;
- if (!pWidget)
+ if (!pWidget || comphelper::LibreOfficeKit::isActive())
pWidget = m_xWindow;
OString sHelpId = pWidget->GetHelpId();
while (sHelpId.isEmpty())
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 91a4aa4543a3..b2a7dc7cfdc2 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1753,7 +1753,7 @@ void HelpButton::Click()
if ( !GetClickHdl() )
{
vcl::Window* pFocusWin = Application::GetFocusWindow();
- if ( !pFocusWin )
+ if ( !pFocusWin || comphelper::LibreOfficeKit::isActive() )
pFocusWin = this;
HelpEvent aEvt( pFocusWin->GetPointerPosPixel(), HelpEventMode::CONTEXT );
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index e502c33caeb1..92528597e476 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1398,7 +1398,7 @@ IMPL_LINK(Dialog, ResponseHdl, Button*, pButton, void)
if (nResponse == RET_HELP)
{
vcl::Window* pFocusWin = Application::GetFocusWindow();
- if (!pFocusWin)
+ if (!pFocusWin || comphelper::LibreOfficeKit::isActive())
pFocusWin = pButton;
HelpEvent aEvt(pFocusWin->GetPointerPosPixel(), HelpEventMode::CONTEXT);
pFocusWin->RequestHelp(aEvt);