diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-05 20:33:36 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-05 20:38:57 -0500 |
commit | a6070efb880e4c8fca54b900e807d9233bcb25fd (patch) | |
tree | 75b34705ef12b05331dec20b0ae07b38ef0b4579 /sc | |
parent | be4035d00f37c492494fa7860955b6d0868c7f77 (diff) |
Don't crash when entering a value into cell at MAXROW position.
Beucase that would be bad.
Change-Id: I7ce22105d88346f1cda12897eb57923dee8bd467
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/column3.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 921fd4330f94..850a904e6fa2 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1912,7 +1912,14 @@ class StrCellIterator const ScDocument* mpDoc; public: StrCellIterator(const sc::CellStoreType& rCells, SCROW nStart, const ScDocument* pDoc) : - maPos(rCells.position(nStart)), miBeg(rCells.begin()), miEnd(rCells.end()), mpDoc(pDoc) {} + miBeg(rCells.begin()), miEnd(rCells.end()), mpDoc(pDoc) + { + if (ValidRow(nStart)) + maPos = rCells.position(nStart); + else + // Make this iterator invalid. + maPos.first = miEnd; + } bool valid() const { return (maPos.first != miEnd); } |