From 1e5aa9305f310fa7426a320f4f06a7701cabfcdb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Jun 2014 13:45:42 +0200 Subject: Handle corner case in mixed content inheritance --- xsd-frontend/semantic-graph/complex.hxx | 16 ++++++++++++++-- 1 file 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 (&inherits ().base ())) + return b->mixed_p (); + } + + return false; } public: bool - contains_compositor_p () + contains_compositor_p () const { return contains_compositor_ != 0; } -- cgit v1.1