X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ed39ff57b30a70a2395e07887a70bc01e7a3b7ec..b77b87881bae2e6306366d79e7fe160334b3d4a2:/src/gtk/pen.cpp diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp index 66470bcc89..ee89ada46a 100644 --- a/src/gtk/pen.cpp +++ b/src/gtk/pen.cpp @@ -8,10 +8,13 @@ ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "pen.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/pen.h" #include "wx/colour.h" @@ -43,20 +46,33 @@ public: m_capStyle = data.m_capStyle; m_colour = data.m_colour; m_countDashes = data.m_countDashes; -/* - if (data.m_dash) TODO - m_dash = new -*/ m_dash = data.m_dash; } bool operator == (const wxPenRefData& data) const { - return (m_style == data.m_style && - m_width == data.m_width && - m_joinStyle == data.m_joinStyle && - m_capStyle == data.m_capStyle && - m_colour == data.m_colour); + if ( m_countDashes != data.m_countDashes ) + return FALSE; + + if ( m_dash ) + { + if ( !data.m_dash || + memcmp(m_dash, data.m_dash, m_countDashes*sizeof(wxGTKDash)) ) + { + return FALSE; + } + } + else if ( data.m_dash ) + { + return FALSE; + } + + + return m_style == data.m_style && + m_width == data.m_width && + m_joinStyle == data.m_joinStyle && + m_capStyle == data.m_capStyle && + m_colour == data.m_colour; } int m_width; @@ -118,7 +134,7 @@ void wxPen::SetDashes( int number_of_dashes, const wxDash *dash ) AllocExclusive(); M_PENDATA->m_countDashes = number_of_dashes; - M_PENDATA->m_dash = (wxGTKDash *)dash; /* TODO */ + M_PENDATA->m_dash = (wxGTKDash *)dash; } void wxPen::SetColour( int red, int green, int blue )