summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-02-21 08:05:33 +0100
committerMiklos Vajna <vmiklos@collabora.com>2023-02-21 08:01:19 +0000
commitb697ee5dc3c38806fc6f096364590e9e60256aeb (patch)
tree7ed3a17f96ff50d4c10d4dfae1f00a9a9a0f8a5a /sw
parent3ae7bd3345e2f356b52ba7b8160dbcbdc4967e89 (diff)
sw floattable: fix locking in SwTextFrame::Prepare()
Once a floating table is split across 2 pages, we currently emit this warning: warn:legacy.osl:23427:23427:sw/source/core/text/txtfrm.cxx:2808: SwTextFrame::Prepare: three of a perfect pair Which suggests that we want to invalidate the size of a frame that is already locked. The way normal frame split doesn't hit this warning is that the master has some content, then once SwContentFrame::Paste() on the follow calls SwTextFrame::Prepare() on the master, the !HasPara() condition is not hit, so it's not a problem that the frame is locked. Fix this for the split fly case by assuming that in case our offset and our follow's offset is both 0, then this frame will have some fly content, so don't return early (similar to what happens when the frame has some text content). We may want to revisit this later so that at least an SwParaPortion is generated for non-last anchors for split flys, but this is good enough for now, since the point is to not invalidate the size of a locked frame. Change-Id: I7c78472653bb6818f0d5880d21f468286be547e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147378 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/txtfrm.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 5906c9c9d1f3..7ac2a5183114 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2823,7 +2823,12 @@ bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid,
}
}
- if( !HasPara() && PrepareHint::MustFit != ePrep )
+ // Split fly anchors are technically empty (have no SwParaPortion), but otherwise behave like
+ // other split text frames, which are non-empty.
+ bool bSplitFlyAnchor = GetOffset() == TextFrameIndex(0) && HasFollow()
+ && GetFollow()->GetOffset() == TextFrameIndex(0);
+
+ if( !HasPara() && !bSplitFlyAnchor && PrepareHint::MustFit != ePrep )
{
SetInvalidVert( true ); // Test
OSL_ENSURE( !IsLocked(), "SwTextFrame::Prepare: three of a perfect pair" );