From 003d11f410b7e515981b3efbd65d936d94d87121 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 20 Apr 2019 08:32:33 +0200 Subject: tdf#81765 slow loading of .ods with >1000 of conditional formats This takes the loaing time from 1m38 to 15s. Speed up finding existing pool items in the pool by storing a sorted_vector, sorted by a compare operator on the item. memcmp is faster than operator< on std::vector because operator< seems to be trying to use some kind of lexicographical compare Change-Id: Id72527106d604adb8cd2d158bb42f89e2b16a85d Reviewed-on: https://gerrit.libreoffice.org/71009 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/inc/attrib.hxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sc/inc/attrib.hxx') diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index 9e4a556080e4..e03d1a223d66 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -269,6 +269,8 @@ public: virtual ~ScCondFormatItem() override; virtual bool operator==(const SfxPoolItem& rCmp ) const override; + virtual bool operator<(const SfxPoolItem& rCmp) const override; + virtual bool IsSortable() const override { return true; } virtual ScCondFormatItem* Clone( SfxItemPool* = nullptr ) const override; const std::vector& GetCondFormatData() const { return maIndex;} -- cgit