diff options
Diffstat (limited to 'basic/source/classes/sbunoobj.cxx')
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index e5ec362a66a9..d773965b5c38 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -2100,18 +2100,27 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { try { - if ( pProp->isUnoStruct() && maStructInfo.get() ) + if ( maStructInfo.get() ) { - StructRefInfo aMemberStruct = maStructInfo->getStructMember( pProp->GetName() ); - if ( aMemberStruct.isEmpty() ) + StructRefInfo aMember = maStructInfo->getStructMember( pProp->GetName() ); + if ( aMember.isEmpty() ) { StarBASIC::Error( SbERR_PROPERTY_NOT_FOUND ); } else { - SbUnoStructRefObject* pSbUnoObject = new SbUnoStructRefObject( pProp->GetName(), aMemberStruct ); - SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject; - pVar->PutObject( xWrapper ); + if ( pProp->isUnoStruct() ) + { + SbUnoStructRefObject* pSbUnoObject = new SbUnoStructRefObject( pProp->GetName(), aMember ); + SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject; + pVar->PutObject( xWrapper ); + } + else + { + Any aRetAny = aMember.getValue(); + // take over the value from Uno to Sbx + unoToSbxValue( pVar, aRetAny ); + } return; } } @@ -2168,7 +2177,20 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, StarBASIC::Error( SbERR_PROP_READONLY ); return; } - + if ( maStructInfo.get() ) + { + StructRefInfo aMember = maStructInfo->getStructMember( pProp->GetName() ); + if ( aMember.isEmpty() ) + { + StarBASIC::Error( SbERR_PROPERTY_NOT_FOUND ); + } + else + { + Any aAnyValue = sbxToUnoValue( pVar, pProp->aUnoProp.Type, &pProp->aUnoProp ); + aMember.setValue( aAnyValue ); + } + return; + } // take over the value from Uno to Sbx Any aAnyValue = sbxToUnoValue( pVar, pProp->aUnoProp.Type, &pProp->aUnoProp ); try @@ -2875,7 +2897,9 @@ Any SbUnoObject::getUnoAny( void ) { Any aRetAny; if( bNeedIntrospection ) doIntrospection(); - if( mxMaterialHolder.is() ) + if ( maStructInfo.get() ) + aRetAny = maTmpUnoObj; + else if( mxMaterialHolder.is() ) aRetAny = mxMaterialHolder->getMaterial(); else if( mxInvocation.is() ) aRetAny <<= mxInvocation; |