diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-04-08 06:36:37 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-04-08 08:05:33 +0200 |
commit | 607fcac441c7f3a7d3c169c19039e581d707f2bb (patch) | |
tree | 2f83bde827d91ab8ea6f2232cc5cce972925c889 /sw/source | |
parent | 8557ea84c9336ba8061246f1f46ddb6e02f413a1 (diff) |
tdf#160067 sw floattable: fix missing move bwd of paras in split section frame
The last (5th) paragraph in the index was on page 2, even if page 1
still had space for it.
This is a regression from commit
397d72e582c725d162c7e0b819dc6c0bb62e42b0 (Related: tdf#158986 sw
floattable: fix unexpected page break with sections, 2024-02-23), in
case SwLayAction::FormatLayout() doesn't calc its lower content frames
then this bugdoc is good, but the old bugdoc moves its floating table to
the next page, which would be bad.
Fix the problem by making the condition for this "calc lower in
FormatLayout()" action more strict: only do this for content frames
which are in sections, followed by sections.
Note that probably a cleaner way would be to completely stop calculating
content frames in SwLayAction::FormatLayout() and only do that in
FormatContent(), but then it's not clear how to re-fix tdf#158986, and
at least this resolves the regression.
Change-Id: Id671b3b68d8af8ad1cca3399a9aa028de58df3a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165878
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/inc/sectfrm.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/layact.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx index 69158b335863..9dbf9f4df9cc 100644 --- a/sw/source/core/inc/sectfrm.hxx +++ b/sw/source/core/inc/sectfrm.hxx @@ -46,7 +46,7 @@ namespace o3tl { template<> struct typed_flags<SwSectionFrameInvFlags> : is_typed_flags<SwSectionFrameInvFlags, 0x0011> {}; } -class SwSectionFrame final: public SwLayoutFrame, public SwFlowFrame +class SAL_DLLPUBLIC_RTTI SwSectionFrame final: public SwLayoutFrame, public SwFlowFrame , public SvtListener // TODO? { SwSection* m_pSection; diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 5add4e40a8a7..a7933214f5c7 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1439,9 +1439,9 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa PopFormatLayout(); } } - else if (pLay->IsSctFrame() && pLow->IsTextFrame() && pLow == pLay->GetLastLower()) + else if (pLay->IsSctFrame() && pLay->GetNext() && pLay->GetNext()->IsSctFrame() && pLow->IsTextFrame() && pLow == pLay->GetLastLower()) { - // else: only calc the last text lower of sections + // else: only calc the last text lower of sections, followed by sections pLow->OptCalc(); } |