summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-17 20:09:42 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-02-17 22:26:33 -0500
commit93d2cd25597c519029ec12bbaefd6c518890beed (patch)
tree014987dbd5bdf45718943d829b2629d54c4a123c
parent1388b658cab36e9e1c94821063fb3573d3f7654b (diff)
fdo#75032: Extend the test to catch another use case.
Change-Id: Ibc9840927057d72e6fd066dee589ccfbca25bace
-rw-r--r--sc/qa/unit/ucalc.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 7b4321faef80..c7c9ba51cd17 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5107,6 +5107,7 @@ void Test::testNoteDeleteRow()
m_pDoc->SetString(aPos, "Second");
ScNoteUtil::CreateNoteFromString(*m_pDoc, aPos, "Second Note", false, false);
+ // Delete row 2.
ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
ScMarkData aMark;
aMark.SelectOneTable(0);
@@ -5138,6 +5139,24 @@ void Test::testNoteDeleteRow()
CPPUNIT_ASSERT_MESSAGE("B4 should have a note.", pNote);
CPPUNIT_ASSERT_EQUAL(OUString("Second Note"), pNote->GetText());
+ // Delete row 3.
+ rDocFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DEL_CELLSUP, true, true);
+
+ pNote = m_pDoc->GetNote(ScAddress(1,2,0));
+ CPPUNIT_ASSERT_MESSAGE("B3 should have a note.", pNote);
+ CPPUNIT_ASSERT_EQUAL(OUString("Second Note"), pNote->GetText());
+ pNote = m_pDoc->GetNote(ScAddress(1,3,0));
+ CPPUNIT_ASSERT_MESSAGE("B4 should NOT have a note.", !pNote);
+
+ // Undo and check the result.
+ pUndoMgr->Undo();
+ pNote = m_pDoc->GetNote(ScAddress(1,2,0));
+ CPPUNIT_ASSERT_MESSAGE("B3 should have a note.", pNote);
+ CPPUNIT_ASSERT_EQUAL(OUString("First Note"), pNote->GetText());
+ pNote = m_pDoc->GetNote(ScAddress(1,3,0));
+ CPPUNIT_ASSERT_MESSAGE("B4 should have a note.", pNote);
+ CPPUNIT_ASSERT_EQUAL(OUString("Second Note"), pNote->GetText());
+
m_pDoc->DeleteTab(0);
}