summaryrefslogtreecommitdiff
path: root/xsd/cxx/tree/stream-insertion-source.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/cxx/tree/stream-insertion-source.cxx')
-rw-r--r--xsd/cxx/tree/stream-insertion-source.cxx26
1 files changed, 9 insertions, 17 deletions
diff --git a/xsd/cxx/tree/stream-insertion-source.cxx b/xsd/cxx/tree/stream-insertion-source.cxx
index d7e721d..ae58dcc 100644
--- a/xsd/cxx/tree/stream-insertion-source.cxx
+++ b/xsd/cxx/tree/stream-insertion-source.cxx
@@ -60,7 +60,7 @@ namespace CXX
// Register with type map.
//
- if (polymorphic && !l.context ().count ("anonymous"))
+ if (polymorphic && polymorphic_p (l) && !anonymous_p (l))
{
// Note that we are using the original type name.
//
@@ -128,7 +128,7 @@ namespace CXX
// Register with type map.
//
- if (polymorphic && !u.context ().count ("anonymous"))
+ if (polymorphic && polymorphic_p (u) && !anonymous_p (u))
{
// Note that we are using the original type name.
//
@@ -187,7 +187,7 @@ namespace CXX
// Register with type map.
//
- if (polymorphic && !e.context ().count ("anonymous"))
+ if (polymorphic && polymorphic_p (e) && !anonymous_p (e))
{
// Note that we are using the original type name.
//
@@ -228,20 +228,12 @@ namespace CXX
String type (scope + L"::" + etype (e));
// Figure out if we need to generate polymorphic code. If this
- // elemen's type is anonymous or mapped to a fundamental C++
- // type then we don't need to do anything. Note that if the type
- // is anonymous then it can't be derived from which makes it
- // impossible to substitute or dynamically-type with xsi:type.
+ // elemen's type is anonymous then we don't need to do anything.
+ // Note that if the type is anonymous then it can't be derived
+ // from which makes it impossible to substitute or dynamically-
+ // type with xsi:type.
//
- Boolean poly (polymorphic && !t.context ().count ("anonymous"));
-
- if (poly)
- {
- Boolean fund (false);
- IsFundamentalType traverser (fund);
- traverser.dispatch (t);
- poly = !fund;
- }
+ Boolean poly (polymorphic && polymorphic_p (t) && !anonymous_p (t));
if (max (e) != 1)
{
@@ -416,7 +408,7 @@ namespace CXX
// Register with type map.
//
- if (polymorphic && !c.context ().count ("anonymous"))
+ if (polymorphic && polymorphic_p (c) && !anonymous_p (c))
{
// Note that we are using the original type name.
//