summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-08-28 22:05:06 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-08-31 12:41:22 +0200
commit586750da40c5b332d2442ef24ae121795e88e903 (patch)
tree6e9fb51629af1e2e1555120d4e557e336e832a46
parent943aaf6c61d9594ec229984b5d5801afe5d89024 (diff)
tdf#135001 sw_redlinehide: fix IsShown() for AT_PARA flys
There is one merged text frame from node 102 to node 328 with no extents, and of course a shape anchored at node 271 should not be visible at all. This crashes because the shape was removed from the layout during CheckParaRedlineMerge() but then moved to the visible heaven layer again via sw::AddRemoveFlysAnchoredToFrameStartingAtNode() and the layer determines if it's visible as far as Sdr* is concerned; it lacks a connection to a SwFrame though. warn:legacy.osl:3547848:3547848:sw/source/core/layout/paintfrm.cxx:3861: <SwFlyFrame::IsPaint(..)> - paint of drawing object without anchor frame!? (regression from 6aaae44da382f4bc3eafc287b4a21734b740cf21) Change-Id: Ia20449b3a7d251f0c049eb979c88df1e80cd7d5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101584 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--sw/source/core/layout/frmtool.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 1cadf5f06aec..4a721fb958cb 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1052,7 +1052,15 @@ static bool IsShown(sal_uLong const nIndex,
{
return false;
}
- if (pIter && rAnch.GetAnchorId() != RndStdIds::FLY_AT_PARA)
+ if (rAnch.GetAnchorId() == RndStdIds::FLY_AT_PARA)
+ {
+ return pIter == nullptr // not merged
+ || pIter != pEnd // at least one char visible in node
+ || !IsSelectFrameAnchoredAtPara(rAnchor,
+ SwPosition(const_cast<SwTextNode&>(*pFirstNode), 0),
+ SwPosition(const_cast<SwTextNode&>(*pLastNode), pLastNode->Len()));
+ }
+ if (pIter)
{
// note: frames are not sorted by anchor position.
assert(pEnd);