summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/sfxhelp.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 0adbf1229b34..5d92a18b7f85 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -709,6 +709,7 @@ sal_Bool SfxHelp::Start_Impl(const OUString& rURL, const Window* pWindow, const
{
// no help found -> try with parent help id.
Window* pParent = pWindow->GetParent();
+ bool bTriedTabPage = false;
while ( pParent )
{
OString aHelpId = pParent->GetHelpId();
@@ -720,11 +721,23 @@ sal_Bool SfxHelp::Start_Impl(const OUString& rURL, const Window* pWindow, const
else
{
pParent = pParent->GetParent();
- if ( !pParent )
+ if (!pParent)
{
// create help url of start page ( helpid == 0 -> start page)
aHelpURL = CreateHelpURL( String(), aHelpModuleName );
}
+ else if (pParent->IsDialog() && !bTriedTabPage)
+ {
+ //During help fallback, before we ask a dialog for its help
+ //see if it has a TabControl and ask the active tab of
+ //that for help
+ bTriedTabPage = true;
+ TabControl *pCtrl = ((Dialog*)pParent)->get<TabControl>("tabcontrol");
+ TabPage* pTabPage = pCtrl ? pCtrl->GetTabPage(pCtrl->GetCurPageId()) : NULL;
+ Window *pTabChild = pTabPage ? pTabPage->GetWindow(WINDOW_FIRSTCHILD) : NULL;
+ if (pTabChild)
+ pParent = pTabChild;
+ }
}
}
}