summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-30 13:45:12 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-09-03 16:34:51 +0200
commite6a0d77e144cf41459cc1124244638e562b8d0db (patch)
tree1fb36386e80cc4526af2941f7ac6e7e0e8eeb5aa /sfx2/source
parentb6b6d5c22e52c83af60eba077f0c5098f2198782 (diff)
tdf#119579 skip floating windows as potential parent for missing help dialog
Change-Id: Ibcee9a6aab0b04bf52f3e75a46f52d98864eee4c Reviewed-on: https://gerrit.libreoffice.org/59809 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/sfxhelp.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index c754cdb0d86f..8cf29fedbdf4 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -724,6 +724,21 @@ static bool impl_showOfflineHelp( const OUString& rURL )
return false;
}
+namespace
+{
+ // tdf#119579 skip floating windows as potential parent for missing help dialog
+ const vcl::Window* GetBestParent(const vcl::Window* pWindow)
+ {
+ while (pWindow)
+ {
+ if (pWindow->IsSystemWindow() && pWindow->GetType() != WindowType::FLOATINGWINDOW)
+ break;
+ pWindow = pWindow->GetParent();
+ }
+ return pWindow;
+ }
+}
+
bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const OUString& rKeyword)
{
OUStringBuffer aHelpRootURL("vnd.sun.star.help://");
@@ -824,6 +839,8 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
return true;
}
+ pWindow = GetBestParent(pWindow);
+
if ( !impl_hasHelpInstalled() )
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWindow ? pWindow->GetFrameWeld() : nullptr, "sfx/ui/helpmanual.ui"));