diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-02-15 00:05:32 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-02-15 00:07:03 -0500 |
commit | a9657598cf0be00e01ac9d8ddff8b7c76f94c860 (patch) | |
tree | 5d0717c6a64be7f1725c9906d3ac27a2a11023cb /sc/source/core/data/table5.cxx | |
parent | e57b210ba567ef4d8e0a9f8364b3f9baf41a876f (diff) |
Let's use a separate method for leaf-node search.
Let's have two separate methods for tree and leaf-node searches.
It's better this way than turning on and off the tree search via
boolean before and after the call.
Diffstat (limited to 'sc/source/core/data/table5.cxx')
-rw-r--r-- | sc/source/core/data/table5.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index f8e312af6aef..b09c28b0b399 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -540,6 +540,36 @@ bool ScTable::RowHidden(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow) const return aData.mbValue; } +bool ScTable::RowHiddenLeaf(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow) const +{ + if (!ValidRow(nRow)) + { + if (pFirstRow) + *pFirstRow = nRow; + if (pLastRow) + *pLastRow = nRow; + return true; + } + + ScFlatBoolRowSegments::RangeData aData; + if (!mpHiddenRows->getRangeDataLeaf(nRow, aData)) + { + // search failed. + if (pFirstRow) + *pFirstRow = nRow; + if (pLastRow) + *pLastRow = nRow; + return true; + } + + if (pFirstRow) + *pFirstRow = aData.mnRow1; + if (pLastRow) + *pLastRow = aData.mnRow2; + + return aData.mbValue; +} + bool ScTable::HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const { SCROW nRow = nStartRow; |