Rebased ref, commits from common ancestor: commit e7eb2ff2f1f9ec2699a7222ad4e12dd1bdfc9b9f Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Feb 21 15:49:56 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Mon Apr 15 18:20:36 2024 +0200
tdf#159797: sw_uiwriter6: Add unittest Change-Id: I69b8ea673f676f1106e257cef507937cbd5ebd2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163695 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index db63836f67cf..bb51b96d8137 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -2880,6 +2880,19 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf146178) CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pCursor->GetPoint()->GetContentIndex()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf159797) +{ + createSwDoc(); + SwXTextDocument& rTextDoc = dynamic_cast<SwXTextDocument&>(*mxComponent); + + emulateTyping(rTextDoc, u"This - is replaced. - But this is not replaced."); + // Without the fix in place, this would fail with + // - Expected: This – is replaced. – But this is not replaced. + // - Actual : This – is replaced. - But this is not replaced. + CPPUNIT_ASSERT_EQUAL(OUString(u"This – is replaced. – But this is not replaced."), + getParagraph(1)->getString()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155407) { createSwDoc();