diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-07-27 19:03:28 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-07-27 23:49:16 +0200 |
commit | 3af30bafbedb8eb481024efb35cb7876c63d26dc (patch) | |
tree | c83e214718ccaff917ec164aa5f3e4797b9c121b /sw/qa/core/text/text.cxx | |
parent | fe43f5971dfd2a121634eea9e39c7ad0cf3f962a (diff) |
sw: Handle surrogate pairs when tweaking script info
Change-Id: I18e8358657303571d5d90e5162dbb68cbe067980
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154995
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'sw/qa/core/text/text.cxx')
-rw-r--r-- | sw/qa/core/text/text.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 308098c85699..4f75de8af533 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -1463,6 +1463,23 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf129810) } } +CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testScriptinfosurrogatePairs) +{ + createSwDoc("scriptinfo-surrogate-pairs.fodt"); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + // Test that a dotted circle is grouped with the mark after it, even if the + // mark is outside Unicode’s Basic Multilingual Plan (i.e. a surrogate pair + // in UTF-8) + // + // Without the fix it fails with: + // - Expected: 11 + // - Actual : 11◌ + assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); + assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", + u"\u25CC\U00010EFD"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |