sw/qa/extras/unowriter/unowriter.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
New commits: commit d103dee1d52f09097034d6267cd8018fb04f71fd Author: Caolán McNamara <[email protected]> AuthorDate: Fri Dec 12 10:28:37 2025 +0000 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Dec 12 16:35:13 2025 +0100 use an SMP char that exists in some bundled font: Noto Sans has U+1DF1E Change-Id: Ic2b249fa244cf5d1c0b973b2cb9c7008c9f54918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195539 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx index 07431f880876..80738e52f0a9 100644 --- a/sw/qa/extras/unowriter/unowriter.cxx +++ b/sw/qa/extras/unowriter/unowriter.cxx @@ -1367,6 +1367,8 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTdf141525) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTdf160278) { createSwDoc(); + uno::Reference<beans::XPropertySet> xParaProps(getParagraph(1), uno::UNO_QUERY); + xParaProps->setPropertyValue(u"CharFontName"_ustr, uno::Any(u"Noto Sans"_ustr)); auto xTextDocument(mxComponent.queryThrow<css::text::XTextDocument>()); auto xText(xTextDocument->getText()); xText->setString(u"123"_ustr); @@ -1374,11 +1376,11 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTdf160278) auto xCursor = xText->createTextCursorByRange(xText->getEnd()); xCursor->goLeft(1, true); CPPUNIT_ASSERT_EQUAL(u"3"_ustr, xCursor->getString()); - // Insert an SMP character U+1f702 (so it's two UTF-16 code units, 0xd83d 0xdf02): - xCursor->setString(u"🜂"_ustr); + // Insert an SMP character U+1df1e (so it's two UTF-16 code units, 0xd837 0xdf1e): + xCursor->setString(u"𝼞"_ustr); // Without the fix, the replacement would expand the cursor one too many characters to the left, - // and the cursor text would become "2🜂", failing the next test: - CPPUNIT_ASSERT_EQUAL(u"🜂"_ustr, xCursor->getString()); + // and the cursor text would become "2𝼞", failing the next test: + CPPUNIT_ASSERT_EQUAL(u"𝼞"_ustr, xCursor->getString()); xCursor->setString(u"test"_ustr); CPPUNIT_ASSERT_EQUAL(u"test"_ustr, xCursor->getString()); // This test would fail, too; the text would be "1test":
