summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-24 10:13:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-01-24 10:50:34 +0000
commit19f46cbac2636f4d55bf932219b7e16056f70010 (patch)
tree15099a105cc190d2e6a440c7bdcd503f22256be1
parent1799f269026bf6ec81f1c5e896698bc64d3ee16d (diff)
look into active tabcontrol page on help fallback search
Change-Id: I13eda8a66e437c5f428b3ee3e9106f25cc9d02b7
-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;
+ }
}
}
}