diff options
author | László Németh <nemeth@numbertext.org> | 2021-02-25 10:55:57 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-26 15:56:13 +0100 |
commit | 472e2e08480d04ac9cc1c9ddcb5862bc2f1d8660 (patch) | |
tree | 6dfa2805faad9089c1a82d8d92e038124147227f /sw/qa | |
parent | 2f40c8f59cb23106e36071082d2570e2dbca4d22 (diff) |
tdf#134940 sw: fix AutoCorrect of arrow "-->"
Fix bad replacement of "-->" with "–>" instead of "→"
(i.e. premature replacement of "--" to n-dash)
since '>' was added to IsAutoCorrectChar().
Regression from commit 57f07b1d7378d218648667c5b1315cc8ad905875
"tdf#133524 AutoCorrect: support double angle quotes".
Change-Id: I06f0cddb48d13c8e230dab964f79f588799ed4ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111527
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit d1be3d80d0ca5ccd7639ede379a1befc48dc73f2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111580
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 32788114c15f..54d90afe1f88 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -7612,6 +7612,16 @@ void SwUiWriterTest::testTdf133524() pWrtShell->AutoCorrect(corr, '"'); sReplaced += u".”"; CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); + // tdf#134940 avoid premature replacement of "--" in "-->" + pWrtShell->Insert(u" --"); + pWrtShell->AutoCorrect(corr, '>'); + OUString sReplaced2(sReplaced + u" -->"); + // This was "–>" instead of "-->" + CPPUNIT_ASSERT_EQUAL(sReplaced2, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); + pWrtShell->AutoCorrect(corr, ' '); + sReplaced += u" → "; + // This was "–>" instead of "→" + CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); } void SwUiWriterTest::testTdf133524_Romanian() |