]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xmlres.cpp
Mark alpha a static data (not to be freed), too
[wxWidgets.git] / src / xrc / xmlres.cpp
index efee9e17e5ac5336510610f6dec9a134564b0eea..fc16e6ec42b115c1fd5c40a33f2afd40ef38b748 100644 (file)
@@ -1193,14 +1193,20 @@ wxXmlNode *wxXmlResourceHandler::GetParamNode(const wxString& param)
     while (n)
     {
         if (n->GetType() == wxXML_ELEMENT_NODE && n->GetName() == param)
+        {
+            // TODO: check that there are no other properties/parameters with
+            //       the same name and log an error if there are (can't do this
+            //       right now as I'm not sure if it's not going to break code
+            //       using this function in unintentional way (i.e. for
+            //       accessing other things than properties), for example
+            //       wxBitmapComboBoxXmlHandler almost surely does
             return n;
+        }
         n = n->GetNext();
     }
     return NULL;
 }
 
-
-
 bool wxXmlResourceHandler::IsOfClass(wxXmlNode *node, const wxString& classname)
 {
     return node->GetAttribute(wxT("class"), wxEmptyString) == classname;
@@ -1625,6 +1631,20 @@ int wxXmlResource::DoGetXRCID(const char *str_id, int value_if_not_found)
     return XRCID_Lookup(str_id, value_if_not_found);
 }
 
+/* static */
+wxString wxXmlResource::FindXRCIDById(int numId)
+{
+    for ( int i = 0; i < XRCID_TABLE_SIZE; i++ )
+    {
+        for ( XRCID_record *rec = XRCID_Records[i]; rec; rec = rec->next )
+        {
+            if ( rec->id == numId )
+                return wxString(rec->key);
+        }
+    }
+
+    return wxString();
+}
 
 static void CleanXRCID_Record(XRCID_record *rec)
 {