]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xmlres.cpp
Start() should resume the stopwatch if it is suspended
[wxWidgets.git] / src / xrc / xmlres.cpp
index b711c954407593abde26e41e868d0f03929bbe6a..e47ea3e254f621eae657ffe8fadd6414db64fd41 100644 (file)
@@ -1109,7 +1109,7 @@ void wxXmlResourceHandler::CreateChildren(wxObject *parent, bool this_hnd_only)
     while (n)
     {
         if (n->GetType() == wxXML_ELEMENT_NODE &&
-            n->GetName() == wxT("object"))
+           (n->GetName() == wxT("object") || n->GetName() == wxT("object_ref")))
         {
             if (this_hnd_only && CanHandle(n))
                 CreateResource(n, parent, NULL);
@@ -1181,10 +1181,21 @@ static XRCID_record *XRCID_Records[XRCID_TABLE_SIZE] = {NULL};
     XRCID_record **rec_var = (oldrec == NULL) ?
                               &XRCID_Records[index] : &oldrec->next;
     *rec_var = new XRCID_record;
-    (*rec_var)->id = ++XRCID_LastID;
     (*rec_var)->key = wxStrdup(str_id);
     (*rec_var)->next = NULL;
 
+    wxChar *end;
+    int asint = wxStrtol(str_id, &end, 10);
+    if (*str_id && *end == 0)
+    {
+        // if str_id was integer, keep it verbosely:
+        (*rec_var)->id = asint;
+    }
+    else
+    {
+        (*rec_var)->id = ++XRCID_LastID;
+    }
+
     return (*rec_var)->id;
 }