summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-06-21 18:05:46 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-06-24 16:51:40 -0400
commitcf02151987b19b12ca0be463732765bd35f54028 (patch)
tree1631707578820ec163dfa237daac13a54020caf3
parente639e3068c30bb614c394466f41fa450ee8b2dbb (diff)
Fix my wrong logic in row info iteration.
Align the array position of RowInfo by comparing its nRowNo value with the current row number. Change-Id: Idd26636cac0ba4ade1b538dd68580b469611da04
-rw-r--r--sc/source/core/data/fillinfo.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index 34c256284a51..5f9b6cecdbb3 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -145,8 +145,16 @@ class RowInfoFiller
return mbHiddenRow;
}
- void setInfo(size_t /*nRow*/, const ScRefCellValue& rCell)
+ void alignArray(size_t nRow)
{
+ while (mpRowInfo[mrArrY].nRowNo < static_cast<SCROW>(nRow))
+ ++mrArrY;
+ }
+
+ void setInfo(size_t nRow, const ScRefCellValue& rCell)
+ {
+ alignArray(nRow);
+
RowInfo* pThisRowInfo = &mpRowInfo[mrArrY];
CellInfo* pInfo = &pThisRowInfo->pCellInfo[mnArrX];
pInfo->maCell = rCell;
@@ -183,12 +191,6 @@ public:
if (!isHidden(nRow))
setInfo(nRow, ScRefCellValue(const_cast<ScFormulaCell*>(p)));
}
-
- void operator() (mdds::mtv::element_t, size_t, size_t nDataSize)
- {
- // Skip all empty cells.
- mrArrY += nDataSize;
- }
};
}
@@ -430,7 +432,7 @@ void ScDocument::FillInfo(
// cells that are not hidden.
RowInfoFiller aFunc(*this, nTab, pRowInfo, nArrCol, nArrRow);
sc::ParseAllNonEmpty(
- pThisCol->maCells.begin(), pThisCol->maCells, nRow1, nRow2, aFunc, aFunc);
+ pThisCol->maCells.begin(), pThisCol->maCells, nRow1, nRow2, aFunc);
if (nX+1 >= nCol1) // Attribute/Blockmarken ab nX1-1
{