From 36310c060512b8bd783c1c9873f7e9b03f070295 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 14 Apr 2011 14:16:39 +0100 Subject: fix accessibility crash two different callbacks connected to the same destination where that destination unset the callback id of one of the callbacks (cherry picked from commit 0929504217c225358388c911d3f81d7626c7776c) --- sd/source/ui/accessibility/AccessibleSlideSorterView.cxx | 14 ++++++++++++-- sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx index a4e6eae35faa..44476979b782 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx @@ -94,6 +94,7 @@ public: DECL_LINK(SelectionChangeListener, void*); DECL_LINK(BroadcastSelectionChange, void*); DECL_LINK(FocusChangeListener, void*); + DECL_LINK(VisibilityChangeListener, void*); DECL_LINK(UpdateChildrenCallback, void*); private: @@ -970,7 +971,7 @@ void AccessibleSlideSorterView::Implementation::ConnectListeners (void) mrSlideSorter.GetController().GetFocusManager().AddFocusChangeListener( LINK(this,AccessibleSlideSorterView::Implementation,FocusChangeListener)); mrSlideSorter.GetView().AddVisibilityChangeListener( - LINK(this,AccessibleSlideSorterView::Implementation,UpdateChildrenCallback)); + LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener)); } @@ -983,7 +984,7 @@ void AccessibleSlideSorterView::Implementation::ReleaseListeners (void) mrSlideSorter.GetController().GetSelectionManager()->RemoveSelectionChangeListener( LINK(this,AccessibleSlideSorterView::Implementation,SelectionChangeListener)); mrSlideSorter.GetView().RemoveVisibilityChangeListener( - LINK(this,AccessibleSlideSorterView::Implementation,UpdateChildrenCallback)); + LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener)); if (mpWindow != NULL) mpWindow->RemoveEventListener( @@ -1132,6 +1133,15 @@ IMPL_LINK(AccessibleSlideSorterView::Implementation, UpdateChildrenCallback, voi +IMPL_LINK(AccessibleSlideSorterView::Implementation, VisibilityChangeListener, void*, EMPTYARG ) +{ + UpdateChildren(); + return 1; +} + + + + } // end of namespace ::accessibility /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 11c002c97d1f..7719008b3fe2 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -279,12 +279,13 @@ Reference SlideSorterViewShell::CreateSubController ::com::sun::star::accessibility::XAccessible> SlideSorterViewShell::CreateAccessibleDocumentView (::sd::Window* pWindow) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); // When the view is not set then the initialization is not yet complete // and we can not yet provide an accessibility object. if (mpView == NULL || mpSlideSorter.get() == NULL) return NULL; + OSL_ASSERT(mpSlideSorter.get()!=NULL); + ::accessibility::AccessibleSlideSorterView *pAccessibleView = new ::accessibility::AccessibleSlideSorterView( *mpSlideSorter.get(), -- cgit