summaryrefslogtreecommitdiff
path: root/o3tl/inc/o3tl/sorted_vector.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'o3tl/inc/o3tl/sorted_vector.hxx')
-rw-r--r--o3tl/inc/o3tl/sorted_vector.hxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/o3tl/inc/o3tl/sorted_vector.hxx b/o3tl/inc/o3tl/sorted_vector.hxx
index d8bceb72e39d..3028f03e1a02 100644
--- a/o3tl/inc/o3tl/sorted_vector.hxx
+++ b/o3tl/inc/o3tl/sorted_vector.hxx
@@ -155,6 +155,16 @@ public:
clear();
}
+ // fdo#58793: some existing code in Writer (SwpHintsArray)
+ // routinely modifies the members of the vector in a way that
+ // violates the sort order, and then re-sorts the array.
+ // This is a kludge to enable that code to work.
+ // If you are calling this function, you are Doing It Wrong!
+ void Resort()
+ {
+ std::stable_sort(begin_nonconst(), end_nonconst(), Compare());
+ }
+
private:
typename base_t::iterator begin_nonconst() { return base_t::begin(); }
@@ -191,7 +201,7 @@ struct find_unique
}
};
-/** the elments are partially ordered by Compare,
+/** the elements are partially ordered by Compare,
2 elements are allowed if they are not the same element (pointer equal)
*/
template<class Value, class Compare>