From 6bac39f309e11a515a2b2ecdf43a4b49ccd53502 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 2 Nov 2012 13:23:58 -0400 Subject: More test cases for cell notes that currently fail. Change-Id: I23a5a39ab13106a27a02adbec0ff1ab64a43abef --- sc/qa/unit/ucalc.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 62e98c6b2ace..ce8ea865c239 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -4258,7 +4258,7 @@ void Test::testPostIts() rAddr.IncRow(); // cell C4 CPPUNIT_ASSERT_MESSAGE("note not there", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); - // Insert column at column 1. + // Insert column at column A. bool bInsertCol = m_pDoc->InsertCol(0, 0, MAXROW, 0, 1, 1); CPPUNIT_ASSERT_MESSAGE("failed to insert column", bInsertCol ); @@ -4285,6 +4285,16 @@ void Test::testPostIts() m_pDoc->DeleteRow(2, 0, 2, 0, 3, 1); CPPUNIT_ASSERT_MESSAGE("Note shouldn't have moved but it has.", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + // Now, with the note at D4, delete cell D3. This should shift the note one cell up. + m_pDoc->DeleteRow(3, 0, 3, 0, 2, 1); + rAddr.IncRow(-1); // cell D3 + CPPUNIT_ASSERT_MESSAGE("Note at D4 should have shifted up to D3.", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + + // Delete column C. This should shift the note one cell left. + m_pDoc->DeleteCol(0, 0, MAXROW, 0, 2, 1); + rAddr.IncCol(-1); // cell C3 + CPPUNIT_ASSERT_MESSAGE("Note at D3 should have shifted left to C3.", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + m_pDoc->DeleteTab(0); } -- cgit