summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-01-28 14:32:54 +0100
committerLászló Németh <nemeth@numbertext.org>2020-01-29 11:00:34 +0100
commit8b13da71aedd094de0d351a4bd5ad43fdb4bddde (patch)
treea8674ca240b084a4220e8b5c38930fb47ecc046c /sw
parent16cb51aedf38d2f9e10d4398665417ef922eb9fb (diff)
tdf#128959 DOCX import: fix missing text lines in tables
Orphan/widow line break settings aren't always ignored by Writer table layout code, in this case, in vertically merged cells, resulting missing paragraph lines. As a workaround for interoperability, disable orphan/widow control in cell paragraphs during the DOCX import to get correct layout in Writer, too. Change-Id: I48fdb0a3bb421fd4df2c729e307a7ef483e3e772 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87637 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/data/tdf128959.docxbin0 -> 24490 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx21
2 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf128959.docx b/sw/qa/extras/layout/data/tdf128959.docx
new file mode 100644
index 000000000000..f22f66504478
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf128959.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 567fdea446f0..746b8a068aaf 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3608,6 +3608,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117982)
//the source document.
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128959)
+{
+ // no orphan/widow control in table cells
+ SwDoc* pDocument = createDoc("tdf128959.docx");
+ CPPUNIT_ASSERT(pDocument);
+ discardDumpedLayout();
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+
+ // first two lines of the paragraph in the split table cell on the first page
+ // (these lines were completely lost)
+ assertXPath(
+ pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/LineBreak[1]", "Line",
+ "a)Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue ");
+ assertXPath(
+ pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/LineBreak[2]", "Line",
+ "massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit ");
+ // last line of the paragraph in the split table cell on the second page
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab[1]/row[1]/cell[1]/txt[1]/LineBreak[1]", "Line",
+ "amet commodo magna eros quis urna.");
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf121658)
{
uno::Reference<linguistic2::XHyphenator> xHyphenator = LinguMgr::GetHyphenator();