summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-02 17:15:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-03 08:09:57 +0200
commit9073a47b99e22585c6d1603dd747cb14f081fca1 (patch)
tree601d55724acdcee2410f8195b2e68148d0aa19e9 /include
parentfcc13ba6a0121cfdf70d1f39318a024777247559 (diff)
tdf#88109 improve autofill perf (2)
make SvxWeightItem sortable, which shaves off 1% and turn the tree search off while performing this operation, which shaves off about 25% of the time on my machine. Change-Id: I94358ed565a0d9f1cc0ddb36b8349e83c9deb959 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95369 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/editeng/wghtitem.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/editeng/wghtitem.hxx b/include/editeng/wghtitem.hxx
index 121cfcf318a6..6f5f4b31ccc3 100644
--- a/include/editeng/wghtitem.hxx
+++ b/include/editeng/wghtitem.hxx
@@ -59,6 +59,14 @@ public:
FontWeight GetWeight() const { return GetValue(); }
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
+
+ virtual bool IsSortable() const override { return true; }
+
+ virtual bool operator<(const SfxPoolItem& rCmp) const override
+ {
+ auto const & other = static_cast<const SvxWeightItem&>(rCmp);
+ return GetValue() < other.GetValue();
+ }
};
#endif // INCLUDED_EDITENG_WGHTITEM_HXX