]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_statbar.cpp
non-unicode build fix
[wxWidgets.git] / src / xrc / xh_statbar.cpp
index ef9f2e19c27694836a6aa4d3cba66c0230c49c1c..a5e04452efcf9e60f89b120914d44b58f740c0df 100644 (file)
@@ -3,7 +3,7 @@
 // Purpose:     XRC resource for wxStatusBar
 // Author:      Brian Ravnsgaard Riis
 // Created:     2004/01/21
-// RCS-ID:      
+// RCS-ID:      $Id$
 // Copyright:   (c) 2004 Brian Ravnsgaard Riis
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -29,7 +29,7 @@
 
 IMPLEMENT_DYNAMIC_CLASS(wxStatusBarXmlHandler, wxXmlResourceHandler)
 
-wxStatusBarXmlHandler::wxStatusBarXmlHandler() : 
+wxStatusBarXmlHandler::wxStatusBarXmlHandler() :
         wxXmlResourceHandler()
 {
     XRC_ADD_STYLE(wxST_SIZEGRIP);
@@ -48,11 +48,11 @@ wxObject *wxStatusBarXmlHandler::DoCreateResource()
     int fields = GetLong(wxT("fields"), 1);
     wxString widths = GetParamValue(wxT("widths"));
 
-    if(fields > 1)
+    if (fields > 1 && !widths.IsEmpty())
     {
         int *width = new int[fields];
-  
-        for (unsigned int i = 0; i < fields; ++i)
+
+        for (int i = 0; i < fields; ++i)
         {
             width[i] = wxAtoi(widths.BeforeFirst(wxT(',')));
             if(widths.Find(wxT(',')))
@@ -61,6 +61,8 @@ wxObject *wxStatusBarXmlHandler::DoCreateResource()
         statbar->SetFieldsCount(fields, width);
         delete[] width;
     }
+    else
+        statbar->SetFieldsCount(fields);
 
     if (m_parentAsWindow)
     {