diff options
author | László Németh <nemeth@numbertext.org> | 2019-12-29 12:34:34 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-12-29 16:36:06 +0100 |
commit | 8039c9eb27170a162830f0ecd2086010a7a5858f (patch) | |
tree | d0520fefab6d1dc271ad543115cf210641675545 /sw/qa/extras/uiwriter/uiwriter.cxx | |
parent | bde382a2568147c1a5eec0cb885856cd5aaae3ad (diff) |
tdf#38394 AutoCorrect: fix ’« in French l’« word »
instead of using the bad ’" -> ’» autocorrection.
Change-Id: I48adbb2e8ca8e786c7835ff186d4580e856cf3c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85945
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-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 09f77700472f..32fa64f16d45 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -362,6 +362,7 @@ public: void testTdf108423(); void testTdf106164(); void testTdf54409(); + void testTdf38394(); void testInconsistentBookmark(); CPPUNIT_TEST_SUITE(SwUiWriterTest); @@ -567,6 +568,7 @@ public: CPPUNIT_TEST(testTdf108423); CPPUNIT_TEST(testTdf106164); CPPUNIT_TEST(testTdf54409); + CPPUNIT_TEST(testTdf38394); CPPUNIT_TEST_SUITE_END(); private: @@ -7067,6 +7069,20 @@ void SwUiWriterTest::testTdf54409() CPPUNIT_ASSERT_EQUAL(sReplaced3, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); } +void SwUiWriterTest::testTdf38394() +{ + SwDoc* pDoc = createDoc("tdf38394.fodt"); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + // testing autocorrect of French l'" -> l'« (instead of l'») + SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect()); + pWrtShell->Insert(u"l\u2019"); + const sal_Unicode cChar = '"'; + pWrtShell->AutoCorrect(corr, cChar); + sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); + OUString sReplaced(u"l\u2019« "); + CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_PLUGIN_IMPLEMENT(); |