[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - editeng/source sw/qa
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jun 5 12:54:16 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 9bc5e0808c815374d8a56bf0234996f133b19744
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Tue Jun 2 10:12:27 2020 +0200
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Fri Jun 5 14:53:44 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>
(cherry-picked from commit 967d1ba1f2a3f551c23ba4d9902632a0dc581224)
Change-Id: I6ebe86dbb51b032f24c7e90cb269b081435ba7d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95379
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index b381b1726f45..07883ec38c50 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1325,7 +1325,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 1cdc40cc43a6..d6c7f393df64 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -7179,6 +7179,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