[Libreoffice-commits] .: 2 commits - sc/qa sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Sep 21 05:09:01 PDT 2012
sc/qa/unit/rangelst_test.cxx | 4 ++++
sc/source/core/tool/rangelst.cxx | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 16f1e6eddf457d03ece9f5e5967ad553730a44c0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Sep 21 13:38:18 2012 +0200
add test case for deleting the only row in ScRangeList::UpdateReference
Change-Id: I88cf1e679dc83e051e27a1d20775cc161cb9e3c5
diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx
index b447dc1..7079166 100644
--- a/sc/qa/unit/rangelst_test.cxx
+++ b/sc/qa/unit/rangelst_test.cxx
@@ -184,6 +184,10 @@ void Test::testUpdateReference_DeleteRow()
CPPUNIT_ASSERT(!aList.In(ScRange(nCol, 4, 0)));
}
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(12), aList.GetCellCount());
+
+ ScRangeList aList2(ScRange(2,2,0,2,2,0));
+ aList2.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,3,0,MAXCOL,MAXROW,0), 0, -1, 0);
+ CPPUNIT_ASSERT(aList2.empty());
}
void Test::testUpdateReference_DeleteCol()
commit 1e3919f040ade5d0f7f9fa854b3ed23366080c0c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Sep 21 13:37:31 2012 +0200
fix problem in ScRangeList::UpdateReference when deleting one row/col
Change-Id: I588565f65be5c9de54b9f038cf297fda4022fd9b
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 7a874e8..393d0f0 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -424,11 +424,11 @@ bool ScRangeList::UpdateReference(
{
if(nDx < 0)
{
- DeleteArea(nCol1+nDx, nRow1, nTab1, nCol1-1, nRow1, nTab2);
+ DeleteArea(nCol1+nDx, nRow1, nTab1, nCol1-1, nRow2, nTab2);
}
if(nDy < 0)
{
- DeleteArea(nCol1, nRow1+nDy, nTab1, nCol1, nRow1-1, nTab2);
+ DeleteArea(nCol1, nRow1+nDy, nTab1, nCol2, nRow1-1, nTab2);
}
SAL_WARN_IF(nDx < 0 && nDy < 0, "sc", "nDx and nDy are negative, check why");
}
More information about the Libreoffice-commits
mailing list