[ooo-build-commit] Branch 'ooo-build-3-1-1' - patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri Nov 13 13:00:32 PST 2009
patches/dev300/apply | 4
patches/dev300/calc-perf-page-and-manual-breaks-fwd-iterator.diff | 86 ++++++++++
2 files changed, 90 insertions(+)
New commits:
commit c644d4aea9f87bf48bbb43a22ad41e4c4f6e6cfc
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Fri Nov 13 15:58:56 2009 -0500
Speed up row's hidden state lookup during pagenation.
* patches/dev300/apply:
* patches/dev300/calc-perf-page-and-manual-breaks-fwd-iterator.diff:
speed up row's hidden state lookup when updating page breaks, which
results in 40% performance improvement during printing. (n#554955)
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 063aec6..9f1dea0 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3468,6 +3468,10 @@ calc-xls-export-encryption-condfmt-fix.diff, n#541058, kohei
calc-xls-import-slanted-border-sc.diff, n#549728, i#38709, kohei
calc-xls-import-slanted-border-oox.diff, n#549728, i#38709, kohei
+[ CalcExperimental and CalcRowLimit ]
+# speed up row's hidden state query during pagenation.
+calc-perf-page-and-manual-breaks-fwd-iterator.diff, n#503482, kohei
+
[ AutoLayout ]
sd-layoutcode.diff, cocofan
offapi-layoutcode.diff, cocofan
diff --git a/patches/dev300/calc-perf-page-and-manual-breaks-fwd-iterator.diff b/patches/dev300/calc-perf-page-and-manual-breaks-fwd-iterator.diff
new file mode 100644
index 0000000..a0cd65b
--- /dev/null
+++ b/patches/dev300/calc-perf-page-and-manual-breaks-fwd-iterator.diff
@@ -0,0 +1,86 @@
+diff --git sc/inc/segmenttree.hxx sc/inc/segmenttree.hxx
+index 466f9ed..64ba898 100644
+--- sc/inc/segmenttree.hxx
++++ sc/inc/segmenttree.hxx
+@@ -46,6 +46,22 @@ public:
+ SCROW mnRow2;
+ bool mbValue;
+ };
++
++ class ForwardIterator
++ {
++ public:
++ explicit ForwardIterator(ScFlatBoolRowSegments& rSegs);
++
++ bool getValue(SCROW nPos, bool& rVal);
++
++ private:
++ ScFlatBoolRowSegments& mrSegs;
++
++ SCROW mnCurPos;
++ SCROW mnLastPos;
++ bool mbCurValue;
++ };
++
+ ScFlatBoolRowSegments();
+ ~ScFlatBoolRowSegments();
+
+diff --git sc/source/core/data/segmenttree.cxx sc/source/core/data/segmenttree.cxx
+index be8e408..0ee889b 100644
+--- sc/source/core/data/segmenttree.cxx
++++ sc/source/core/data/segmenttree.cxx
+@@ -130,6 +130,34 @@ void ScFlatBoolSegmentsImpl::insertSegment(SCCOLROW nPos, SCCOLROW nSize, bool b
+
+ // ============================================================================
+
++ScFlatBoolRowSegments::ForwardIterator::ForwardIterator(ScFlatBoolRowSegments& rSegs) :
++ mrSegs(rSegs), mnCurPos(0), mnLastPos(-1), mbCurValue(false)
++{
++}
++
++bool ScFlatBoolRowSegments::ForwardIterator::getValue(SCROW nPos, bool& rVal)
++{
++ if (nPos >= mnCurPos)
++ // It can only go in a forward direction.
++ mnCurPos = nPos;
++
++ if (mnCurPos > mnLastPos)
++ {
++ // position not in the current segment. Update the current value.
++ ScFlatBoolRowSegments::RangeData aData;
++ if (!mrSegs.getRangeData(mnCurPos, aData))
++ return false;
++
++ mbCurValue = aData.mbValue;
++ mnLastPos = aData.mnRow2;
++ }
++
++ rVal = mbCurValue;
++ return true;
++}
++
++// ----------------------------------------------------------------------------
++
+ ScFlatBoolRowSegments::ScFlatBoolRowSegments() :
+ mpImpl(new ScFlatBoolSegmentsImpl(static_cast<SCCOLROW>(MAXROW)))
+ {
+diff --git sc/source/core/data/table5.cxx sc/source/core/data/table5.cxx
+index 7e7cab9..4d28ff2 100644
+--- sc/source/core/data/table5.cxx
++++ sc/source/core/data/table5.cxx
+@@ -203,10 +203,14 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
+ BOOL bRepeatRow = ( nRepeatStartY != SCROW_REPEAT_NONE );
+ BOOL bRowFound = FALSE;
+ long nSizeY = 0;
++ ScFlatBoolRowSegments::ForwardIterator aIter(*mpHiddenRows);
+ for (SCROW nY = nStartRow; nY <= nEndRow; ++nY)
+ {
+ BOOL bStartOfPage = FALSE;
+- long nThisY = RowHidden(nY) ? 0 : pRowHeight->GetValue(nY);
++ bool bThisRowHidden = false;
++ aIter.getValue(nY, bThisRowHidden);
++ long nThisY = bThisRowHidden ? 0 : pRowHeight->GetValue(nY);
++
+ bool bManualBreak = HasRowManualBreak(nY);
+ if ( (nSizeY+nThisY > nPageSizeY) || (bManualBreak && !bSkipBreaks) )
+ {
More information about the ooo-build-commit
mailing list