diff options
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 16 |
2 files changed, 20 insertions, 0 deletions
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(); |