summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-08-10 19:14:54 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-08-11 17:38:00 +0200
commita99de4981f2e0a652d964c8c688f73485494102e (patch)
tree135f9c2f017400c1f847654f8b2ee9de74b6692d /sw/qa
parent0d5affd7a25396dbff866adae524a4c01329801f (diff)
tdf#128198 sw: text formatting: only consider upper margin for first line
The non-first lines start below the first one so the margin is already included in the previous line's Y position. Also move the testTdf116486 to layout.cxx. (regression from d07fc485d46f431405a3f6a002f951a08c559677) Change-Id: I574516ea5f9600e2d861e43162b1a69488c68819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100440 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 99ef50f97b6d8461b8953c2555298c7bbeb3405b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100499 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/layout/data/tdf116486.docx (renamed from sw/qa/extras/ooxmlimport/data/tdf116486.docx)bin22455 -> 22455 bytes
-rw-r--r--sw/qa/extras/layout/data/tdf128198-1.docxbin0 -> 17048 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx21
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx6
4 files changed, 21 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf116486.docx b/sw/qa/extras/layout/data/tdf116486.docx
index c6a4891b0cf4..c6a4891b0cf4 100644
--- a/sw/qa/extras/ooxmlimport/data/tdf116486.docx
+++ b/sw/qa/extras/layout/data/tdf116486.docx
Binary files differ
diff --git a/sw/qa/extras/layout/data/tdf128198-1.docx b/sw/qa/extras/layout/data/tdf128198-1.docx
new file mode 100644
index 000000000000..7c9974d562b9
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf128198-1.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 6ce67106162d..c94811b4d5e7 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -1139,6 +1139,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
}
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116486)
+{
+ SwDoc* pDoc = createDoc("tdf116486.docx");
+ CPPUNIT_ASSERT(pDoc);
+ OUString aTop = parseDump("/root/page/body/txt/Special", "nHeight");
+ CPPUNIT_ASSERT_EQUAL(OUString("4006"), aTop);
+}
+
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128198)
+{
+ SwDoc* pDoc = createDoc("tdf128198-1.docx");
+ CPPUNIT_ASSERT(pDoc);
+ xmlDocPtr pLayout = parseLayoutDump();
+ // the problem was that line 5 was truncated at "this "
+ // due to the fly anchored in previous paragraph
+ assertXPath(pLayout, "/root/page/body/txt[2]/LineBreak[5]", "Line",
+ "to access any service, any time, anywhere. From this perspective, satellite "
+ "boasts some ");
+ assertXPath(pLayout, "/root/page/body/txt[2]/LineBreak[6]", "Line", "significant advantages. ");
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testNoLineBreakAtSlash)
{
load(DATA_DIRECTORY, "no-line-break-at-slash.fodt");
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index a14b97aec66a..4b69a62859c6 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -411,12 +411,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf114217, "tdf114217.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), xDrawPage->getCount());
}
-DECLARE_OOXMLIMPORT_TEST(testTdf116486, "tdf116486.docx")
-{
- OUString aTop = parseDump("/root/page/body/txt/Special", "nHeight");
- CPPUNIT_ASSERT_EQUAL(OUString("4006"), aTop);
-}
-
DECLARE_OOXMLIMPORT_TEST(testTdf119200, "tdf119200.docx")
{
auto xPara = getParagraph(1);