]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/colour.cpp
don't write the strings to the stream one char at a time, it's *horribly* slow
[wxWidgets.git] / src / gtk / colour.cpp
index 8ee81076b50c2e2492ccbc76742f9b1dbad43892..84c790a329fcea1dbd7299c85b0355ce1c6054de 100644 (file)
@@ -35,6 +35,14 @@ public:
         m_hasPixel = FALSE;
     }
     
+    wxColourRefData(const wxColourRefData& data)
+        : wxObjectRefData()
+    {
+        m_color = data.m_color;
+        m_colormap = data.m_colormap;
+        m_hasPixel = data.m_hasPixel;
+    }
+
     ~wxColourRefData()
     {
         FreeColour();
@@ -110,8 +118,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 +166,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