[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - editeng/source sw/qa

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 31 14:08:03 UTC 2019


 editeng/source/misc/svxacorr.cxx   |    4 ++++
 sw/qa/extras/uiwriter/uiwriter.cxx |   16 ++++++++++++++++
 2 files changed, 20 insertions(+)

New commits:
commit 6a37bc154b80e261e6d10d383de73da6ffa1e9d9
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Sun Dec 29 17:46:56 2019 +0100
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Tue Dec 31 15:07:26 2019 +0100

    tdf#59666 AutoCorrect: don't capitalize single Greek letters
    
    in automatic sentence capitalization (except in Greek texts),
    to keep the requested lower case scientific and mathematical symbols.
    
    Change-Id: I0c658bb69fb90e7159665939f85f1fd99477c730
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85955
    Reviewed-by: László Németh <nemeth at numbertext.org>
    Tested-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 04ef45a6dd7692c6ee08769c4ac4a0e92a0b64b8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86042
    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 b0d163865289..10f91239625a 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -895,6 +895,10 @@ void SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
         lcl_IsInAsciiArr( ".-)>", *pDelim ) )
         return;
 
+    // tdf#59666 don't capitalize single Greek letters (except in Greek texts)
+    if ( 1 == pDelim - pWordStt && 0x03B1 <= *pWordStt && *pWordStt <= 0x03C9 && eLang != LANGUAGE_GREEK )
+        return;
+
     if( !bAtStart ) // Still no beginning of a paragraph?
     {
         if (NonFieldWordDelim(*pStr))
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index ede1736ce0dc..52003fe601f8 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -362,6 +362,7 @@ public:
     void testTdf106164();
     void testTdf54409();
     void testTdf38394();
+    void testTdf59666();
     void testInconsistentBookmark();
 
     CPPUNIT_TEST_SUITE(SwUiWriterTest);
@@ -568,6 +569,7 @@ public:
     CPPUNIT_TEST(testTdf106164);
     CPPUNIT_TEST(testTdf54409);
     CPPUNIT_TEST(testTdf38394);
+    CPPUNIT_TEST(testTdf59666);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -7031,6 +7033,20 @@ void SwUiWriterTest::testTdf38394()
     CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
 }
 
+void SwUiWriterTest::testTdf59666()
+{
+    SwDoc* pDoc = createDoc();
+    SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+    // testing missing autocorrect of single Greek letters
+    SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect());
+    pWrtShell->Insert(u"\u03C0");
+    const sal_Unicode cChar = ' ';
+    pWrtShell->AutoCorrect(corr, cChar);
+    sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+    OUString sReplaced(u"\u03C0 ");
+    CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
 


More information about the Libreoffice-commits mailing list