diff options
author | Varun <varun.dhall@studentpartner.com> | 2015-08-11 22:50:08 +0530 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-13 11:25:43 +0000 |
commit | 7e32ce6b4f910c0d43ce6c6ee28dac1e5aad0e52 (patch) | |
tree | 642b9f961fd474da00f7ae6a0c9305127598ece3 | |
parent | 94cdcaa4d8db8f03ac9a84dac54357efff3eb123 (diff) |
Added Test for tdf#74363 auto correct of initial captials on start
Change-Id: I1c17778ef4e1d5b977a7c3e6f6f78caca4e0a8ec
Reviewed-on: https://gerrit.libreoffice.org/17654
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index d59f3b3d489b..edfd808055a1 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -133,6 +133,7 @@ public: void testTdf78742(); void testUnoParagraph(); void testSearchWithTransliterate(); + void testTdf74363(); void testTdf80663(); void testTdf57197(); void testTdf90808(); @@ -202,6 +203,7 @@ public: CPPUNIT_TEST(testTdf78742); CPPUNIT_TEST(testUnoParagraph); CPPUNIT_TEST(testSearchWithTransliterate); + CPPUNIT_TEST(testTdf74363); CPPUNIT_TEST(testTdf80663); CPPUNIT_TEST(testTdf57197); CPPUNIT_TEST(testTdf90808); @@ -1576,6 +1578,21 @@ void SwUiWriterTest::testSearchWithTransliterate() CPPUNIT_ASSERT_EQUAL(1,(int)case2); } +void SwUiWriterTest::testTdf74363() +{ + SwDoc* pDoc = createDoc(); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + //testing autocorrect of initial capitals on start of first paragraph + SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect()); + //Inserting one all-lowercase word into the first paragraph + pWrtShell->Insert("testing"); + const sal_Unicode cChar = ' '; + pWrtShell->AutoCorrect(corr, cChar); + //The word should be capitalized due to autocorrect + sal_uLong nIndex = pWrtShell->GetCrsr()->GetNode().GetIndex(); + CPPUNIT_ASSERT_EQUAL(OUString("Testing "), static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); +} + void SwUiWriterTest::testTdf80663() { SwDoc* pDoc = createDoc(); |