X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c89f5c02b1ecc6098b21b39b01509dd387c1cb34..e777924b358ae352f30881249f681ebb7a3ce089:/src/gtk/colour.cpp diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp index 8ee81076b5..1b82a30b01 100644 --- a/src/gtk/colour.cpp +++ b/src/gtk/colour.cpp @@ -35,6 +35,13 @@ public: m_hasPixel = FALSE; } + wxColourRefData(const wxColourRefData& data) + { + m_color = data.m_color; + m_colormap = data.m_colormap; + m_hasPixel = data.m_hasPixel; + } + ~wxColourRefData() { FreeColour(); @@ -110,8 +117,8 @@ void wxColourRefData::AllocColour( GdkColormap *cmap ) FreeColour(); #ifdef __WXGTK20__ - if ((m_colormap->visual->type == GDK_VISUAL_GRAYSCALE) || - (m_colormap->visual->type == GDK_VISUAL_PSEUDO_COLOR)) + if ( (cmap->visual->type == GDK_VISUAL_GRAYSCALE) || + (cmap->visual->type == GDK_VISUAL_PSEUDO_COLOR) ) #else GdkColormapPrivate *private_colormap = (GdkColormapPrivate*) cmap; if ((private_colormap->visual->type == GDK_VISUAL_GRAYSCALE) || @@ -158,6 +165,7 @@ void wxColour::InitFromName( const wxString &colourName ) else { m_refData = new wxColourRefData(); + if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color )) { // VZ: asserts are good in general but this one is triggered by