X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/564a150b1f7c63a060c1b205a7cd50035031cd4b..c4a95f6f991fa8685625831e52dc021b89727529:/src/mgl/colour.cpp?ds=sidebyside

diff --git a/src/mgl/colour.cpp b/src/mgl/colour.cpp
index ebab19fba2..da27128ada 100644
--- a/src/mgl/colour.cpp
+++ b/src/mgl/colour.cpp
@@ -32,7 +32,12 @@ void wxColour::Init()
     m_red =
     m_blue =
     m_green = 0;
-    m_isInit = FALSE;
+    m_isInit = false;
+}
+
+wxColour::wxColour()
+{
+    Init();
 }
 
 wxColour::wxColour(const wxColour& col)
@@ -51,15 +56,18 @@ wxColour& wxColour::operator =(const wxColour& col)
 
 void wxColour::InitFromName(const wxString& name)
 {
-    wxColour *col = wxTheColourDatabase->Find(name);
-    if ( col.Ok() )
+    if ( wxTheColourDatabase )
     {
-        *this = col;
-    }
-    else
-    {
-        Init();
+        wxColour col = wxTheColourDatabase->Find(name);
+        if ( col.Ok() )
+        {
+            *this = col;
+            return;
+        }
     }
+
+    // leave invalid
+    Init();
 }
 
 wxColour::~wxColour()
@@ -71,5 +79,5 @@ void wxColour::Set(unsigned char r, unsigned char g, unsigned char b)
     m_red = r;
     m_green = g;
     m_blue = b;
-    m_isInit = TRUE;
+    m_isInit = true;
 }