summaryrefslogtreecommitdiffstats
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/inc/layfrm.hxx1
-rw-r--r--sw/source/core/layout/findfrm.cxx21
-rw-r--r--sw/source/core/layout/pagechg.cxx2
3 files changed, 24 insertions, 0 deletions
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index f39c9ae513e9..589133216ea6 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -99,6 +99,7 @@ public:
SwPrintData const*const pPrintData = nullptr ) const override;
const SwFrame *Lower() const { return m_pLower; }
SwFrame *Lower() { return m_pLower; }
+ bool ContainsDeleteForbiddenLayFrame() const;
const SwContentFrame *ContainsContent() const;
inline SwContentFrame *ContainsContent();
const SwCellFrame *FirstCell() const;
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 786c7627d7c9..522dde378dcc 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -161,6 +161,27 @@ const SwFrame *SwLayoutFrame::ContainsAny( const bool _bInvestigateFootnoteForSe
return nullptr;
}
+bool SwLayoutFrame::ContainsDeleteForbiddenLayFrame() const
+{
+ if (IsDeleteForbidden())
+ {
+ return true;
+ }
+ for (SwFrame const* pFrame = Lower(); pFrame; pFrame = pFrame->GetNext())
+ {
+ if (!pFrame->IsLayoutFrame())
+ {
+ continue;
+ }
+ SwLayoutFrame const*const pLay(static_cast<SwLayoutFrame const*>(pFrame));
+ if (pLay->ContainsDeleteForbiddenLayFrame())
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
const SwFrame* SwFrame::GetLower() const
{
return IsLayoutFrame() ? static_cast<const SwLayoutFrame*>(this)->Lower() : nullptr;
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 118dc4c04212..cff4e15f4dd5 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1027,6 +1027,8 @@ bool IsPageFrameEmpty(SwPageFrame const& rPage)
rPage.FindFootnoteCont() ||
(nullptr != (pBody = rPage.FindBodyCont()) &&
( pBody->ContainsContent() ||
+ // check for section frames that are being formatted on the stack
+ rPage.ContainsDeleteForbiddenLayFrame() ||
// #i47580#
// Do not delete page if there's an empty tabframe
// left. I think it might be correct to use ContainsAny()