summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail..com>2020-03-24 21:05:01 -0800
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-03-26 07:34:38 +0100
commit9936f3ed49e2aaf06e30b733b26d9d7f427746ed (patch)
tree05faf3cbf5330ad9adcae951323e4c96d9db3e7e /sw/source/uibase
parentbc0a111295701ffc940d3e16e0e8b1536af21d8b (diff)
Use make_sorted to alphabetize the Navigate By combobox
instead of the std::map approach Change-Id: I2d983f4a38a534f0a98453bb8aa54298e09c62f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91022 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index feb999de7fc4..16ee3c8e00a5 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -51,7 +51,6 @@
#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
@@ -684,12 +683,12 @@ NavElementBox_Base::NavElementBox_Base(
{
m_xWidget->set_size_request(150, -1);
- std::map<OUString, std::pair<sal_uInt16, rtl::OUString> > aStoreSortedNavigationIds;
+ m_xWidget->make_sorted();
+ m_xWidget->freeze();
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
+ m_xWidget->append(OUString::number(aNavigationInsertIds[i]), SwResId(aNavigationStrIds[i]), aNavigationImgIds[i]);
+ m_xWidget->thaw();
- 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_Base, SelectHdl));
m_xWidget->connect_key_press(LINK(this, NavElementBox_Base, KeyInputHdl));
}