diff options
Diffstat (limited to 'sc/source/core/data/column3.cxx')
-rw-r--r-- | sc/source/core/data/column3.cxx | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index b9232f334644..306781a26baf 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2548,11 +2548,6 @@ public: return (maPos.first->type == sc::element_type_string || maPos.first->type == sc::element_type_edittext); } - bool isEmpty() const - { - return maPos.first->type == sc::element_type_empty; - } - bool prev() { if (!has()) @@ -2560,7 +2555,7 @@ public: // Not in a string block. Move back until we hit a string block. while (!has()) { - if (isEmpty() || maPos.first == miBeg) + if (maPos.first == miBeg) return false; --maPos.first; // move to the preceding block. @@ -2586,10 +2581,6 @@ public: // Move to the last cell of the previous block. --maPos.first; maPos.second = maPos.first->size - 1; - - if (isEmpty()) - return false; - if (has()) break; } @@ -2604,9 +2595,6 @@ public: // Not in a string block. Move forward until we hit a string block. while (!has()) { - if (isEmpty()) - return false; - ++maPos.first; if (maPos.first == miEnd) return false; @@ -2628,10 +2616,6 @@ public: return false; maPos.second = 0; - - if (isEmpty()) - return false; - if (has()) break; } @@ -2667,12 +2651,16 @@ bool ScColumn::GetDataEntries( // going upward and downward directions in parallel. The start position // cell must be skipped. - StrCellIterator aItrUp(maCells, nStartRow-1, GetDoc()); + StrCellIterator aItrUp(maCells, nStartRow, GetDoc()); StrCellIterator aItrDown(maCells, nStartRow+1, GetDoc()); bool bMoveUp = aItrUp.valid(); - if (bMoveUp && !aItrUp.has()) - bMoveUp = aItrUp.prev(); // Find the previous string cell position. + if (!bMoveUp) + // Current cell is invalid. + return false; + + // Skip the start position cell. + bMoveUp = aItrUp.prev(); // Find the previous string cell position. bool bMoveDown = aItrDown.valid(); if (bMoveDown && !aItrDown.has()) |