summaryrefslogtreecommitdiff
path: root/include/editeng
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-09-09 13:04:01 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-09-09 14:27:52 +0200
commit7a8bb65e1b8dc7fdd7f89c8c546e71e4208da574 (patch)
treea7e3503c90395052a071b543f21be5303ddef947 /include/editeng
parenta9cd44f8deeccbb8afc7209fdf86fbc26ea7a464 (diff)
ODT export: order <style:font-face> elements inside <office:font-face-decls>
This builds on top of commit 92471550b8c43d8ff0cef8b414884d697edf9e63 (ODF export: sort <style:font-face> elements based on the style:name attribute, 2021-03-11), the additional problem was that the style:name attribute already has number suffixes to have unique names for fonts where the style name would match. This means that even if we sort the container right before writing the elements, which font gets the number suffix depends on the insert order. Fix this by additionally sorting the font items before insertion, given that a single call-site does all the insertion, at least for Writer documents. This is required as SfxItemPool::GetItemSurrogates() exposes a container which is based on SfxPoolItemArray_Impl, which uses an o3tl::sorted_vector<> of pointers, so effectively unsorted, the order depends on the pointer address of the font items. Change-Id: I46569b40796243f7f95b92870504c2023b2ce943 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121823 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'include/editeng')
-rw-r--r--include/editeng/fontitem.hxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/editeng/fontitem.hxx b/include/editeng/fontitem.hxx
index 9a73a051f79e..2ccaade20121 100644
--- a/include/editeng/fontitem.hxx
+++ b/include/editeng/fontitem.hxx
@@ -46,6 +46,7 @@ public:
// "pure virtual Methods" from SfxPoolItem
virtual bool operator==(const SfxPoolItem& rItem) const override;
+ bool operator<(const SfxPoolItem& rCmp) const override;
virtual SvxFontItem* Clone(SfxItemPool *pPool = nullptr) const override;
virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;