sw/source/core/access/accdoc.cxx |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 7efdb77f53a5b499bc58f20ce9b146d7e47cda92
Author: Michael Stahl <mst...@redhat.com>
Date:   Fri Dec 13 22:10:17 2013 +0100

    sw: SwAccessibleDocument: fix crashes
    
    Add missing SolarMutexGuards and also GetMap() may be 0 if it's
    disposed. (regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba)
    
    Change-Id: I65312098e3d4cc6f686c3fc9e05dc8a6c4da34ce

diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 1d49da2..04eaaaf 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -206,8 +206,10 @@ OUString SAL_CALL 
SwAccessibleDocumentBase::getAccessibleDescription (void)
 OUString SAL_CALL SwAccessibleDocumentBase::getAccessibleName (void)
         throw (::com::sun::star::uno::RuntimeException)
 {
+    SolarMutexGuard g;
+
     OUString sAccName = GetResource( STR_ACCESS_DOC_WORDPROCESSING );
-    SwDoc *pDoc = GetShell()->GetDoc();
+    SwDoc *pDoc = GetMap() ? GetShell()->GetDoc() : 0;
     if ( pDoc )
     {
         OUString sFileName = pDoc->getDocAccTitle();
@@ -571,6 +573,8 @@ void SwAccessibleDocument::deselectAccessibleChild(
 void SAL_CALL SwAccessibleDocument::notifyEvent( const 
::com::sun::star::document::EventObject& Event )
             throw (::com::sun::star::uno::RuntimeException)
 {
+    SolarMutexGuard g;
+
     if ( Event.EventName.equalsAscii( "FirstPageShows" ) )
     {
         FireStateChangedEvent( AccessibleStateType::FOCUSED,sal_True );
@@ -602,8 +606,10 @@ void SAL_CALL SwAccessibleDocument::disposing( const 
::com::sun::star::lang::Eve
 uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes()
         throw (::com::sun::star::lang::IndexOutOfBoundsException, 
::com::sun::star::uno::RuntimeException)
 {
+    SolarMutexGuard g;
+
     uno::Any anyAtrribute;
-    SwDoc *pDoc = GetShell()->GetDoc();
+    SwDoc *pDoc = GetMap() ? GetShell()->GetDoc() : 0;
 
     if (!pDoc)
         return anyAtrribute;
@@ -851,6 +857,8 @@ sal_Int32 SAL_CALL SwAccessibleDocument::getBackground()
         SAL_CALL SwAccessibleDocument::get_AccFlowTo(const 
::com::sun::star::uno::Any& rAny, sal_Int32 nType)
         throw ( ::com::sun::star::uno::RuntimeException )
 {
+    SolarMutexGuard g;
+
     const sal_Int32 FORSPELLCHECKFLOWTO = 1;
     const sal_Int32 FORFINDREPLACEFLOWTO = 2;
     SwAccessibleMap* pAccMap = GetMap();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to