Browse Source

Stopped at an ignored base when getting the root one.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/463/head
Dimitar Dobrev 10 years ago
parent
commit
597922c1db
  1. 4
      src/AST/ClassExtensions.cs
  2. 2
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  3. 4
      tests/CSharpTemp/CSharpTemp.h

4
src/AST/ClassExtensions.cs

@ -43,11 +43,11 @@ namespace CppSharp.AST @@ -43,11 +43,11 @@ namespace CppSharp.AST
}
}
public static Class GetRootBase(this Class @class)
public static Class GetNonIgnoredRootBase(this Class @class)
{
while (true)
{
if (@class.BaseClass == null)
if (!@class.HasNonIgnoredBase || @class.BaseClass == null)
return @class;
@class = @class.BaseClass;

2
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -1784,7 +1784,7 @@ namespace CppSharp.Generators.CSharp @@ -1784,7 +1784,7 @@ namespace CppSharp.Generators.CSharp
if (@class.IsRefType)
{
var @base = @class.GetRootBase();
var @base = @class.GetNonIgnoredRootBase();
var className = @base.IsAbstractImpl ? @base.BaseClass.Name : @base.Name;
// Use interfaces if any - derived types with a this class as a seconary base, must be compatible with the map

4
tests/CSharpTemp/CSharpTemp.h

@ -230,6 +230,10 @@ private: @@ -230,6 +230,10 @@ private:
const char* _name;
};
class TestObjectMapWithClassDerivedFromStruct : public QGenericArgument
{
};
#define DEFAULT_INT (2 * 1000UL + 500UL)
namespace Qt

Loading…
Cancel
Save