diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/layout/data/table-in-footnote.docx | bin | 0 -> 15684 bytes | |||
-rw-r--r-- | sw/qa/core/layout/flycnt.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/layout/fly.cxx | 6 |
3 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/core/layout/data/table-in-footnote.docx b/sw/qa/core/layout/data/table-in-footnote.docx Binary files differnew file mode 100644 index 000000000000..10e20ffbf44c --- /dev/null +++ b/sw/qa/core/layout/data/table-in-footnote.docx diff --git a/sw/qa/core/layout/flycnt.cxx b/sw/qa/core/layout/flycnt.cxx index ba688728743b..539d379d97c2 100644 --- a/sw/qa/core/layout/flycnt.cxx +++ b/sw/qa/core/layout/flycnt.cxx @@ -1010,6 +1010,20 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyIntoTable) // second part of a floating table into a table on the next page, not before that table. calcLayout(); } + +CPPUNIT_TEST_FIXTURE(Test, testSplitFlyFromAsCharAnchor) +{ + // Given a document with a footnote that has a table (imported in an as-char anchored frame in + // Writer): + createSwDoc("table-in-footnote.docx"); + + // When changing the anchor type of that frame to to-para: + // Then make sure we don't crash: + selectShape(1); + // Without the accompanying fix in place, this test would have crashed, we tried to split a + // frame+table inside a footnote. + dispatchCommand(mxComponent, ".uno:SetAnchorToPara", {}); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index a06c2a9e7f70..039aeb549f77 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -687,6 +687,12 @@ bool SwFlyFrame::IsFlySplitAllowed() const return false; } + if (pFlyAnchor && pFlyAnchor->IsInFootnote()) + { + // No split in footnotes. + return false; + } + const SwFlyFrameFormat* pFormat = GetFormat(); const SwFormatVertOrient& rVertOrient = pFormat->GetVertOrient(); if (rVertOrient.GetVertOrient() == text::VertOrientation::BOTTOM) |