Blame SOURCES/0004-sw-fix-SwAccessibleParagraph-crash-on-delete.patch

ebc4bd
From db92a0c238d82a32fd915f05fc7efb6167e4ea91 Mon Sep 17 00:00:00 2001
ebc4bd
From: Michael Stahl <mstahl@redhat.com>
ebc4bd
Date: Fri, 24 Apr 2015 23:31:06 +0200
ebc4bd
Subject: [PATCH 4/4] sw: fix SwAccessibleParagraph crash on delete
ebc4bd
ebc4bd
It happens that SwAccessibleParagraph::getCharacterBounds() is called
ebc4bd
from ATK with a clearly invalid pPortionData member; the SwTxtNode has
ebc4bd
no text but there are portions.
ebc4bd
ebc4bd
This is because after a deletion both a POS_CHANGED and a
ebc4bd
INVALID_CONTENT event are created for the same SwAccessibleParagraph,
ebc4bd
and they are merged into one POS_CHANGED event by
ebc4bd
SwAccessibleMap::AppendEvent(), but
ebc4bd
SwAccessibleContext::InvalidatePosOrSize() returns early if the
ebc4bd
paragraph happens to not be visible, skipping the invalidation.
ebc4bd
ebc4bd
(regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba, which
ebc4bd
 removed a Dispose() call; not sure if the Dispose() is needed here)
ebc4bd
ebc4bd
Change-Id: I985e9a439ee6c7024963eace876186f2247b9e03
ebc4bd
(cherry picked from commit 104ed86c382b73505b477bf3024982dd27823023)
ebc4bd
Reviewed-on: https://gerrit.libreoffice.org/15534
ebc4bd
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
ebc4bd
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
ebc4bd
(cherry picked from commit 84f10b5f154e130981de5826f83d63b5eadd33ac)
ebc4bd
---
ebc4bd
 sw/source/core/access/acccontext.cxx | 9 +++------
ebc4bd
 1 file changed, 3 insertions(+), 6 deletions(-)
ebc4bd
ebc4bd
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
ebc4bd
index 1e84758..7152006 100644
ebc4bd
--- a/sw/source/core/access/acccontext.cxx
ebc4bd
+++ b/sw/source/core/access/acccontext.cxx
ebc4bd
@@ -1166,12 +1166,9 @@ void SwAccessibleContext::InvalidatePosOrSize( const SwRect& )
ebc4bd
         FireVisibleDataEvent();
ebc4bd
     }
ebc4bd
 
ebc4bd
-    if( !bIsNewShowingState &&
ebc4bd
-        SwAccessibleChild( GetParent() ).IsVisibleChildrenOnly() )
ebc4bd
-    {
ebc4bd
-        return;
ebc4bd
-    }
ebc4bd
-
ebc4bd
+    // note: InvalidatePosOrSize must call _InvalidateContent so that
ebc4bd
+    // SwAccessibleParagraph updates its portions, or dispose it
ebc4bd
+    // (see accmap.cxx: INVALID_CONTENT is contained in POS_CHANGED)
ebc4bd
     _InvalidateContent( true );
ebc4bd
 }
ebc4bd
 
ebc4bd
-- 
ebc4bd
2.1.0
ebc4bd