diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2021-05-22 22:51:36 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2021-05-23 00:18:41 +0200 |
commit | 60cba23bc0f5e8eafecc03c437f1133b62569fa6 (patch) | |
tree | f835591d2bbc354c8e522e903d470b5596c02443 /cui/source/customize | |
parent | gtk[3|4] there's only two options, 'clipboard' or 'primary' (diff) | |
download | core-60cba23bc0f5e8eafecc03c437f1133b62569fa6.tar.gz core-60cba23bc0f5e8eafecc03c437f1133b62569fa6.zip |
tdf#116491: Customize: Hide experimental commands when not in experimental mode
Change-Id: Ibc88e9c90b261b5294fab8041e0b530016f45f33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116006
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'cui/source/customize')
-rw-r--r-- | cui/source/customize/CommandCategoryListBox.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cui/source/customize/CommandCategoryListBox.cxx b/cui/source/customize/CommandCategoryListBox.cxx index 5b8903f3d199..7823607114e8 100644 --- a/cui/source/customize/CommandCategoryListBox.cxx +++ b/cui/source/customize/CommandCategoryListBox.cxx @@ -44,6 +44,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <comphelper/SetFlagContextHelper.hxx> #include <comphelper/string.hxx> +#include <officecfg/Office/Common.hxx> #include <i18nlangtag/languagetag.hxx> #include <i18nutil/searchopt.hxx> #include <sal/log.hxx> @@ -222,6 +223,7 @@ void CommandCategoryListBox::FillFunctionsList( // Setup search filter parameters m_searchOptions.searchString = filterTerm; utl::TextSearch textSearch(m_searchOptions); + const bool bInExperimentalMode = officecfg::Office::Common::Misc::ExperimentalMode::get(); for (const auto& rInfo : xCommands) { @@ -234,11 +236,17 @@ void CommandCategoryListBox::FillFunctionsList( = vcl::CommandInfoProvider::GetTooltipForCommand(rInfo.Command, aProperties, m_xFrame); OUString sPopupLabel = (vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties)) .replaceFirst("~", ""); + bool bIsExperimental + = vcl::CommandInfoProvider::IsExperimental(rInfo.Command, m_sModuleLongName); + + // Hide experimental commands when not in experimental mode + bool bHideExperimental = bIsExperimental && !bInExperimentalMode; // Apply the search filter - if (!filterTerm.isEmpty() && !textSearch.searchForward(sUIName) - && !textSearch.searchForward(sLabel) && !textSearch.searchForward(sTooltipLabel) - && !textSearch.searchForward(sPopupLabel)) + if (bHideExperimental + || (!filterTerm.isEmpty() && !textSearch.searchForward(sUIName) + && !textSearch.searchForward(sLabel) && !textSearch.searchForward(sTooltipLabel) + && !textSearch.searchForward(sPopupLabel))) { continue; } |