summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorShivam Kumar Singh <shivamhere247@gmail.com>2020-01-29 13:36:17 +0530
committerJim Raykowski <raykowj@gmail.com>2020-03-13 22:44:34 +0100
commit26c9b7863b7e3a8f3a1c43ec26f2efe77c1958a7 (patch)
tree89916820b01b63276407d5ae58f0097b182f5240 /sw
parent9d4b614f2a7617ffe05733e1bb17d075df8898f5 (diff)
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 <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx12
1 files changed, 8 insertions, 4 deletions
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;