[Libreoffice-commits] core.git: sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Sun Jan 5 17:34:55 PST 2014


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

New commits:
commit a6070efb880e4c8fca54b900e807d9233bcb25fd
Author: Kohei Yoshida <kohei.yoshida at 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

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); }
 


More information about the Libreoffice-commits mailing list