]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/colour.cpp
Updates to memcheck
[wxWidgets.git] / src / gtk / colour.cpp
index f9d2fa62a28677e473058f23fbc4892e7051c3c0..5b465727f882e435ed78bd1042f1d68b7e985c98 100644 (file)
@@ -165,25 +165,40 @@ void wxColour::Set( const unsigned char red, const unsigned char green, const un
 
 unsigned char wxColour::Red(void) const
 {
-  if (!Ok()) return 0;
+  if (!Ok())
+  {
+     wxFAIL_MSG( "invalid colour" );
+     return 0;
+  }
+  
   return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
 }
 
 unsigned char wxColour::Green(void) const
 {
-  if (!Ok()) return 0;
+  if (!Ok())
+  {
+     wxFAIL_MSG( "invalid colour" );
+     return 0;
+  }
+  
   return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
 }
 
 unsigned char wxColour::Blue(void) const
 {
-  if (!Ok()) return 0;
+  if (!Ok())
+  {
+     wxFAIL_MSG( "invalid colour" );
+     return 0;
+  }
+  
   return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
 }
 
 bool wxColour::Ok(void) const
 {
-  return (m_refData);
+  return (m_refData != NULL);
 }
 
 void wxColour::CalcPixel( GdkColormap *cmap )