X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bc5e942bf3972629a0800d1653e20e177d8fa859..2cd3cc948ea512eba91032323fe32207ac74bf8e:/src/common/gdicmn.cpp diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 7b6e3db37c..fa208d6fa2 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -34,7 +34,7 @@ #endif -IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) +IMPLEMENT_ABSTRACT_CLASS(wxGDIObject, wxObject) WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList; @@ -58,6 +58,10 @@ WXDLLIMPEXP_DATA_CORE(wxIconBundle) wxNullIconBundle; const wxSize wxDefaultSize(wxDefaultCoord, wxDefaultCoord); const wxPoint wxDefaultPosition(wxDefaultCoord, wxDefaultCoord); +#include "wx/listimpl.cpp" +WX_DEFINE_LIST(wxPointList) + + #if wxUSE_EXTENDED_RTTI // wxPoint @@ -732,16 +736,15 @@ wxGDIObjListBase::~wxGDIObjListBase() wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style) { - for (wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext()) + for ( wxList::compatibility_iterator node = list.GetFirst(); + node; + node = node->GetNext() ) { - wxPen *each_pen = (wxPen *) node->GetData (); - if ( - each_pen->GetWidth () == width && - each_pen->GetStyle () == style && - each_pen->GetColour ().Red () == colour.Red () && - each_pen->GetColour ().Green () == colour.Green () && - each_pen->GetColour ().Blue () == colour.Blue ()) - return each_pen; + wxPen * const pen = (wxPen *) node->GetData(); + if ( pen->GetWidth () == width && + pen->GetStyle () == style && + pen->GetColour() == colour ) + return pen; } wxPen* pen = NULL; @@ -757,15 +760,13 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style) wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, int style) { - for (wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext()) + for ( wxList::compatibility_iterator node = list.GetFirst(); + node; + node = node->GetNext() ) { - wxBrush *each_brush = (wxBrush *) node->GetData (); - if ( - each_brush->GetStyle () == style && - each_brush->GetColour ().Red () == colour.Red () && - each_brush->GetColour ().Green () == colour.Green () && - each_brush->GetColour ().Blue () == colour.Blue ()) - return each_brush; + wxBrush * const brush = (wxBrush *) node->GetData (); + if ( brush->GetStyle () == style && brush->GetColour() == colour ) + return brush; } wxBrush* brush = NULL;