]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/colourcmn.cpp
Include wx/event.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / common / colourcmn.cpp
index 7cc62a7a7f5acf32d57ecea57e9b4049cd1a396e..4c7d7c088f5669113e43cbb544844f678b39e4df 100644 (file)
 
 #include "wx/colour.h"
 
 
 #include "wx/colour.h"
 
-#include "wx/gdicmn.h"
-#include "wx/log.h"
+#ifndef WX_PRECOMP
+    #include "wx/log.h"
+#endif
 
 
+#include "wx/gdicmn.h"
 
 
 // ============================================================================
 
 
 // ============================================================================
@@ -59,7 +61,10 @@ bool wxColourBase::FromString(const wxChar *str)
         // because this place can be called from constructor
         // and 'this' could not be available yet
         wxColour clr = wxTheColourDatabase->Find(str);
         // because this place can be called from constructor
         // and 'this' could not be available yet
         wxColour clr = wxTheColourDatabase->Find(str);
-        Set((unsigned char)clr.Red(), (unsigned char)clr.Green(), (unsigned char)clr.Blue());
+        if (clr.Ok())
+            Set((unsigned char)clr.Red(),
+                (unsigned char)clr.Green(),
+                (unsigned char)clr.Blue());
     }
 
     if (Ok())
     }
 
     if (Ok())