diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-08-04 02:41:14 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-08-04 12:58:00 +0000 |
commit | ef3ca1da6b6d994ea8c39f28a49a599f5cf67915 (patch) | |
tree | 8ae61c2ff4e712af9f04835db50b575bcaebc30e /sc/inc | |
parent | eee24c0ee31714ede45d17f6f1f6c1df5aefaeb4 (diff) |
save about 50% of the import time for nearly empty ods documents
It seems that currently most of the time is spent iterating through all
the cells to get the optimal row height. We can easily optimize by using
mdds::flat_segment_tree.
Now we don't need to iterate through all cells and instead can work on
whole blocks.
Change-Id: Id9a0686490b0e91ad6552b428c38a9f6635a7938
Reviewed-on: https://gerrit.libreoffice.org/27856
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/rowheightcontext.hxx | 6 | ||||
-rw-r--r-- | sc/inc/segmenttree.hxx | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sc/inc/rowheightcontext.hxx b/sc/inc/rowheightcontext.hxx index f801ee466f29..d1a8f8ff68e4 100644 --- a/sc/inc/rowheightcontext.hxx +++ b/sc/inc/rowheightcontext.hxx @@ -18,11 +18,13 @@ #include <vector> +#include "segmenttree.hxx" + namespace sc { class SC_DLLPUBLIC RowHeightContext { - std::vector<sal_uInt16> maHeights; + ScFlatUInt16RowSegments maHeights; double mfPPTX; double mfPPTY; @@ -53,7 +55,7 @@ public: void setForceAutoSize( bool b ); bool isForceAutoSize() const { return mbForceAutoSize;} - std::vector<sal_uInt16>& getHeightArray(); + ScFlatUInt16RowSegments& getHeightArray(); }; } diff --git a/sc/inc/segmenttree.hxx b/sc/inc/segmenttree.hxx index 25eecec120f2..897b4dbf7239 100644 --- a/sc/inc/segmenttree.hxx +++ b/sc/inc/segmenttree.hxx @@ -135,6 +135,7 @@ public: ~ScFlatUInt16RowSegments(); void setValue(SCROW nRow1, SCROW nRow2, sal_uInt16 nValue); + void setValueIf(SCROW nRow1, SCROW nRow2, sal_uInt16 nValue, const std::function<bool(sal_uInt16)>& rPredicate); sal_uInt16 getValue(SCROW nRow); sal_uInt32 getSumValue(SCROW nRow1, SCROW nRow2); bool getRangeData(SCROW nRow, RangeData& rData); |