summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-02-21 15:49:56 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-04-30 15:10:44 +0200
commit8834eb33de01c985f45f67a93a3983f3eeae6382 (patch)
treeeeb2b992c3381e1c7acde73a8c5aa24dd9e9bb44
parente9208a9d03a6e06e80a6cc9335d9886c90d776f2 (diff)
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 <xiscofauli@libreoffice.org>
-rw-r--r--sw/qa/extras/uiwriter/uiwriter6.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx
index 5b4140e02967..c76dd01d3d3d 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -3008,6 +3008,19 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf106663HeaderTextFrameGoToNextPlacem
CPPUNIT_ASSERT(pCursor->GetPoint()->GetNode().GetTextNode()->GetText().startsWith("Heading"));
}
+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(u"This – is replaced. – But this is not replaced."_ustr,
+ getParagraph(1)->getString());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155407)
{
createSwDoc();