summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-02-18 13:50:15 +0000
committerMichael Stahl <Michael.Stahl@cib.de>2019-02-19 18:28:39 +0100
commit3432a0c5bb94e5c6f4dfa62e6f26939e69b8c6b8 (patch)
tree358282ad1737ad13d299e2d03dcc41d79428b087 /sfx2
parent62c1acdda27966c810cab25a1d0667c6a18c436d (diff)
Resolves: tdf#122355 search help for active notebook page
before checking for the dialog, to get more specific help results. Change-Id: I2d6128fa39d3f7ebf15e194354307dd924590009 Reviewed-on: https://gerrit.libreoffice.org/67981 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/sfxhelp.cxx34
1 files changed, 15 insertions, 19 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 169d6a641425..03de650df70e 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -1243,26 +1243,22 @@ bool SfxHelp::Start_Impl(const OUString& rURL, weld::Widget* pWidget, const OUSt
if ( impl_hasHelpInstalled() && pWidget && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
{
- // no help found -> try with parent help id.
- std::unique_ptr<weld::Widget> xParent(pWidget->weld_parent());
- while (xParent)
+ bool bUseFinalFallback = true;
+ // no help found -> try ids of parents.
+ pWidget->help_hierarchy_foreach([&aHelpModuleName, &aHelpURL, &bUseFinalFallback](const OString& rHelpId){
+ if (rHelpId.isEmpty())
+ return false;
+ aHelpURL = CreateHelpURL( OStringToOUString(rHelpId, RTL_TEXTENCODING_UTF8), aHelpModuleName);
+ bool bFinished = !SfxContentHelper::IsHelpErrorDocument(aHelpURL);
+ if (bFinished)
+ bUseFinalFallback = false;
+ return bFinished;
+ });
+
+ if (bUseFinalFallback)
{
- OString aHelpId = xParent->get_help_id();
- aHelpURL = CreateHelpURL( OStringToOUString(aHelpId, RTL_TEXTENCODING_UTF8), aHelpModuleName );
-
- if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
- {
- break;
- }
- else
- {
- xParent.reset(xParent->weld_parent());
- if (!xParent)
- {
- // create help url of start page ( helpid == 0 -> start page)
- aHelpURL = CreateHelpURL( OUString(), aHelpModuleName );
- }
- }
+ // create help url of start page ( helpid == 0 -> start page)
+ aHelpURL = CreateHelpURL( OUString(), aHelpModuleName );
}
}
break;