summaryrefslogtreecommitdiff
path: root/cui/source/customize/CommandCategoryListBox.cxx
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2018-04-20 17:48:54 +0300
committerMuhammet Kara <muhammet.kara@pardus.org.tr>2018-04-21 07:40:04 +0200
commite82eeca67688a809317a0edeecf7d7b3fdf3a216 (patch)
treef7978de0fdf29f62f90af24850b2921cccb8f0aa /cui/source/customize/CommandCategoryListBox.cxx
parent94acabe8d0cb555e76635c4bceeb48a14bd16a2b (diff)
tdf#112323: Sort the category list alphabetically in the Customize dialog
And add multiple separators as per the Design Team's request Change-Id: I8dd692207fc85d75d585dc486d2c8723444f8a5e Reviewed-on: https://gerrit.libreoffice.org/53216 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Muhammet Kara <muhammet.kara@pardus.org.tr>
Diffstat (limited to 'cui/source/customize/CommandCategoryListBox.cxx')
-rw-r--r--cui/source/customize/CommandCategoryListBox.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/cui/source/customize/CommandCategoryListBox.cxx b/cui/source/customize/CommandCategoryListBox.cxx
index 4d83f1147215..e68ad9ec0211 100644
--- a/cui/source/customize/CommandCategoryListBox.cxx
+++ b/cui/source/customize/CommandCategoryListBox.cxx
@@ -46,7 +46,7 @@
#include <cfg.hxx> //for SaveInData
CommandCategoryListBox::CommandCategoryListBox(vcl::Window* pParent)
- : ListBox( pParent, WB_BORDER | WB_DROPDOWN)
+ : ListBox( pParent, WB_BORDER | WB_DROPDOWN | WB_SORT )
, pStylesInfo( nullptr )
{
SetDropDownLineCount(25);
@@ -144,6 +144,9 @@ void CommandCategoryListBox::Init(
SetEntryData( nEntryPos, m_aGroupInfo.back().get() );
}
+ // Separate the "All commands"category from the actual categories
+ AddSeparator( 0 );
+
// Add the actual categories
for (sal_Int32 i = 0; i < nGroupsLength; ++i)
{
@@ -169,8 +172,10 @@ void CommandCategoryListBox::Init(
}
// Separate regular commands from styles and macros
- if (nEntryPos)
- SetSeparatorPos(nEntryPos);
+ AddSeparator( GetEntryCount() - 1 );
+
+ // Stop sorting, and add Macros and Styles to the end of the list
+ SetStyle(GetStyle() & ~WB_SORT);
// Add macros category
OUString sMacros( CuiResId(RID_SVXSTR_MACROS) );