diff options
author | Muhammet Kara <muhammet.kara@pardus.org.tr> | 2018-03-19 21:19:47 +0300 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-03-20 12:41:15 +0100 |
commit | 8567047218c2f6e01b6525e0996607ad7f928a57 (patch) | |
tree | 14466cdade63f4c46d9efd9a91f9a13fd77822e5 /cui | |
parent | 6e5a95c34c7d6817389c6d9aeb5206d821963f05 (diff) |
tdf#116494: Don't ask parent if no help text
And add/use an IsHelpInstalled() method to SfxHelp.
Change-Id: Ib87573067d6c44fa5adb22253c1a51a78580acf6
Reviewed-on: https://gerrit.libreoffice.org/51584
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/cfg.cxx | 8 | ||||
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 7 | ||||
-rw-r--r-- | cui/source/inc/cfgutil.hxx | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 078a06c16c77..0d3c9fbe69bc 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -34,6 +34,7 @@ #include <vcl/virdev.hxx> #include <vcl/settings.hxx> +#include <sfx2/sfxhelp.hxx> #include <sfx2/app.hxx> #include <sfx2/sfxdlg.hxx> #include <sfx2/viewfrm.hxx> @@ -1769,19 +1770,20 @@ IMPL_LINK_NOARG( SvxConfigPage, SelectFunctionHdl, SvTreeListBox *, void ) m_pAddCommandButton->Enable(); m_pRemoveCommandButton->Enable(); - m_pDescriptionField->SetText( m_pFunctions->GetHelpText() ); + m_pDescriptionField->SetText( m_pFunctions->GetHelpText( false ) ); } else { + m_pAddCommandButton->Disable(); m_pRemoveCommandButton->Disable(); m_pDescriptionField->SetText(""); } - // Disable the description field and its label if there is no help text to display + // Disable the description field and its label if the local help is not installed // And inform the user via tooltips - if ( m_pDescriptionField->GetText().isEmpty() ) + if ( !SfxHelp::IsHelpInstalled() ) { m_pDescriptionField->Disable(); m_pDescriptionFieldLb->Disable(); diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 74318258fd5b..5dc7153f1c94 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -314,7 +314,7 @@ OUString SfxConfigFunctionListBox::GetSelectedScriptURI() return OUString(); } -OUString SfxConfigFunctionListBox::GetHelpText() +OUString SfxConfigFunctionListBox::GetHelpText( bool bConsiderParent ) { SvTreeListEntry *pEntry = FirstSelected(); if ( pEntry ) @@ -324,7 +324,10 @@ OUString SfxConfigFunctionListBox::GetHelpText() { if ( pData->nKind == SfxCfgKind::FUNCTION_SLOT ) { - return Application::GetHelp()->GetHelpText( pData->sCommand, this ); + if (bConsiderParent) + return Application::GetHelp()->GetHelpText( pData->sCommand, this ); + else + return Application::GetHelp()->GetHelpText( pData->sCommand, nullptr ); } else if ( pData->nKind == SfxCfgKind::FUNCTION_SCRIPT ) { diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx index ff9ca2896976..4a97e63c608b 100644 --- a/cui/source/inc/cfgutil.hxx +++ b/cui/source/inc/cfgutil.hxx @@ -120,7 +120,7 @@ public: OUString GetCurCommand(); OUString GetCurLabel(); OUString GetSelectedScriptURI(); - OUString GetHelpText(); + OUString GetHelpText( bool bConsiderParent = true ); }; struct SvxConfigGroupBoxResource_Impl; |