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.
This commit is contained in:
Michael Stahl 2012-02-27 20:43:29 +01:00
parent 7c7d5c0eec
commit 3f43ebb4c3

View file

@ -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;