X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8601b2e15bf924d4be6b7843064028e514a71ec8..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/x11/colour.cpp diff --git a/src/x11/colour.cpp b/src/x11/colour.cpp index e10c2f486b..d9ef085808 100644 --- a/src/x11/colour.cpp +++ b/src/x11/colour.cpp @@ -10,7 +10,7 @@ ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "colour.h" #endif @@ -93,8 +93,8 @@ void wxColourRefData::FreeColour() if (!m_colormap) return; #if !wxUSE_NANOX - if ((wxTheApp->m_visualType == GrayScale) || - (wxTheApp->m_visualType == PseudoColor)) + if ((wxTheApp->m_visualInfo->m_visualType == GrayScale) || + (wxTheApp->m_visualInfo->m_visualType == PseudoColor)) { int idx = m_color.pixel; colMapAllocCounter[ idx ] = colMapAllocCounter[ idx ] - 1; @@ -116,8 +116,8 @@ void wxColourRefData::AllocColour( WXColormap cmap ) FreeColour(); #if !wxUSE_NANOX - if ((wxTheApp->m_visualType == GrayScale) || - (wxTheApp->m_visualType == PseudoColor)) + if ((wxTheApp->m_visualInfo->m_visualType == GrayScale) || + (wxTheApp->m_visualInfo->m_visualType == PseudoColor)) { m_hasPixel = XAllocColor( wxGlobalDisplay(), (Colormap) cmap, &m_color ); int idx = m_color.pixel; @@ -157,10 +157,9 @@ wxColour::wxColour( unsigned char red, unsigned char green, unsigned char blue ) void wxColour::InitFromName( const wxString &colourName ) { - wxNode *node = (wxNode *) NULL; - if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) ) + wxColour* col; + if ( (wxTheColourDatabase) && (col = wxTheColourDatabase->FindColourNoAdd(colourName)) ) { - wxColour *col = (wxColour*)node->Data(); UnRef(); if (col) Ref( *col ); }