sw/qa/extras/ooxmlexport/data/tdf146984_anchorInShape.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx                 |   11 +++++++++++
 writerfilter/source/dmapper/DomainMapper.cxx               |    2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 63f77fc7c52ed01d3f9a27a05c8952cc4ee2d20e
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Wed Mar 15 07:54:53 2023 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Fri Mar 17 13:26:26 2023 +0000

    tdf#146984 writerfilter inline_inline: no break in shape
    
    make CppunitTest_sw_ooxmlexport18 \
        CPPUNIT_TEST_NAME=testTdf146984_anchorInShape
    
    Change-Id: I94efea80df1fee9ecd338bfec3430edfdf418e3c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149052
    Tested-by: Justin Luth <jl...@mail.com>
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf146984_anchorInShape.docx 
b/sw/qa/extras/ooxmlexport/data/tdf146984_anchorInShape.docx
new file mode 100644
index 000000000000..38fcaf9abeb9
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf146984_anchorInShape.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 9fea6fb5a218..4740e195a8b7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -102,6 +102,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104394_lostTextbox, 
"tdf104394_lostTextbox.docx"
     CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf146984_anchorInShape, 
"tdf146984_anchorInShape.docx")
+{
+    // This was only one page b/c the page break was missing.
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
+
+    const auto& pLayout = parseLayoutDump();
+    // There are shapes on both pages - these should be non-zero numbers
+    //assertXPath(pLayout, "//page[1]//anchored", 3);
+    //assertXPath(pLayout, "//page[2]//anchored", 2);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak, 
"tdf153613_anchoredAfterPgBreak.docx")
 {
     const auto& pLayout = parseLayoutDump();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 530dacfde434..7715435e3a46 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2568,7 +2568,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
             break;
         //tdf112342: Break before images as well, if there are page break
         if (m_pImpl->isBreakDeferred(BreakType::PAGE_BREAK)
-            && nSprmId == NS_ooxml::LN_inline_inline)
+            && nSprmId == NS_ooxml::LN_inline_inline && !m_pImpl->IsInShape())
         {
             if (m_pImpl->GetIsFirstParagraphInSection() || 
!m_pImpl->IsFirstRun())
             {

Reply via email to