diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak.docx | bin | 0 -> 21473 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak2.docx | bin | 0 -> 18324 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak3.docx | bin | 0 -> 18336 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf153613_inlineAfterPgBreak.docx | bin | 0 -> 21240 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 28 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 3 |
6 files changed, 30 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak.docx b/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak.docx Binary files differnew file mode 100644 index 000000000000..45010820867d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak2.docx b/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak2.docx Binary files differnew file mode 100644 index 000000000000..c29f8a49516b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak3.docx b/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak3.docx Binary files differnew file mode 100644 index 000000000000..5dd61ec7f409 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf153613_anchoredAfterPgBreak3.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf153613_inlineAfterPgBreak.docx b/sw/qa/extras/ooxmlexport/data/tdf153613_inlineAfterPgBreak.docx Binary files differnew file mode 100644 index 000000000000..6b25d6c70c1e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf153613_inlineAfterPgBreak.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index d5121944c354..f6d1d48094f0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -102,6 +102,34 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153592_columnBreaks) assertXPath(pXmlDoc, "//w:br", 2); } +DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak, "tdf153613_anchoredAfterPgBreak.docx") +{ + const auto& pLayout = parseLayoutDump(); + // An anchored TO character image anchors before the page break. + assertXPath(pLayout, "//page[1]//anchored", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak2, "tdf153613_anchoredAfterPgBreak2.docx") +{ + const auto& pLayout = parseLayoutDump(); + // An anchored TO character image, followed by more characters moves to the following page + assertXPath(pLayout, "//page[2]//anchored", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak3, "tdf153613_anchoredAfterPgBreak3.docx") +{ + const auto& pLayout = parseLayoutDump(); + // An anchored TO character image, with setting splitPgBreakAndParaMark moves to the following page + assertXPath(pLayout, "//page[2]//anchored", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf153613_inlineAfterPgBreak, "tdf153613_inlineAfterPgBreak.docx") +{ + const auto& pLayout = parseLayoutDump(); + // An inline AS character image moves to the following page when after the page break. + assertXPath(pLayout, "//page[2]//anchored", 1); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert) { // Given a docx document with a shape with vert="mongolianVert". diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 86753083a154..a9e35622a966 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2550,7 +2550,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) if ( m_pImpl->IsDiscardHeaderFooter() ) break; //tdf112342: Break before images as well, if there are page break - if (m_pImpl->isBreakDeferred(BreakType::PAGE_BREAK)) + if (m_pImpl->isBreakDeferred(BreakType::PAGE_BREAK) + && nSprmId == NS_ooxml::LN_inline_inline) { m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH) ->Insert(PROP_BREAK_TYPE, uno::Any(style::BreakType_PAGE_BEFORE)); |