cargilld 2004/10/19 04:09:11
Modified: c/src/xercesc/framework/psvi XSComplexTypeDefinition.cpp
XSSimpleTypeDefinition.cpp
Log:
More fixes to derviedFromType.
Revision Changes Path
1.15 +12 -1
xml-xerces/c/src/xercesc/framework/psvi/XSComplexTypeDefinition.cpp
Index: XSComplexTypeDefinition.cpp
===================================================================
RCS file:
/home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSComplexTypeDefinition.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- XSComplexTypeDefinition.cpp 15 Oct 2004 11:15:44 -0000 1.14
+++ XSComplexTypeDefinition.cpp 19 Oct 2004 11:09:11 -0000 1.15
@@ -16,6 +16,9 @@
/*
* $Log$
+ * Revision 1.15 2004/10/19 11:09:11 cargilld
+ * More fixes to derviedFromType.
+ *
* Revision 1.14 2004/10/15 11:15:44 cargilld
* Fix for jira bug 1234. Infinite loop in
XSComplexTypeDefinition::derviedFromType.
*
@@ -227,7 +230,15 @@
if (!ancestorType)
return false;
- XSTypeDefinition* type = this;
+ XSTypeDefinition* type = (XSTypeDefinition*) ancestorType;
+
+ if (ancestorType == type->getBaseType())
+ {
+ // ancestor is anytype
+ return true;
+ }
+
+ type = this;
XSTypeDefinition* lastType = 0; // anytype has a basetype of anytype so will
have infinite loop...
while (type && (type != ancestorType) && (type != lastType))
1.11 +14 -1
xml-xerces/c/src/xercesc/framework/psvi/XSSimpleTypeDefinition.cpp
Index: XSSimpleTypeDefinition.cpp
===================================================================
RCS file:
/home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSSimpleTypeDefinition.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- XSSimpleTypeDefinition.cpp 15 Oct 2004 21:32:54 -0000 1.10
+++ XSSimpleTypeDefinition.cpp 19 Oct 2004 11:09:11 -0000 1.11
@@ -16,6 +16,9 @@
/*
* $Log$
+ * Revision 1.11 2004/10/19 11:09:11 cargilld
+ * More fixes to derviedFromType.
+ *
* Revision 1.10 2004/10/15 21:32:54 cargilld
* Fix similar problem to that in jira bug 1234. Infinite loop in
XSSimpleTypeDefinition::derviedFromType.
*
@@ -231,10 +234,20 @@
if (!ancestorType)
return false;
+ XSTypeDefinition* type;
+
if (ancestorType->getTypeCategory() == XSTypeDefinition::COMPLEX_TYPE)
+ {
+ type = (XSTypeDefinition*) ancestorType;
+ if (ancestorType == type->getBaseType())
+ {
+ // ancestor is anytype
+ return true;
+ }
return false;
+ }
- XSTypeDefinition* type = this;
+ type = this;
XSTypeDefinition* lastType = 0; // anysimple type has a base type of anytype
// anytype has a basetype of anytype so will
have infinite loop...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]