summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-08-28 22:05:06 +0200
committerAndras Timar <andras.timar@collabora.com>2020-09-09 11:57:42 +0200
commit35219dc787eee11135e81a7169d36a931c4bb271 (patch)
treef963cfcfa3de33813d6510b3fc138cdb0b57988d /sw
parent934626da440bb064211a1c7a2e229fe13e11879f (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> (cherry picked from commit 586750da40c5b332d2442ef24ae121795e88e903) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101673 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-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 7aed05b0bdce..f839d0b946b4 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);