X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d44aaf824396d1029bab018f4613e3952daa9ee..2356708db31b737c6eae53c2316b642aa5a2e68d:/utils/serialize/sergdi.cpp diff --git a/utils/serialize/sergdi.cpp b/utils/serialize/sergdi.cpp index 8ab44d782c..e413a4627b 100644 --- a/utils/serialize/sergdi.cpp +++ b/utils/serialize/sergdi.cpp @@ -25,12 +25,13 @@ #include #include #include +#include #include "sergdi.h" IMPLEMENT_SERIAL_CLASS(wxBitmap, wxObject) IMPLEMENT_SERIAL_CLASS(wxGDIObject, wxObject) IMPLEMENT_SERIAL_CLASS(wxRegion, wxGDIObject) -IMPLEMENT_SERIAL_CLASS(wxColour, wxGDIObject) +IMPLEMENT_SERIAL_CLASS(wxColour, wxObject) IMPLEMENT_SERIAL_CLASS(wxFont, wxGDIObject) IMPLEMENT_SERIAL_CLASS(wxPen, wxGDIObject) IMPLEMENT_SERIAL_CLASS(wxBrush, wxGDIObject) @@ -89,7 +90,8 @@ void WXSERIAL(wxBitmap)::LoadObject(wxObjectInputStream& s) w = data_s.Read16(); h = data_s.Read16(); - bitmap->Resize(w, h); + bitmap->SetWidth(w); + bitmap->SetHeight(h); dc.SelectObject(*bitmap); for (y=0;yOk()) { + data_s.Write8(0); + data_s.Write8(0); + data_s.Write8(0); + wxLogDebug("wxColour (0x%x) isn't ready.\n", colour); + return; + } + data_s.Write8(colour->Red()); data_s.Write8(colour->Green()); data_s.Write8(colour->Blue()); @@ -176,8 +184,6 @@ void WXSERIAL(wxColour)::StoreObject(wxObjectOutputStream& s) void WXSERIAL(wxColour)::LoadObject(wxObjectInputStream& s) { - WXSERIAL(wxGDIObject)::LoadObject(s); - wxDataInputStream data_s(s); wxColour *colour = (wxColour *)Object(); int r, g, b; @@ -305,8 +311,10 @@ void WXSERIAL(wxImageList)::StoreObject(wxObjectOutputStream& s) int i; if (s.FirstStage()) { +#ifdef __WXGTK__ for (i=0;iGetImageCount();i++) s.AddChild(list->GetBitmap(i)); +#endif } wxDataOutputStream data_s(s);