diff options
author | László Németh <nemeth@numbertext.org> | 2019-12-20 19:35:38 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2019-12-24 12:49:20 +0100 |
commit | b6d9188c2ea28867c3792c489c646543b381f17d (patch) | |
tree | 1895926eb8594853fb6a6b3efa046bdba6dcb72d /sw | |
parent | 7b9afea6d34ec83de75ddcd5c45188c4cf949b90 (diff) |
tdf#106164 AutoCorrect: capitalize words with apostrophe
at sentence starting position, for example
we’re -> We’re
This worked only with ASCII apostrophe ('), and changing to default
usage of typographical apostrophe (U+2019) broke this kind of
capitalization from commit e6fade1ce133039d28369751b77ac8faff6e40cb
(tdf#38395 enable smart apostrophe replacement by default).
Change-Id: If582194364f77cfb9fc0f04a28ac79a08bb804ff
Reviewed-on: https://gerrit.libreoffice.org/85630
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit f6cf80c81043d84606a5b5f7d93ae958307a16d3)
Reviewed-on: https://gerrit.libreoffice.org/85660
(cherry picked from commit 030b7c01dcb2262e5dc73de81dd33e2e24529da2)
Reviewed-on: https://gerrit.libreoffice.org/85664
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 0a646fd730e7..6689983ea3a8 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -359,6 +359,7 @@ public: void testTdf91801(); void testTdf51223(); void testTdf108423(); + void testTdf106164(); void testInconsistentBookmark(); CPPUNIT_TEST_SUITE(SwUiWriterTest); @@ -568,6 +569,7 @@ public: CPPUNIT_TEST(testTdf51223); CPPUNIT_TEST(testInconsistentBookmark); CPPUNIT_TEST(testTdf108423); + CPPUNIT_TEST(testTdf106164); CPPUNIT_TEST_SUITE_END(); private: @@ -6943,6 +6945,20 @@ void SwUiWriterTest::testTdf108423() CPPUNIT_ASSERT_EQUAL(sText, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); } +void SwUiWriterTest::testTdf106164() +{ + SwDoc* pDoc = createDoc(); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + // testing autocorrect of we're -> We're on start of first paragraph + SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect()); + pWrtShell->Insert(u"we\u2019re"); + const sal_Unicode cChar = ' '; + pWrtShell->AutoCorrect(corr, cChar); + sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); + OUString sIApostrophe(u"We\u2019re "); + CPPUNIT_ASSERT_EQUAL(sIApostrophe, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_PLUGIN_IMPLEMENT(); |