sw/source/core/layout/frmtool.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 139ce6588a2980e52df9a106a254c16e6f27ea8d
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Fri Aug 28 22:05:06 2020 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Aug 31 15:41:46 2020 +0200

    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.st...@cib.de>
    (cherry picked from commit 586750da40c5b332d2442ef24ae121795e88e903)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101672
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 22217f5c0655..f5b2cc813e4a 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);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to