sw/source/uibase/ribbar/workctrl.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 26c9b7863b7e3a8f3a1c43ec26f2efe77c1958a7
Author:     Shivam Kumar Singh <shivamhere...@gmail.com>
AuthorDate: Wed Jan 29 13:36:17 2020 +0530
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Fri Mar 13 22:44:34 2020 +0100

    tdf#129471 alphabetize Navigate By option in writer
    
    The "Navigate By" option in find does not have a particular order.
    In this patch all the options are sorted alphabetically .
    
    Change-Id: I52fdce37ac86ed12b7ea123f7238bf2b788f8a2a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87670
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>

diff --git a/sw/source/uibase/ribbar/workctrl.cxx 
b/sw/source/uibase/ribbar/workctrl.cxx
index 336b48031b2e..90ed663b5952 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -50,6 +50,7 @@
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/util/XURLTransformer.hpp>
+#include <map>
 
 // Size check
 #define NAVI_ENTRIES 18
@@ -656,8 +657,12 @@ NavElementBox_Impl::NavElementBox_Impl(
 {
     m_xWidget->set_size_request(42, -1); // set to something small so the size 
set at the .ui takes precedence
 
-    for (sal_uInt16 i = 0; i < NID_COUNT; ++i)
-        m_xWidget->append("", SwResId(aNavigationStrIds[i]), 
aNavigationImgIds[i]);
+    std::map<OUString, std::pair<sal_uInt16, rtl::OUString> > 
aStoreSortedNavigationIds;
+    for(sal_uInt16 i = 0; i < NID_COUNT; i++)
+        aStoreSortedNavigationIds[SwResId(aNavigationStrIds[i])] = 
std::make_pair(aNavigationInsertIds[i], aNavigationImgIds[i]);// for ordering 
of Navigation Pane
+
+    for (auto const &itr : aStoreSortedNavigationIds)
+        m_xWidget->append(OUString::number(itr.second.first), itr.first, 
itr.second.second);
     m_xWidget->connect_changed(LINK(this, NavElementBox_Impl, SelectHdl));
     m_xWidget->connect_key_press(LINK(this, NavElementBox_Impl, KeyInputHdl));
 
@@ -682,8 +687,7 @@ IMPL_LINK(NavElementBox_Impl, SelectHdl, weld::ComboBox&, 
rComboBox, void)
     {
         SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
 
-        sal_uInt16 nPos = rComboBox.get_active();
-        sal_uInt16 nMoveType = aNavigationInsertIds[nPos];
+        sal_uInt16 nMoveType = rComboBox.get_active_id().toUInt32();
         SwView::SetMoveType( nMoveType );
 
         css::uno::Sequence< css::beans::PropertyValue > aArgs;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to