diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-02 17:15:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-03 08:09:57 +0200 |
commit | 9073a47b99e22585c6d1603dd747cb14f081fca1 (patch) | |
tree | 601d55724acdcee2410f8195b2e68148d0aa19e9 | |
parent | fcc13ba6a0121cfdf70d1f39318a024777247559 (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>
-rw-r--r-- | include/editeng/wghtitem.hxx | 8 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 4 |
2 files changed, 12 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 diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 022a57f2503f..16e6e5d594d5 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -464,6 +464,8 @@ bool ScTable::SetOptimalHeight( ScProgress* pProgress = GetProgressBar(nCount, GetWeightedCount(), pOuterProgress, pDocument); + mpRowHeights->enableTreeSearch(false); + GetOptimalHeightsInColumn(rCxt, aCol, nStartRow, nEndRow, pProgress, nProgressStart); SetRowHeightRangeFunc aFunc(this, rCxt.getPPTY()); @@ -472,6 +474,8 @@ bool ScTable::SetOptimalHeight( if ( pProgress != pOuterProgress ) delete pProgress; + mpRowHeights->enableTreeSearch(true); + return bChanged; } |