mib19: #163573# Fix NativeObjectWrapper implementation + VbaDocumentBase::getFullName()

This commit is contained in:
Andreas Bregas
2010-09-09 15:53:39 +02:00
parent d3ad5e48ca
commit a52cf2d300
2 changed files with 29 additions and 26 deletions

View File

@@ -739,7 +739,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
if( eTypeClass == TypeClass_STRUCT )
{
ArrayWrapper aWrap;
//NativeObjectWrapper aNativeObjectWrapper;
NativeObjectWrapper aNativeObjectWrapper;
if ( (aValue >>= aWrap) )
{
SbxDimArray* pArray = NULL;
@@ -759,15 +759,18 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
pVar->PutEmpty();
break;
}
//else if ( (aValue >>= aNativeObjectWrapper) )
//{
// sal_uInt32 nIndex;
// if( (aNativeObjectWrapper.ObjectId >>= nIndex) )
// {
// SbxObject* pObj = lcl_getNativeObject( nIndex );
// pVar->PutObject( pObj );
// }
//}
else if ( (aValue >>= aNativeObjectWrapper) )
{
sal_uInt32 nIndex;
if( (aNativeObjectWrapper.ObjectId >>= nIndex) )
{
SbxObject* pObj = lcl_getNativeObject( nIndex );
pVar->PutObject( pObj );
}
else
pVar->PutEmpty();
break;
}
else
{
SbiInstance* pInst = pINST;
@@ -1144,20 +1147,20 @@ Any sbxToUnoValueImpl( SbxVariable* pVar, bool bBlockConversionToSmallestType =
if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) )
return aRetAny;
}
//if( !xObj->ISA(SbUnoObject) )
//{
// // Create NativeObjectWrapper to identify object in case of callbacks
// SbxObject* pObj = PTR_CAST(SbxObject,pVar->GetObject());
// if( pObj != NULL )
// {
// NativeObjectWrapper aNativeObjectWrapper;
// sal_uInt32 nIndex = lcl_registerNativeObjectWrapper( pObj );
// aNativeObjectWrapper.ObjectId <<= nIndex;
// Any aRetAny;
// aRetAny <<= aNativeObjectWrapper;
// return aRetAny;
// }
//}
if( !xObj->ISA(SbUnoObject) )
{
// Create NativeObjectWrapper to identify object in case of callbacks
SbxObject* pObj = PTR_CAST(SbxObject,pVar->GetObject());
if( pObj != NULL )
{
NativeObjectWrapper aNativeObjectWrapper;
sal_uInt32 nIndex = lcl_registerNativeObjectWrapper( pObj );
aNativeObjectWrapper.ObjectId <<= nIndex;
Any aRetAny;
aRetAny <<= aNativeObjectWrapper;
return aRetAny;
}
}
}
}

View File

@@ -97,8 +97,8 @@ VbaDocumentBase::getPath() throw (uno::RuntimeException)
::rtl::OUString
VbaDocumentBase::getFullName() throw (uno::RuntimeException)
{
rtl::OUString sPath;
::osl::File::getSystemPathFromFileURL( getModel()->getURL(), sPath );
rtl::OUString sPath = getName();
//::osl::File::getSystemPathFromFileURL( getModel()->getURL(), sPath );
return sPath;
}