aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-04-14 18:25:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-04-14 18:25:02 +0200
commitc7a135cc66ab0270cebc04664dad7baa2e4c3818 (patch)
treed7ad43a9910460816b8077d45ab2d9af839edf49
parentad02b4ec2d8b0044e03ae5f39e75564118d7ce70 (diff)
Handle type customization corner cases
-rw-r--r--xsd/cxx/tree/name-processor.cxx15
-rw-r--r--xsd/cxx/tree/tree-header.cxx4
-rw-r--r--xsd/cxx/tree/tree-source.cxx4
3 files changed, 14 insertions, 9 deletions
diff --git a/xsd/cxx/tree/name-processor.cxx b/xsd/cxx/tree/name-processor.cxx
index a9427a6..a563849 100644
--- a/xsd/cxx/tree/name-processor.cxx
+++ b/xsd/cxx/tree/name-processor.cxx
@@ -1067,6 +1067,12 @@ namespace CXX
{
SemanticGraph::Context& cc (c.context ());
+ // We leave this set around to allow other mappings to use
+ // this information.
+ //
+ cc.set ("cxx-tree-name-processor-stem-set", NameSet ());
+ cc.set ("cxx-tree-name-processor-member-set", NameSet ());
+
// Use processed name.
//
String name (cc.get<String> ("name"));
@@ -1078,12 +1084,6 @@ namespace CXX
if (renamed_type (c, name) && !name)
return;
- // We leave this set around to allow other mappings to use
- // this information.
- //
- cc.set ("cxx-tree-name-processor-stem-set", NameSet ());
- cc.set ("cxx-tree-name-processor-member-set", NameSet ());
-
NameSet& stem_set (
cc.get<NameSet> ("cxx-tree-name-processor-stem-set"));
@@ -1102,7 +1102,8 @@ namespace CXX
//
SemanticGraph::Type& base (c.inherits ().base ());
- if (base.is_a<SemanticGraph::Complex> ())
+ if (base.is_a<SemanticGraph::Complex> () &&
+ !base.is_a<SemanticGraph::Enumeration> ())
{
if (!base.context ().count (
"cxx-tree-name-processor-member-set"))
diff --git a/xsd/cxx/tree/tree-header.cxx b/xsd/cxx/tree/tree-header.cxx
index 835a40f..65fdd65 100644
--- a/xsd/cxx/tree/tree-header.cxx
+++ b/xsd/cxx/tree/tree-header.cxx
@@ -2665,7 +2665,9 @@ namespace CXX
if (string_based)
{
- if (enum_base != 0)
+ // We might not have the value type if this enum is customized.
+ //
+ if (enum_base != 0 && enum_base->context ().count ("value"))
{
// c-tor (enum-value, all-non-optional-members)
//
diff --git a/xsd/cxx/tree/tree-source.cxx b/xsd/cxx/tree/tree-source.cxx
index 1fd31b2..fda9e63 100644
--- a/xsd/cxx/tree/tree-source.cxx
+++ b/xsd/cxx/tree/tree-source.cxx
@@ -2491,7 +2491,9 @@ namespace CXX
if (string_based)
{
- if (enum_base != 0)
+ // We might not have the value type if this enum is customized.
+ //
+ if (enum_base != 0 && enum_base->context ().count ("value"))
{
// c-tor (enum-value, all-non-optional-members)
//