X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/564a150b1f7c63a060c1b205a7cd50035031cd4b..60104cbafa4502c7592801ccb8507f779c5601cf:/src/mgl/colour.cpp?ds=sidebyside diff --git a/src/mgl/colour.cpp b/src/mgl/colour.cpp index ebab19fba2..feae373c8a 100644 --- a/src/mgl/colour.cpp +++ b/src/mgl/colour.cpp @@ -1,18 +1,14 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: colour.cpp +// Name: src/mgl/colour.cpp // Purpose: wxColour class // Author: Julian Smart // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "colour.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -32,7 +28,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 +52,18 @@ wxColour& wxColour::operator =(const wxColour& col) void wxColour::InitFromName(const wxString& name) { - wxColour *col = wxTheColourDatabase->Find(name); - if ( col.Ok() ) - { - *this = col; - } - else + if ( wxTheColourDatabase ) { - Init(); + wxColour col = wxTheColourDatabase->Find(name); + if ( col.Ok() ) + { + *this = col; + return; + } } + + // leave invalid + Init(); } wxColour::~wxColour() @@ -71,5 +75,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; }