From 2ec03fc221e80479557f05f53972ca864f1ff4bb Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 12 Oct 2012 16:46:55 +0200 Subject: don't insert notes from deleted cells, fdo#55885 Change-Id: I036f0531dc2290c5eb480258bc70ec13b810e6bc --- sc/source/core/data/table2.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'sc/source') diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 69c7d00ab0b8..88a7ea1941ba 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -264,8 +264,13 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (nRow >= nStartRow) { - aNotes.insert(nCol, nRow - nSize, pPostIt); - maNotes.ReleaseNote(nCol, nRow); + if(nRow > static_cast(nSize)) + { + aNotes.insert(nCol, nRow - nSize, pPostIt); + maNotes.ReleaseNote(nCol, nRow); + } + else + maNotes.erase(nCol, nRow); } } @@ -483,8 +488,13 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE if (nCol >= nStartCol) { - aNotes.insert(nCol - nSize, nRow, pPostIt); - maNotes.ReleaseNote(nCol, nRow); + if(nCol > static_cast(nSize)) + { + aNotes.insert(nCol - nSize, nRow, pPostIt); + maNotes.ReleaseNote(nCol, nRow); + } + else + maNotes.erase(nCol, nRow); } } -- cgit