diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-06-03 15:46:10 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-09 19:10:17 -0300 |
commit | b78dcfc72e3dcfdcbb2ba80790bc2d243c1b0888 (patch) | |
tree | 5741e920835c65248aec2d5f23b1891e88e4f1f5 | |
parent | e3de600d1823595b6b9d43f0214acdb36bb60152 (diff) |
Fix bug 464 - "Can't create target lang package and namespace with the same name"
-rw-r--r-- | typedatabase.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/typedatabase.cpp b/typedatabase.cpp index 4e0ab5b80..5ba658bd7 100644 --- a/typedatabase.cpp +++ b/typedatabase.cpp @@ -371,29 +371,32 @@ PrimitiveTypeEntry *TypeDatabase::findPrimitiveType(const QString& name) const ComplexTypeEntry* TypeDatabase::findComplexType(const QString& name) const { - TypeEntry* entry = findType(name); - if (entry && entry->isComplex()) - return static_cast<ComplexTypeEntry*>(entry); - else - return 0; + QList<TypeEntry*> entries = findTypes(name); + foreach (TypeEntry* entry, entries) { + if (entry && entry->isComplex()) + return static_cast<ComplexTypeEntry*>(entry); + } + return 0; } ObjectTypeEntry* TypeDatabase::findObjectType(const QString& name) const { - TypeEntry* entry = findType(name); - if (entry && entry->isObject()) - return static_cast<ObjectTypeEntry*>(entry); - else - return 0; + QList<TypeEntry*> entries = findTypes(name); + foreach (TypeEntry* entry, entries) { + if (entry && entry->isObject()) + return static_cast<ObjectTypeEntry*>(entry); + } + return 0; } NamespaceTypeEntry* TypeDatabase::findNamespaceType(const QString& name) const { - TypeEntry* entry = findType(name); - if (entry && entry->isNamespace()) - return static_cast<NamespaceTypeEntry*>(entry); - else - return 0; + QList<TypeEntry*> entries = findTypes(name); + foreach (TypeEntry* entry, entries) { + if (entry && entry->isNamespace()) + return static_cast<NamespaceTypeEntry*>(entry); + } + return 0; } bool TypeDatabase::supportedApiVersion(double version) const |