sc/source/core/data/column3.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit bb3504ddfd3473b384cd573634031b3af09af9fe
Author: Kohei Yoshida <kohei.yosh...@collabora.com>
Date:   Sun Jan 5 20:33:36 2014 -0500

    Don't crash when entering a value into cell at MAXROW position.
    
    Beucase that would be bad.
    
    Change-Id: I7ce22105d88346f1cda12897eb57923dee8bd467
    (cherry picked from commit a6070efb880e4c8fca54b900e807d9233bcb25fd)

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 921fd43..850a904 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); }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to