summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-02-27 20:43:29 +0100
committerMichael Stahl <mstahl@redhat.com>2012-02-27 20:45:06 +0100
commit3f43ebb4c3daf3e5c20a30a84f97bb4c93bff8a6 (patch)
tree7473d69fdaa90ad6f40e94e3477ea50680c7933c
parent7c7d5c0eec4efb95d18b735fb9df4754ba9d8b1f (diff)
fdo#46678: tweak SfxBaseModel::getSomething:
Lock the SolarMutex only when necessary. This is a workaround that just happens to make the deadlock go away for me. This being called from pyuno is wasteful anyway, but apparently there is no way to determine whether a uno::Reference points at something local to the process.
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 4fb211f21ff3..1ff0f27b52bc 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3106,14 +3106,20 @@ void SAL_CALL SfxBaseModel::removePrintJobListener( const uno::Reference< view::
class SvObject;
sal_Int64 SAL_CALL SfxBaseModel::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- if ( GetObjectShell() )
+ SvGlobalName aName( aIdentifier );
+ if ((aName == SvGlobalName( SO3_GLOBAL_CLASSID )) ||
+ (aName == SvGlobalName( SFX_GLOBAL_CLASSID )))
{
- SvGlobalName aName( aIdentifier );
- if ( aName == SvGlobalName( SO3_GLOBAL_CLASSID ) )
- return (sal_Int64)(sal_IntPtr)(SvObject*)GetObjectShell();
- else if ( aName == SvGlobalName( SFX_GLOBAL_CLASSID ) )
- return (sal_Int64)(sal_IntPtr)(SfxObjectShell*)GetObjectShell();
+ SolarMutexGuard aGuard;
+ SfxObjectShell *const pObjectShell(GetObjectShell());
+ if (pObjectShell)
+ {
+ // SO3_GLOBAL_CLASSID is apparently used by binfilter :(
+ if ( aName == SvGlobalName( SO3_GLOBAL_CLASSID ) )
+ return (sal_Int64)(sal_IntPtr)(SvObject*) pObjectShell;
+ else if ( aName == SvGlobalName( SFX_GLOBAL_CLASSID ) )
+ return (sal_Int64)(sal_IntPtr)(SfxObjectShell*) pObjectShell;
+ }
}
return 0;