diff options
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index d871b78f7f27..1e5006d90484 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -309,6 +309,7 @@ ACFlags SvxAutoCorrect::GetDefaultFlags() static constexpr sal_Unicode cEmDash = 0x2014; static constexpr sal_Unicode cEnDash = 0x2013; +static constexpr sal_Unicode cApostrophe = 0x2019; SvxAutoCorrect::SvxAutoCorrect( const OUString& rShareAutocorrFile, const OUString& rUserAutocorrFile ) @@ -850,7 +851,7 @@ void SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc, } else if (pWordStt && !rCC.isDigit(aText, pStr - pStart)) { - if( lcl_IsInAsciiArr( "-'", *pStr ) && // These characters are allowed in words + if( (lcl_IsInAsciiArr( "-'", *pStr ) || *pStr == cApostrophe) && // These characters are allowed in words pWordStt - 1 == pStr && // Installation at beginning of paragraph. Replaced < by <= (#i38971#) (pStart + 1) <= pStr && diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 1638f879a431..5b29fdc371da 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -359,6 +359,7 @@ public: void testTdf91801(); void testTdf51223(); void testTdf108423(); + void testTdf106164(); void testInconsistentBookmark(); CPPUNIT_TEST_SUITE(SwUiWriterTest); @@ -562,6 +563,7 @@ public: CPPUNIT_TEST(testTdf51223); CPPUNIT_TEST(testInconsistentBookmark); CPPUNIT_TEST(testTdf108423); + CPPUNIT_TEST(testTdf106164); CPPUNIT_TEST_SUITE_END(); private: @@ -6973,6 +6975,20 @@ void SwUiWriterTest::testTdf108423() CPPUNIT_ASSERT_EQUAL(sText, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); } +void SwUiWriterTest::testTdf106164() +{ + SwDoc* pDoc = createDoc(); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + // testing autocorrect of we're -> We're on start of first paragraph + SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect()); + pWrtShell->Insert(u"we\u2019re"); + const sal_Unicode cChar = ' '; + pWrtShell->AutoCorrect(corr, cChar); + sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); + OUString sIApostrophe(u"We\u2019re "); + CPPUNIT_ASSERT_EQUAL(sIApostrophe, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_PLUGIN_IMPLEMENT(); |