summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/sectfrm.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-10-20 14:09:47 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-10-20 19:59:34 +0200
commitcd74225ddad06ca826a37c8ba91eedd9d2aa23ce (patch)
tree9d3851581ac550f2696af8039f4a0fd04bb64df6 /sw/source/core/layout/sectfrm.cxx
parent68d45e54b02d5800e454a2c81c2692412e5c89bd (diff)
tdf#113287 sw split sections in tables: fix missing invalidation on sect del
The problem was that the Table1:A2 cell contents was wrapped in a section that was first split, then all the contents was moved to the next page, finally the empty master was also moved to the next page. At this point the master had 0 height, and when it was removed, the follow section frame had invalid positions, including all of its contents. Position invalidation for table contents works by first invalidating the table frame position, which triggers an invalidation chain for both all next frames and the lower frame. Other lower frames are not invalidated, that happens when the first lower is calculated, in SwLayoutFrame::MakeAll(), when the SwLayNotify dtor is executed. This mechanism did not help us here, as the master section frame was already marked for deletion, so SwLayoutFrame::MakeAll() was not called for it, so neither of its next frames were re-positioned. Fix the bug by explicitly invalidating the position of the next frame in SwSectionFrame::MakeAll(), for the "return early, this section will be deleted anyway" case. (The alternative could be to watch out for 0-height sections in the SwLayNotify dtor, but the problem is specific to section frames, so SwSectionFrame is probably a more expected place for this change.) Change-Id: I5ab9475675d25bef7c0647893b1b5909da019f3f Reviewed-on: https://gerrit.libreoffice.org/43604 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source/core/layout/sectfrm.cxx')
-rw-r--r--sw/source/core/layout/sectfrm.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index f6fe2028df84..d2bf1a68815b 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -724,6 +724,15 @@ void SwSectionFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
SwRectFnSet aRectFnSet(GetUpper());
aRectFnSet.MakePos( *this, GetUpper(), GetPrev(), false );
}
+
+ if (Frame().Height() == 0)
+ {
+ // SwLayoutFrame::MakeAll() is not called for to-be-deleted
+ // section frames (which would invalidate the position of the
+ // next frame via the SwLayNotify dtor), so call it manually.
+ if (SwFrame* pNext = GetNext())
+ pNext->InvalidatePos();
+ }
}
mbValidSize = mbValidPos = mbValidPrtArea = true;
return;