[Libreoffice-commits] core.git: editeng/source sw/qa
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 2 16:41:25 UTC 2020
editeng/source/misc/svxacorr.cxx | 8 +++++++-
sw/qa/extras/uiwriter/uiwriter.cxx | 6 ++++++
2 files changed, 13 insertions(+), 1 deletion(-)
New commits:
commit 967d1ba1f2a3f551c23ba4d9902632a0dc581224
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Tue Jun 2 10:12:27 2020 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Tue Jun 2 18:40:38 2020 +0200
tdf#132301 AutoCorrect: fix ’« in French qu’« word »
instead of using the bad ’" -> ’» autocorrection.
Also limit this for abbreviated single-letter form of
French words ce, de, je, la, le, ne, me, te, se and si.
See commit 8039c9eb27170a162830f0ecd2086010a7a5858f
(tdf#38394 AutoCorrect: fix ’« in French l’« word »).
Change-Id: I1761365d90ae3af3c9ab47a3a82bf0abbe1b32be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95345
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 51fdf5c30746..c776cb45aae7 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1326,7 +1326,13 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
// tdf#38394 use opening quotation mark << in French l'<<word>>
if ( !bSingle && !bSttQuote && cPrev == cApostrophe &&
primary(eLang) == primary(LANGUAGE_FRENCH) &&
- (nInsPos == 2 || (nInsPos > 2 && IsWordDelim( rTxt[ nInsPos-3 ] ))) )
+ ( ( ( nInsPos == 2 || ( nInsPos > 2 && IsWordDelim( rTxt[ nInsPos-3 ] ) ) ) &&
+ // abbreviated form of ce, de, je, la, le, ne, me, te, se or si
+ OUString("cdjlnmtsCDJLNMTS").indexOf( rTxt[ nInsPos-2 ] ) > -1 ) ||
+ ( ( nInsPos == 3 || (nInsPos > 3 && IsWordDelim( rTxt[ nInsPos-4 ] ) ) ) &&
+ // abbreviated form of que
+ ( rTxt[ nInsPos-2 ] == 'u' || rTxt[ nInsPos-2 ] == 'U' ) &&
+ ( rTxt[ nInsPos-3 ] == 'q' || rTxt[ nInsPos-3 ] == 'Q' ) ) ) )
{
bSttQuote = true;
}
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 92c4201bce24..bb0d12aa7804 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -7186,6 +7186,12 @@ void SwUiWriterTest::testTdf38394()
sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
OUString sReplaced(u"l\u2019« ");
CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+ // tdf#132301 autocorrect of qu'«
+ pWrtShell->Insert(u" qu\u2019");
+ pWrtShell->AutoCorrect(corr, cChar);
+ nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+ sReplaced += u" qu\u2019« ";
+ CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
}
void SwUiWriterTest::testTdf59666()
More information about the Libreoffice-commits
mailing list