diff options
author | Joachim Lingner <jl@openoffice.org> | 2010-06-07 10:13:44 +0200 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2010-06-07 10:13:44 +0200 |
commit | 4edc7f8eac625e30719fec69bd9b26dd9356657c (patch) | |
tree | eb75be1da94db899a53afb6ed788e017bd783b41 /basic/source/classes/sbunoobj.cxx | |
parent | 88581862df4e46ee0f6515267ffeb46a53d1ba53 (diff) | |
parent | f8e7afbac976ca862a801b9648fd95b2107757b2 (diff) |
jl152 merge with DEV300_m80
Diffstat (limited to 'basic/source/classes/sbunoobj.cxx')
-rwxr-xr-x[-rw-r--r--] | basic/source/classes/sbunoobj.cxx | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 0e8928bc6c1a..849fd839bfd1 100644..100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -139,16 +139,19 @@ bool SbUnoObject::getDefaultPropName( SbUnoObject* pUnoObj, String& sDfltProp ) SbxVariable* getDefaultProp( SbxVariable* pRef ) { SbxVariable* pDefaultProp = NULL; - SbxObject* pObj = PTR_CAST(SbxObject,(SbxVariable*) pRef); - if ( !pObj ) + if ( pRef->GetType() == SbxOBJECT ) { - SbxBase* pObjVarObj = pRef->GetObject(); - pObj = PTR_CAST(SbxObject,pObjVarObj); - } - if ( pObj && pObj->ISA(SbUnoObject) ) - { - SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*)pObj); - pDefaultProp = pUnoObj->GetDfltProperty(); + SbxObject* pObj = PTR_CAST(SbxObject,(SbxVariable*) pRef); + if ( !pObj ) + { + SbxBase* pObjVarObj = pRef->GetObject(); + pObj = PTR_CAST(SbxObject,pObjVarObj); + } + if ( pObj && pObj->ISA(SbUnoObject) ) + { + SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*)pObj); + pDefaultProp = pUnoObj->GetDfltProperty(); + } } return pDefaultProp; } @@ -564,7 +567,7 @@ SbxDataType unoToSbxType( const Reference< XIdlClass >& xIdlClass ) } return eRetType; } -void unoToSbxValue( SbxVariable* pVar, const Any& aValue ); + static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int32 >& indices, Sequence< sal_Int32 >& sizes, const Any& aValue, sal_Int32& dimension, sal_Bool bIsZeroIndex, Type* pType = NULL ) { Type aType = aValue.getValueType(); @@ -1601,6 +1604,23 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, break; } ::rtl::OUString sClassName = xClass->getName(); + if ( sClassName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.oleautomation.XAutomationObject" ) ) ) ) + { + // there is a hack in the extensions/source/ole/oleobj.cxx to return the typename of the automation object, lets check if it + // matches + Reference< XInvocation > xInv( aToInspectObj, UNO_QUERY ); + if ( xInv.is() ) + { + rtl::OUString sTypeName; + xInv->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$GetTypeName") ) ) >>= sTypeName; + if ( sTypeName.getLength() == 0 || sTypeName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IDispatch") ) ) ) + // can't check type, leave it pass + result = true; + else + result = sTypeName.equals( aClass ); + } + break; // finished checking automation object + } OSL_TRACE("Checking if object implements %s", OUStringToOString( defaultNameSpace + aClass, RTL_TEXTENCODING_UTF8 ).getStr() ); |