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

Remove the correct range, or else maItems would end up with invalid pointer.

nStopPos is non-inclusive, and STL's erase() method also expects a
non-inclusive end position (like any other STL methods do).  It's wrong
to -1 here which would end up not erasing the last element containing
a pointer to the deleted cell instance.

Change-Id: Ia3ef4469b50695038836ff7b9b48172256032786
üst 1c2ef32a
...@@ -1537,7 +1537,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) ...@@ -1537,7 +1537,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
rAddress.SetRow( maItems[i].nRow ); rAddress.SetRow( maItems[i].nRow );
pDocument->AreaBroadcast( aHint ); pDocument->AreaBroadcast( aHint );
} }
maItems.erase(maItems.begin() + nStartPos, maItems.begin() + nStopPos - 1); maItems.erase(maItems.begin() + nStartPos, maItems.begin() + nStopPos);
} }
pNoteCell->Delete(); pNoteCell->Delete();
} }
......
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