Kaydet (Commit) 28b7359e authored tarafından Kohei Yoshida's avatar Kohei Yoshida

bnc#801152: Scan all columns to determine the first data row.

When scanning the entire data range in an attempt to determine where
the first data row is, we shouldn't stop at the first column.  We should
scan all data columns to make sure we pick the lowest value row
position among all columns.

Change-Id: I693ec169857b181c6b4237efcba3fa6a46eaa531
üst 1a04fbd3
...@@ -295,13 +295,14 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, ...@@ -295,13 +295,14 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount,
bool bFoundValues = false; bool bFoundValues = false;
bool bFoundAnything = false; bool bFoundAnything = false;
FormulaTokenMapMap::const_iterator it1 = rCols.begin(); FormulaTokenMapMap::const_iterator it1 = rCols.begin();
for (SCCOL nCol = 0; !bFoundValues && nCol < nAllColCount; ++nCol) for (SCCOL nCol = 0; nCol < nAllColCount; ++nCol)
{ {
if (it1 != rCols.end() && nCol>=nHeaderColCount) if (it1 != rCols.end() && nCol>=nHeaderColCount)
{ {
bool bFoundValuesInRow = false;
FormulaTokenMap* pCol = it1->second; FormulaTokenMap* pCol = it1->second;
FormulaTokenMap::const_iterator it2 = pCol->begin(); FormulaTokenMap::const_iterator it2 = pCol->begin();
for (SCROW nRow = 0; !bFoundValues && nRow < nSmallestValueRowIndex && it2 != pCol->end(); ++nRow) for (SCROW nRow = 0; !bFoundValuesInRow && nRow < nSmallestValueRowIndex && it2 != pCol->end(); ++nRow)
{ {
FormulaToken* pToken = it2->second; FormulaToken* pToken = it2->second;
if (pToken && nRow>=nHeaderRowCount) if (pToken && nRow>=nHeaderRowCount)
...@@ -319,7 +320,7 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, ...@@ -319,7 +320,7 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount,
aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
if (pDoc && pDoc->HasValueData( nCol1, nRow1, nTab1 )) if (pDoc && pDoc->HasValueData( nCol1, nRow1, nTab1 ))
{ {
bFoundValues = bFoundAnything = true; bFoundValuesInRow = bFoundValues = bFoundAnything = true;
nSmallestValueRowIndex = std::min( nSmallestValueRowIndex, nRow ); nSmallestValueRowIndex = std::min( nSmallestValueRowIndex, nRow );
} }
if( !bFoundAnything ) if( !bFoundAnything )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment