diff options
author | Attila Bakos <bakos.attilakaroly@nisz.hu> | 2020-07-30 10:15:09 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-08-07 11:48:27 +0200 |
commit | e520a4f988bf0ff81e75e37588182af92fed7631 (patch) | |
tree | 6f4819414273f13b6aa046cc0d86da47ae8ccc8f /sw/qa | |
parent | 1cee06c080bceab86ac894f8ae86d4d296b050aa (diff) |
tdf#112342 DOCX import: fix page break before image-only paragraphs
Picture anchored to an empty paragraphs was moved to the
previous page, because the deferred page wasn't handled here.
Change-Id: I4a694dd443ca8b67c4addbcba3523bffecd21418
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99763
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf112342.docx | bin | 0 -> 19601 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf112342.docx b/sw/qa/extras/ooxmlexport/data/tdf112342.docx Binary files differnew file mode 100644 index 000000000000..ab4c7ee07d4d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112342.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 8c2899046a3b..4e0bcad21fc7 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -295,6 +295,21 @@ DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter, assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "1147"); } +DECLARE_OOXMLIMPORT_TEST(TestTdf112342, "tdf112342.docx") +{ + //Get the last para + uno::Reference<text::XTextRange> xPara = getParagraph(3); + auto xCur = xPara->getText()->createTextCursor(); + //Go to the end of it + xCur->gotoEnd(false); + //And let's remove the last 2 chars (the last para with its char). + xCur->goLeft(2, true); + xCur->setString(""); + + //If the second paragraph on the second page, this will be passed. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Page break does not match", 2, getPages()); +} + DECLARE_OOXMLIMPORT_TEST(TestTdf132483, "tdf132483.docx") { uno::Reference<beans::XPropertySet> xOLEProps(getShape(1), uno::UNO_QUERY_THROW); |