summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-20 08:32:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-20 18:18:20 +0200
commit003d11f410b7e515981b3efbd65d936d94d87121 (patch)
treed15fffce95dfc4b115b53cfb3b6924a26a506231 /include/svl
parenta0d14926ab3d5e84cefe2b349c451edf6666a392 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/poolitem.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
index c1c017c13f44..c3800cc02c18 100644
--- a/include/svl/poolitem.hxx
+++ b/include/svl/poolitem.hxx
@@ -152,6 +152,11 @@ public:
bool operator!=( const SfxPoolItem& rItem ) const
{ return !(*this == rItem); }
+ // Sorting is only used for faster searching in a pool which contains large quantities
+ // of a single kind of pool item.
+ virtual bool operator<( const SfxPoolItem& ) const { assert(false); return false; }
+ virtual bool IsSortable() const { return false; }
+
/** @return true if it has a valid string representation */
virtual bool GetPresentation( SfxItemPresentation ePresentation,
MapUnit eCoreMetric,