summaryrefslogtreecommitdiff
path: root/cui/source/customize/CommandCategoryListBox.cxx
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2018-10-31 15:48:38 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-01 08:34:50 +0100
commite9b06dd9458074af36b0fc97ff41ed4c79e5de32 (patch)
tree758094ad1833d68d6cdd9dea30d861a615b3a3cc /cui/source/customize/CommandCategoryListBox.cxx
parent53bc3b618b5a97702a54d3aa4dbf7853d8980a5d (diff)
tdf#112614: Include all labels in the search in Customize dialog
For uno commands Change-Id: Ide7a30387b0ec354cd0d42ba11c78e115ec94989 Reviewed-on: https://gerrit.libreoffice.org/62693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/customize/CommandCategoryListBox.cxx')
-rw-r--r--cui/source/customize/CommandCategoryListBox.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/cui/source/customize/CommandCategoryListBox.cxx b/cui/source/customize/CommandCategoryListBox.cxx
index 523008fb8287..fe05b2c5a33a 100644
--- a/cui/source/customize/CommandCategoryListBox.cxx
+++ b/cui/source/customize/CommandCategoryListBox.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/script/browse/theBrowseNodeFactory.hpp>
#include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
#include <vcl/builderfactory.hxx>
+#include <vcl/commandinfoprovider.hxx>
// include search util
#include <com/sun/star/util/SearchFlags.hpp>
@@ -215,13 +216,19 @@ void CommandCategoryListBox::FillFunctionsList(
for (const auto & rInfo : xCommands)
{
- OUString sUIName = MapCommand2UIName(rInfo.Command);
- sal_Int32 aStartPos = 0;
- sal_Int32 aEndPos = sUIName.getLength();
+ OUString sUIName = getCommandName(rInfo.Command);
+ OUString sLabel = vcl::CommandInfoProvider::GetLabelForCommand(rInfo.Command, m_sModuleLongName);
+ OUString sTooltipLabel = vcl::CommandInfoProvider::GetTooltipForCommand( rInfo.Command, m_xFrame);
+ OUString sPopupLabel =
+ (vcl::CommandInfoProvider::GetPopupLabelForCommand(rInfo.Command, m_sModuleLongName))
+ .replaceFirst("~", "");
// Apply the search filter
if (!filterTerm.isEmpty()
- && !textSearch.SearchForward( sUIName, &aStartPos, &aEndPos ) )
+ && !textSearch.searchForward( sUIName )
+ && !textSearch.searchForward( sLabel )
+ && !textSearch.searchForward( sTooltipLabel )
+ && !textSearch.searchForward( sPopupLabel ) )
{
continue;
}
@@ -240,7 +247,7 @@ void CommandCategoryListBox::FillFunctionsList(
}
}
-OUString CommandCategoryListBox::MapCommand2UIName(const OUString& sCommand)
+OUString CommandCategoryListBox::getCommandName(const OUString& sCommand)
{
OUString sUIName;
try