]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_chckl.cpp
Prevents crashes caused by negative line count being passed to wrapping functions...
[wxWidgets.git] / src / xrc / xh_chckl.cpp
index a92e391c92651a2dcab4370e2405e9541ff3be01..04fb3b78da154e87db5f5002d51cf743af28edec 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        xh_chckl.cpp
+// Name:        src/xrc/xh_chckl.cpp
 // Purpose:     XRC resource for wxCheckList
 // Author:      Bob Mitchell
 // Created:     2000/03/21
     #pragma hdrstop
 #endif
 
-#if wxUSE_XRC
-
-#if wxUSE_CHECKLISTBOX
+#if wxUSE_XRC && wxUSE_CHECKLISTBOX
 
 #include "wx/xrc/xh_chckl.h"
-#include "wx/checklst.h"
-#include "wx/intl.h"
-#include "wx/log.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/intl.h"
+    #include "wx/log.h"
+    #include "wx/checklst.h"
+#endif
 
 IMPLEMENT_DYNAMIC_CLASS(wxCheckListBoxXmlHandler, wxXmlResourceHandler)
 
@@ -37,7 +38,7 @@ wxCheckListBoxXmlHandler::wxCheckListBoxXmlHandler()
     XRC_ADD_STYLE(wxLB_ALWAYS_SB);
     XRC_ADD_STYLE(wxLB_NEEDED_SB);
     XRC_ADD_STYLE(wxLB_SORT);
-    
+
     AddWindowStyles();
 }
 
@@ -112,7 +113,7 @@ wxObject *wxCheckListBoxXmlHandler::DoCreateResource()
         // add to the list
         wxString str = GetNodeContent(m_node);
         if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
-            str = wxGetTranslation(str);
+            str = wxGetTranslation(str, m_resource->GetDomain());
         strList.Add(str);
         return NULL;
     }
@@ -127,6 +128,4 @@ bool wxCheckListBoxXmlHandler::CanHandle(wxXmlNode *node)
            (m_insideBox && node->GetName() == wxT("item")));
 }
 
-#endif // wxUSE_CHECKLISTBOX
-
-#endif // wxUSE_XRC
+#endif // wxUSE_XRC && wxUSE_CHECKLISTBOX