From 764e7e71038d5ae66061f44bc0cd51ce33ae96ed Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 17 Sep 2012 17:58:27 +0200 Subject: hopefully a corect way to deal with deleting rows and cols, fdo#54842 Change-Id: I4ec1a8225ae3c84352643876065fb4cc7073b9f4 --- sc/source/core/tool/rangelst.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index e81ec824b9ba..c6b3bfc2dd31 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -417,6 +417,23 @@ bool ScRangeList::UpdateReference( SCTAB nTab2; rWhere.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); + if(eUpdateRefMode == URM_INSDEL) + { + // right now this only works for nTab1 == nTab2 + if(nTab1 == nTab2) + { + if(nDx < 0) + { + DeleteArea(nCol1+nDx, nRow1, nTab1, nCol1-1, nRow1, nTab2); + } + if(nDy < 0) + { + DeleteArea(nCol1, nRow1+nDy, nTab1, nCol1, nRow1-1, nTab2); + } + SAL_WARN_IF(nDx < 0 && nDy < 0, "sc", "nDx and nDy are negative, check why"); + } + } + vector::iterator itr = maRanges.begin(), itrEnd = maRanges.end(); for (; itr != itrEnd; ++itr) { -- cgit