summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter.cxx
diff options
context:
space:
mode:
authorNickson Thanda <nicksonthanda10@msn.com>2018-06-22 04:59:16 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-07-02 09:32:29 +0200
commit391134e4cc0cf444ac50c6df02073de57ad9c466 (patch)
tree4a4c32f9054606ff96789e278bdc6bdd79711832 /sw/qa/extras/uiwriter/uiwriter.cxx
parentf54143088a867c59be144f1d4d7cd6d9fe1c18f5 (diff)
tdf#51223 can now undo auto-capitalise with enter
Change-Id: I1ff1bd0137415349d1eb89bef0947453f72a8ef5 Reviewed-on: https://gerrit.libreoffice.org/56267 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index e6ab7cdaf515..3dc0e7a233ea 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -345,6 +345,7 @@ public:
void testTdf116789();
void testTdf117225();
void testTdf91801();
+ void testTdf51223();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -541,6 +542,7 @@ public:
CPPUNIT_TEST(testTdf116789);
CPPUNIT_TEST(testTdf117225);
CPPUNIT_TEST(testTdf91801);
+ CPPUNIT_TEST(testTdf51223);
CPPUNIT_TEST_SUITE_END();
private:
@@ -6311,6 +6313,19 @@ void SwUiWriterTest::testTdf91801()
CPPUNIT_ASSERT_EQUAL(555.0, xCell->getValue());
}
+void SwUiWriterTest::testTdf51223()
+{
+ SwDoc* pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
+ sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+ pWrtShell->Insert("i");
+ pWrtShell->SplitNode(true);
+ CPPUNIT_ASSERT_EQUAL(OUString("I"), static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT_EQUAL(OUString("i"), static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+
+}
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();