cui/source/customize/cfg.cxx | 8 +++++--- cui/source/customize/cfgutil.cxx | 7 +++++-- cui/source/inc/cfgutil.hxx | 2 +- include/sfx2/sfxhelp.hxx | 2 ++ sfx2/source/appl/sfxhelp.cxx | 5 +++++ 5 files changed, 18 insertions(+), 6 deletions(-)
New commits: commit 8567047218c2f6e01b6525e0996607ad7f928a57 Author: Muhammet Kara <muhammet.k...@pardus.org.tr> Date: Mon Mar 19 21:19:47 2018 +0300 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 <c...@libreoffice.org> Reviewed-by: Heiko Tietze <tietze.he...@gmail.com> Tested-by: Heiko Tietze <tietze.he...@gmail.com> Reviewed-by: Katarina Behrens <katarina.behr...@cib.de> 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; diff --git a/include/sfx2/sfxhelp.hxx b/include/sfx2/sfxhelp.hxx index d9b41b6544f7..bdfaaf867143 100644 --- a/include/sfx2/sfxhelp.hxx +++ b/include/sfx2/sfxhelp.hxx @@ -50,6 +50,8 @@ public: static OUString CreateHelpURL( const OUString& aCommandURL, const OUString& rModuleName ); static OUString GetDefaultHelpModule(); static OUString GetCurrentModuleIdentifier(); + // Check for built-in help + static bool IsHelpInstalled(); }; #endif // INCLUDED_SFX2_SFXHELP_HXX diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index d924f81e4b2e..d4d55e99ea4b 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -1044,4 +1044,9 @@ OUString SfxHelp::GetCurrentModuleIdentifier() return getCurrentModuleIdentifier_Impl(); } +bool SfxHelp::IsHelpInstalled() +{ + return impl_hasHelpInstalled(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits