sw/qa/extras/uiwriter/uiwriter6.cxx |   13 +++++++++++++
 1 file changed, 13 insertions(+)

New commits:
commit cca5ad01548485db7b0dcbbaa5b0d9a0184d42fb
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 17:45:49 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..c7b92dca5362 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(u"This – is replaced. – But this is not 
replaced."_ustr,
+                         getParagraph(1)->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155407)
 {
     createSwDoc();

Reply via email to