cui/source/customize/CommandCategoryListBox.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit e82eeca67688a809317a0edeecf7d7b3fdf3a216
Author: Muhammet Kara <muhammet.k...@pardus.org.tr>
Date:   Fri Apr 20 17:48:54 2018 +0300

    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 <c...@libreoffice.org>
    Reviewed-by: Muhammet Kara <muhammet.k...@pardus.org.tr>

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) );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to