diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-05-19 00:33:37 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-05-20 06:19:16 +0200 |
commit | 66d8951df3c11ead0b9415eb292c3ae88689edf1 (patch) | |
tree | b7cabf8bde6aeb517d17d75eb9813b4d61af65a2 /include/sfx2/devtools | |
parent | 09822cf77cdbe32b03553cd05154100b5f2591d0 (diff) |
sfx2: use natural string sort for sorting in object inspector
Use a natural string sort for all strings in the object inspector
tree view. This is more useful for properties as those can have
indices, which are shown as numbers, so having them in natural
order makes the tree view easier to digest.
Change-Id: I7d036cd755f6595fa302c7a28a005684897f2963
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134541
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/sfx2/devtools')
-rw-r--r-- | include/sfx2/devtools/ObjectInspectorTreeHandler.hxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx index 03188276a4b4..b6fa678de366 100644 --- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx +++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx @@ -12,6 +12,7 @@ #include <vcl/weld.hxx> #include <vcl/commandevent.hxx> +#include <comphelper/string.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/XInterface.hpp> @@ -40,6 +41,13 @@ private: // just the current context css::uno::Reference<css::uno::XComponentContext> mxContext; + // treeview sort and compare + comphelper::string::NaturalStringSorter mxSorter; + void setSortFunction(std::unique_ptr<weld::TreeView>& pTreeView); + sal_Int32 compare(std::unique_ptr<weld::TreeView>& pTreeView, const weld::TreeIter& rLeft, + const weld::TreeIter& rRight); + + // treeview manipulation static void clearObjectInspectorChildren(std::unique_ptr<weld::TreeView>& pTreeView, weld::TreeIter const& rParent); static void handleExpanding(std::unique_ptr<weld::TreeView>& pTreeView, |