aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-06-20 13:45:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-06-20 13:45:42 +0200
commit1e5aa9305f310fa7426a320f4f06a7701cabfcdb (patch)
tree2f2d3ab2f840af22bb6c2905ce8a7a5d5510fdf6
parent35858d66547a41dbd1af8b50d158b52e372cd757 (diff)
Handle corner case in mixed content inheritance
-rw-r--r--xsd-frontend/semantic-graph/complex.hxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/xsd-frontend/semantic-graph/complex.hxx b/xsd-frontend/semantic-graph/complex.hxx
index e1f08f9..ac47810 100644
--- a/xsd-frontend/semantic-graph/complex.hxx
+++ b/xsd-frontend/semantic-graph/complex.hxx
@@ -18,12 +18,24 @@ namespace XSDFrontend
bool
mixed_p () const
{
- return mixed_;
+ if (mixed_)
+ return true;
+
+ // If we have empty content, then we have the same content
+ // type as our base.
+ //
+ if (!contains_compositor_p () && inherits_p ())
+ {
+ if (Complex* b = dynamic_cast<Complex*> (&inherits ().base ()))
+ return b->mixed_p ();
+ }
+
+ return false;
}
public:
bool
- contains_compositor_p ()
+ contains_compositor_p () const
{
return contains_compositor_ != 0;
}