diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-06-14 12:20:22 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-06-14 16:05:42 +0200 |
commit | 91b87ab5ed1d0c3eacf9bf295999bf1786beac34 (patch) | |
tree | 8142392a339cf55eb8bde3fcdf57e258e430153d /sw/qa/core/text/text.cxx | |
parent | 82bbf63582bdf28e7918e58ebf6657a9144bc9f3 (diff) |
tdf#89288: Add test
Change-Id: Ia58dbd66016727fa61507dae0f4ac4044b959879
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153042
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 | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 30a12adc7af7..4ba02f7b3135 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -1309,6 +1309,52 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testFloattableOverlap) CPPUNIT_ASSERT(!rRect1.Overlaps(rRect2)); } +CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf89288) +{ + // Given a document with 2 paragraphs of mixed Complex and Western text, + // and 2 other paragrpahs of mixed Western and Asian text: + createSwDoc("tdf89288.fodt"); + + // When laying out that document: + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + // Then make sure there is no kern portions between the Western and Complex + // portions: + assertXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion", 3); + assertXPath(pXmlDoc, + "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']", 3); + assertXPath(pXmlDoc, + "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']", 0); + + assertXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion", 3); + assertXPath(pXmlDoc, + "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']", 3); + assertXPath(pXmlDoc, + "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']", 0); + + // But also make sure there is a kern portion between each Western and Asian + // portion: + assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion", 5); + assertXPath(pXmlDoc, + "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']", 3); + assertXPath(pXmlDoc, + "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']", 2); + assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + "PortionType::Kern"); + assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[4]", "type", + "PortionType::Kern"); + + assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion", 5); + assertXPath(pXmlDoc, + "//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']", 3); + assertXPath(pXmlDoc, + "//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']", 2); + assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + "PortionType::Kern"); + assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[4]", "type", + "PortionType::Kern"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |