summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-09 22:17:59 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-02-09 22:18:23 -0500
commit863f1bfca71a5eb084931b49393fb7a9c5a0deaf (patch)
treef5bb48eef50b5e1508c87cdc387398743af29bcb /sc/qa
parentb6378a1651e7157063746d7001ef566545338bd0 (diff)
fdo#74323: Test the undo and redo as well.
Change-Id: I5ed921290fc3f98ecd268b606c0f7ccbf9016c39
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/ucalc.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 5ae240f7d295..fc539d9f1910 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5486,6 +5486,20 @@ void Test::testTransliterateText()
CPPUNIT_ASSERT_EQUAL(OUString("NOAH"), m_pDoc->GetString(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(OUString("OSCAR"), m_pDoc->GetString(ScAddress(0,2,0)));
+ // Test the undo and redo.
+ SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
+ CPPUNIT_ASSERT_MESSAGE("Failed to get undo manager.", pUndoMgr);
+
+ pUndoMgr->Undo();
+ CPPUNIT_ASSERT_EQUAL(OUString("Mike"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Noah"), m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Oscar"), m_pDoc->GetString(ScAddress(0,2,0)));
+
+ pUndoMgr->Redo();
+ CPPUNIT_ASSERT_EQUAL(OUString("MIKE"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("NOAH"), m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("OSCAR"), m_pDoc->GetString(ScAddress(0,2,0)));
+
m_pDoc->DeleteTab(0);
}