[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sw/source

Michael Stahl mstahl at redhat.com
Mon Apr 27 03:10:18 PDT 2015


 sw/source/core/access/acccontext.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 84f10b5f154e130981de5826f83d63b5eadd33ac
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Apr 24 23:31:06 2015 +0200

    sw: fix SwAccessibleParagraph crash on delete
    
    It happens that SwAccessibleParagraph::getCharacterBounds() is called
    from ATK with a clearly invalid pPortionData member; the SwTxtNode has
    no text but there are portions.
    
    This is because after a deletion both a POS_CHANGED and a
    INVALID_CONTENT event are created for the same SwAccessibleParagraph,
    and they are merged into one POS_CHANGED event by
    SwAccessibleMap::AppendEvent(), but
    SwAccessibleContext::InvalidatePosOrSize() returns early if the
    paragraph happens to not be visible, skipping the invalidation.
    
    (regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba, which
     removed a Dispose() call; not sure if the Dispose() is needed here)
    
    Change-Id: I985e9a439ee6c7024963eace876186f2247b9e03
    (cherry picked from commit 104ed86c382b73505b477bf3024982dd27823023)
    Reviewed-on: https://gerrit.libreoffice.org/15534
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 8021c19..9a09055 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -1167,12 +1167,9 @@ void SwAccessibleContext::InvalidatePosOrSize( const SwRect& )
         FireVisibleDataEvent();
     }
 
-    if( !bIsNewShowingState &&
-        SwAccessibleChild( GetParent() ).IsVisibleChildrenOnly() )
-    {
-        return;
-    }
-
+    // note: InvalidatePosOrSize must call _InvalidateContent so that
+    // SwAccessibleParagraph updates its portions, or dispose it
+    // (see accmap.cxx: INVALID_CONTENT is contained in POS_CHANGED)
     _InvalidateContent( true );
 }
 


More information about the Libreoffice-commits mailing list