diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-12-02 12:56:43 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-12-02 21:17:59 +0100 |
commit | d4c22030d7c83de6f1835cdb5d891c2d563c34fd (patch) | |
tree | 6b8f661797ff6da3d9cc6f6188643940b1497ae6 /vcl | |
parent | 260c50e252abf6f4d523d9ed1c11fa407277087f (diff) |
tdf#129068 try dialog content area help before dialog itself
we already check current notebook page before the dialog, now
check the content area before the dialog
Change-Id: Ieedb5727ddec6d24adc6e70144977b5c3063c0fd
Reviewed-on: https://gerrit.libreoffice.org/84247
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 14 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 24 |
2 files changed, 38 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index fa8777493cb1..de9b7a8040e2 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -6461,6 +6461,20 @@ void SalInstanceWindow::help() OString sPageId = m_pBuilder->get_current_page_help_id(); if (!sPageId.isEmpty()) sHelpId = sPageId; + else + { + // tdf#129068 likewise the help for the wrapping dialog is less + // helpful than the help for the content area could be + vcl::Window *pContentArea = nullptr; + if (::Dialog* pDialog = dynamic_cast<::Dialog*>(m_xWindow.get())) + pContentArea = pDialog->get_content_area(); + if (pContentArea) + { + vcl::Window* pContentWidget = pContentArea->GetWindow(GetWindowType::LastChild); + if (pContentWidget) + sHelpId = pContentWidget->GetHelpId(); + } + } } pHelp->Start(OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), pSource); } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 2b101adaabde..643502e6368f 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -13012,6 +13012,30 @@ void GtkInstanceWindow::help() OString sPageId = m_pBuilder->get_current_page_help_id(); if (!sPageId.isEmpty()) sHelpId = sPageId; + else + { + // tdf#129068 likewise the help for the wrapping dialog is less + // helpful than the help for the content area could be + GtkContainer* pContainer = nullptr; + if (GTK_IS_DIALOG(m_pWindow)) + pContainer = GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(m_pWindow))); + else if (GTK_IS_ASSISTANT(m_pWindow)) + { + GtkAssistant* pAssistant = GTK_ASSISTANT(m_pWindow); + pContainer = GTK_CONTAINER(gtk_assistant_get_nth_page(pAssistant, gtk_assistant_get_current_page(pAssistant))); + } + if (pContainer) + { + GList* pChildren = gtk_container_get_children(pContainer); + GList* pChild = g_list_first(pChildren); + if (pChild) + { + GtkWidget* pContentWidget = static_cast<GtkWidget*>(pChild->data); + sHelpId = ::get_help_id(pContentWidget); + } + g_list_free(pChildren); + } + } } pHelp->Start(OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), pSource); } |