summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-08-23 15:52:51 +0200
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-09-26 13:38:39 +0200
commit7272d2c152424255437f8fbda5ed31737404d52c (patch)
treef7488e33b1326498d3140c2b16835075f70099f1
parenttdf#156724 sw: layout: fix tables not splitting due to footnotes differently (diff)
downloadcore-7272d2c152424255437f8fbda5ed31737404d52c.tar.gz
core-7272d2c152424255437f8fbda5ed31737404d52c.zip
tdf#128437 tdf#128966 sw: layout: partially revert fix of tdf#124675
The tdf#128437 bugdoc works since LO 4.1 commit 84203fab20b7eb98f0d3667e6626f5c2139e5a7f "Resolves: #i120016# refine condition for allowing split of a table row". The non-obvious way in which commit cc5916cd314a27b0cc99560ab887480026630a95 changes the layout is the FlowFrameJoinLockGuard on the table frame. While layouting page1, with LockJoin, formatting the content in the rows of the table leaves the table follow valid. Whereas without LockJoin, formatting the content in the rows grows the table frame and this invalidates the position of the follow table frame. 0 SwFrameAreaDefinition::setFrameAreaPositionValid(bool) (this=0x7c85390, bNew=false) at sw/source/core/layout/wsfrm.cxx:90 1 SwFrame::ImplInvalidatePos() (this=0x7c85390) at sw/source/core/layout/wsfrm.cxx:2001 2 SwFrame::InvalidatePos() (this=0x7c85390) at sw/source/core/inc/frame.hxx:1053 3 SwFrame::ImplInvalidateNextPos(bool) (this=0x6edefb0, bNoFootnote=false) at sw/source/core/layout/findfrm.cxx:1368 4 SwFrame::InvalidateNextPos(bool) (this=0x6edefb0, bNoFootnote=false) at sw/source/core/inc/frame.hxx:1083 5 SwTabFrame::GrowFrame(long, bool, bool) (this=0x6edefb0, nDist=10, bTst=false, bInfo=false) sw/source/core/layout/tabfrm.cxx:3428 6 SwFrame::Grow(long, bool, bool) (this=0x6edefb0, nDist=10, bTst=false, bInfo=false) at sw/source/core/layout/wsfrm.cxx:1547 7 SwTabFrame::Format(OutputDevice*, SwBorderAttrs const*) (this=0x6edefb0, pAttrs=0x6f74d00) at sw/source/core/layout/tabfrm.cxx:3357 8 SwTabFrame::MakeAll(OutputDevice*) (this=0x6edefb0) at sw/source/core/layout/tabfrm.cxx:2157 9 SwFrame::PrepareMake(OutputDevice*) (this=0x6edefb0) at sw/source/core/layout/calcmove.cxx:375 10 SwFrame::Calc(OutputDevice*) const (this=0x6edefb0) at sw/source/core/layout/trvlfrm.cxx:1803 11 SwFrame::PrepareMake(OutputDevice*) (this=0x6f118a0) at sw/source/core/layout/calcmove.cxx:253 12 SwFrame::Calc(OutputDevice*) const (this=0x6f118a0) at sw/source/core/layout/trvlfrm.cxx:1803 13 SwFrame::PrepareMake(OutputDevice*) (this=0x6f11a30) at sw/source/core/layout/calcmove.cxx:253 14 SwFrame::Calc(OutputDevice*) const (this=0x6f11a30) at sw/source/core/layout/trvlfrm.cxx:1803 15 SwFrame::OptPrepareMake() (this=0x6f14da0) at sw/source/core/layout/calcmove.cxx:386 16 SwFrame::OptCalc() const (this=0x6f14da0) at sw/source/core/inc/frame.hxx:1090 17 SwLayAction::FormatLayout(OutputDevice*, SwLayoutFrame*, bool) (this=0x7ffdabdf0c90, pLay=0x6f11a30, bAddRect=false) sw/source/core/layout/layact.cxx:1461 18 SwLayAction::FormatLayout(OutputDevice*, SwLayoutFrame*, bool) (this=0x7ffdabdf0c90, pLay=0x6f118a0, bAddRect=false) sw/source/core/layout/layact.cxx:1455 19 SwLayAction::FormatLayoutTab(SwTabFrame*, bool) (this=0x7ffdabdf0c90, pTab=0x6edefb0, bAddRect=false) at sw/source/core/layout/layact.cxx:1679 Thus invalidated, the follow frame's first row will move back and split. Unable to reproduce tdf#124675 with the FlowFrameLockGuard reverted - let's assume that some change elsewhere prevents this kind of crash now. The only problem with this is that some test fails (and i forgot which one), that's why the 3 previous commits are needed. What's amusing is that the layout with this fix is the same as the one in Word 2013, whereas the layout without this fix is the same as the one from exporting the bugdoc from Word 2013 in DOCX without compatibility mode, so this will be a "regression" for DOCX layout but it was all an accident anyway... This also fixes the last case of tdf#128966 so every row is vertically centered now; some previous commit improved it already. Change-Id: I46d77930666a1762ae16af09525f0b23660beba1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155989 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit bfa81a200ab59971b69823f9a29d8ce222d655e6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156966 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--sw/source/core/layout/layact.cxx6
1 files changed, 1 insertions, 5 deletions
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index ae8295b43903..84481981fd6e 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1640,11 +1640,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool bAddRect )
// format lowers, only if table frame is valid
if ( pTab->isFrameAreaDefinitionValid() )
{
- ::std::optional<FlowFrameJoinLockGuard> oTabGuard;
- if (pTab->IsMoveable()) // tdf#137523 not in footer
- { // tdf#124675 prevent Join() if pTab becomes empty
- oTabGuard.emplace(pTab);
- }
+ // tdf#128437 FlowFrameJoinLockGuard on pTab caused a problem here
SwLayoutFrame *pLow = static_cast<SwLayoutFrame*>(pTab->Lower());
while ( pLow )
{