summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/layout/tabfrm.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 41ea720609b1..8cd16b8d80ce 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -760,6 +760,9 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine,
// #i26945# - include check, if objects fit
const SwTwips nDistanceToUpperPrtBottom =
aRectFnSet.BottomDist(rTab.getFrameArea(), aRectFnSet.GetPrtBottom(*rTab.GetUpper()));
+ // also check the footnote boss - it *may* be smaller than the upper now!
+ const SwTwips nDistanceToFootnoteBodyPrtBottom =
+ aRectFnSet.BottomDist(rTab.getFrameArea(), aRectFnSet.GetPrtBottom(*rTab.FindFootnoteBossFrame()->FindBodyCont()));
// tdf#125685 ignore footnotes that are anchored in follow-table of this
// table - if split is successful they move to the next page/column anyway
assert(rTab.GetFollow() == rFollowLine.GetUpper());
@@ -803,6 +806,14 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine,
if (nDistanceToUpperPrtBottom + nFollowFootnotes < 0 || !rTab.DoesObjsFit())
bRet = false;
+ // apparently checking nFootnoteHeight here does *not* guarantee that it fits into the body
+ if (bRet && nDistanceToFootnoteBodyPrtBottom + nFollowFootnotes < 0)
+ {
+ assert(rTab.GetUpper() != rTab.FindFootnoteBossFrame()->FindBodyCont());
+ SAL_INFO("sw.layout", "SwTabFrame Split failed because of footnote growth");
+ bRet = false; // tdf#160897
+ }
+
// 2. Check if each cell in the last line has at least one content frame.
// Note: a FollowFlowRow may contains empty cells!