diff options
author | Daniel Arato (NISZ) <arato.daniel@nisz.hu> | 2020-08-24 11:05:17 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-08-28 13:13:58 +0200 |
commit | d336e6c26012255015d3fc0caf8e7fafe14bd8f2 (patch) | |
tree | 66fd21b95bd80520f8251f30620109f782703605 /sw/qa/extras/layout | |
parent | faa36a5310f432a245baa8e9f765e759ab1cba2d (diff) |
tdf#69647 sw layout: fix line spacing with inline pictures
Line height is now based on (the biggest) font size in the
line rather than on the size of the tallest object there,
according to ODF and like MSO does.
Note: handling of first paragraph line is still different.
Co-authored-by: Attila Bánhegyi (NISZ)
Change-Id: I6cebea7dbdedd21ea173a0a867434525e7b86337
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101272
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/extras/layout')
-rw-r--r-- | sw/qa/extras/layout/data/tdf69647_images.odt | bin | 0 -> 13188 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/data/tdf69647_text.docx | bin | 0 -> 5353 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 19 |
3 files changed, 18 insertions, 1 deletions
diff --git a/sw/qa/extras/layout/data/tdf69647_images.odt b/sw/qa/extras/layout/data/tdf69647_images.odt Binary files differnew file mode 100644 index 000000000000..e4f7fbe8039a --- /dev/null +++ b/sw/qa/extras/layout/data/tdf69647_images.odt diff --git a/sw/qa/extras/layout/data/tdf69647_text.docx b/sw/qa/extras/layout/data/tdf69647_text.docx Binary files differnew file mode 100644 index 000000000000..587089ff29cf --- /dev/null +++ b/sw/qa/extras/layout/data/tdf69647_text.docx diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 438a60bc633a..5e8f2d89eed4 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2076,6 +2076,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections) CheckRedlineSectionsHidden(); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TDF69647_images) +{ + createDoc("tdf69647_images.odt"); + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages does not match!", 2, getPages()); +} + +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TDF69647_text) +{ + createDoc("tdf69647_text.docx"); + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages does not match!", 2, getPages()); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables) { createDoc("redline_table.fodt"); @@ -3756,7 +3772,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123651) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with 'Expected: 7639; // Actual: 12926'. The shape was below the second "Lorem ipsum" text, not above it. - assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "top", "7639"); + const sal_Int32 nTopValue = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "top").toInt32(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(7639, nTopValue, 10); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116501) |