summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbunoobj.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 0c938d6c475e..af5a3aab3da2 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -84,6 +84,7 @@
#include <sbintern.hxx>
#include <runtime.hxx>
+#include <algorithm>
#include <math.h>
#include <memory>
#include <unordered_map>
@@ -1621,6 +1622,22 @@ OUString getBasicObjectTypeName( SbxObject* pObj )
return OUString();
}
+namespace {
+
+bool matchesBasicTypeName(
+ css::uno::Reference<css::reflection::XIdlClass> const & unoType, OUString const & basicTypeName)
+{
+ if (unoType->getName().endsWithIgnoreAsciiCase(basicTypeName)) {
+ return true;
+ }
+ auto const sups = unoType->getSuperclasses();
+ return std::any_of(
+ sups.begin(), sups.end(),
+ [&basicTypeName](auto const & t) { return matchesBasicTypeName(t, basicTypeName); });
+}
+
+}
+
bool checkUnoObjectType(SbUnoObject& rUnoObj, const OUString& rClass)
{
Any aToInspectObj = rUnoObj.getUnoAny();
@@ -1697,8 +1714,7 @@ bool checkUnoObjectType(SbUnoObject& rUnoObj, const OUString& rClass)
break; // finished checking automation object
}
- // match interface name with passed class name
- if ( aInterfaceName.endsWithIgnoreAsciiCase( aClassName ) )
+ if ( matchesBasicTypeName(xClass, aClassName) )
{
bResult = true;
break;