sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak6.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 12 ++++++++++ 2 files changed, 12 insertions(+)
New commits: commit 6515f66372afb4d2e3ec57f9c99be4c3ffb2de84 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Thu Feb 16 16:03:34 2023 -0500 Commit: Justin Luth <jl...@mail.com> CommitDate: Thu Feb 16 23:23:06 2023 +0000 tdf#153613 DOCX: DID YOU FIX ME? unit test So once we have a page break, we need to know the rest of the paragraph's contents before the decision can be made to split the paragraph or not. In order to do this properly, the shape processing would need to be delayed until some "normal" character run is seen before a carriage return. That's too complicated for me, and probably not worth doing anyway. make CppunitTest_sw_ooxmlexport18 \ CPPUNIT_TEST_NAME=testTdf153613_anchoredAfterPgBreak6 Change-Id: Ie79574f2e1656a230da8df1b95fe61ea96c2802a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147175 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak6.docx b/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak6.docx new file mode 100644 index 000000000000..f8b540012d1d Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak6.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index b10a05986425..8b6795b726c5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -142,6 +142,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak3, "tdf153613_anchore assertXPath(pLayout, "//page[2]//anchored", 1); } +DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak6, "tdf153613_anchoredAfterPgBreak6.docx") +{ + // An anchored TO character image, followed by more characters moves to the following page + // The difference from test 2 is that it is not the first character run + CPPUNIT_ASSERT_EQUAL(2, getPages()); + CPPUNIT_ASSERT_EQUAL(4, getParagraphs()); + + const auto& pLayout = parseLayoutDump(); + CPPUNIT_ASSERT_EQUAL(OUString("y"), getXPathContent(pLayout, "//page[2]/body/txt[1]")); + assertXPath(pLayout, "//page[1]//anchored", 1); // DID YOU FIX ME? This should be page[2] +} + DECLARE_OOXMLEXPORT_TEST(testTdf153613_inlineAfterPgBreak, "tdf153613_inlineAfterPgBreak.docx") { const auto& pLayout = parseLayoutDump();