summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAndreas Bregas <ab@openoffice.org>2010-08-09 15:50:34 +0200
committerAndreas Bregas <ab@openoffice.org>2010-08-09 15:50:34 +0200
commit8d3a12bd55459ba99e802457a4112f290cd28ac1 (patch)
treea8050728c0f62d2f067267e0910606149fea2639 /basic
parente50f8b059ea9f4e96e64a931caeb909cf4628bff (diff)
mib18: #163059# Ignore introspection based COM object members
Diffstat (limited to 'basic')
-rwxr-xr-xbasic/source/classes/sbunoobj.cxx14
-rw-r--r--basic/source/inc/sbunoobj.hxx1
2 files changed, 13 insertions, 2 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 1a9e046aa1..4a091bfba2 100755
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -71,6 +71,7 @@
#include <com/sun/star/bridge/oleautomation/Date.hpp>
#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
#include <com/sun/star/bridge/oleautomation/Currency.hpp>
+#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
using com::sun::star::uno::Reference;
@@ -2265,6 +2266,7 @@ Reference< XInvocation > createDynamicInvocationFor( const Any& aAny );
SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ )
: SbxObject( aName_ )
, bNeedIntrospection( TRUE )
+ , bIgnoreNativeCOMObjectMembers( FALSE )
{
static Reference< XIntrospection > xIntrospection;
@@ -2310,6 +2312,12 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ )
bNeedIntrospection = FALSE;
return;
}
+
+ // Ignore introspection based members for COM objects to avoid
+ // hiding of equally named COM symbols, e.g. XInvocation::getValue
+ Reference< oleautomation::XAutomationObject > xAutomationObject( aUnoObj_, UNO_QUERY );
+ if( xAutomationObject.is() )
+ bIgnoreNativeCOMObjectMembers = TRUE;
}
maTmpUnoObj = aUnoObj_;
@@ -2553,7 +2561,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t )
if( !pRes )
{
::rtl::OUString aUName( rName );
- if( mxUnoAccess.is() )
+ if( mxUnoAccess.is() && !bIgnoreNativeCOMObjectMembers )
{
if( mxExactName.is() )
{
@@ -2713,10 +2721,12 @@ void SbUnoObject::implCreateAll( void )
// Instrospection besorgen
Reference< XIntrospectionAccess > xAccess = mxUnoAccess;
- if( !xAccess.is() )
+ if( !xAccess.is() || bIgnoreNativeCOMObjectMembers )
{
if( mxInvocation.is() )
xAccess = mxInvocation->getIntrospection();
+ else if( bIgnoreNativeCOMObjectMembers )
+ return;
}
if( !xAccess.is() )
return;
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index b8993c1e71..f2277e99d0 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -52,6 +52,7 @@ class SbUnoObject: public SbxObject
::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactName;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactNameInvocation;
BOOL bNeedIntrospection;
+ BOOL bIgnoreNativeCOMObjectMembers;
::com::sun::star::uno::Any maTmpUnoObj; // Only to save obj for doIntrospection!
// Hilfs-Methode zum Anlegen der dbg_-Properties