summaryrefslogtreecommitdiff
path: root/sw/source/core/access/accdoc.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-12-13 22:10:17 +0100
committerMichael Stahl <mstahl@redhat.com>2013-12-13 22:44:44 +0100
commit7efdb77f53a5b499bc58f20ce9b146d7e47cda92 (patch)
tree09ee5c96e381009c11918f69475eb6276cd1901f /sw/source/core/access/accdoc.cxx
parent148e7763f3b3b5eb881026228f8c40b1e179d79d (diff)
sw: SwAccessibleDocument: fix crashes
Add missing SolarMutexGuards and also GetMap() may be 0 if it's disposed. (regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba) Change-Id: I65312098e3d4cc6f686c3fc9e05dc8a6c4da34ce
Diffstat (limited to 'sw/source/core/access/accdoc.cxx')
-rw-r--r--sw/source/core/access/accdoc.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 1d49da212c7b..04eaaafaabda 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();