]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix <object_ref> processing to respect overridden attributes.
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 22 Mar 2011 19:13:28 +0000 (19:13 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 22 Mar 2011 19:13:28 +0000 (19:13 +0000)
r60494 accidentally broke this, by adding faster code path for
child-less <object_ref>s. Unfortunately, this made it ignore
<object_ref>s without children, but with attributes overrides.

Fixes #13061.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/xrc/xmlres.cpp

index 1b62dbc3dcfe6a78e7099f748c5309d2ff1ed48c..96650224bb76ed5e12d69f10aebd0ed6f26c22cb 100644 (file)
@@ -983,7 +983,10 @@ wxXmlResource::DoCreateResFromNode(wxXmlNode& node,
             return NULL;
         }
 
-        if ( !node.GetChildren() )
+        const bool hasOnlyRefAttr = node.GetAttributes() != NULL &&
+                                    node.GetAttributes()->GetNext() == NULL;
+
+        if ( hasOnlyRefAttr && !node.GetChildren() )
         {
             // In the typical, simple case, <object_ref> is used to link
             // to another node and doesn't have any content of its own that