X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b823f5a145f4823ce823591824855c34204936e4..a4f964122df05b83a7753ea50fb0831b9781822d:/src/msw/pen.cpp diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index ea9b92d667..2862a4dcc3 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -36,7 +36,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject) #endif -wxPenRefData::wxPenRefData(void) +wxPenRefData::wxPenRefData() { m_style = wxSOLID; m_width = 1; @@ -59,7 +59,7 @@ wxPenRefData::wxPenRefData(const wxPenRefData& data) m_hPen = 0; } -wxPenRefData::~wxPenRefData(void) +wxPenRefData::~wxPenRefData() { if ( m_hPen ) ::DeleteObject((HPEN) m_hPen); @@ -67,7 +67,7 @@ wxPenRefData::~wxPenRefData(void) // Pens -wxPen::wxPen(void) +wxPen::wxPen() { if ( wxThePenList ) wxThePenList->AddPen(this); @@ -143,27 +143,7 @@ wxPen::wxPen(const wxBitmap& stipple, int Width) wxThePenList->AddPen(this); } -wxPen::wxPen(const wxString& col, int Width, int Style) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_colour = col; -// M_PENDATA->m_stipple = NULL ; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = Style; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = 0 ; - M_PENDATA->m_hPen = 0 ; - - RealizeResource(); - - if ( wxThePenList ) - wxThePenList->AddPen(this); -} - -bool wxPen::RealizeResource(void) +bool wxPen::RealizeResource() { if (M_PENDATA && (M_PENDATA->m_hPen == 0)) { @@ -244,6 +224,11 @@ bool wxPen::RealizeResource(void) break ; default: logb.lbStyle = BS_SOLID ; + // this should be unnecessary (it's unused) but suppresses the Purigy + // messages about uninitialized memory read +#ifdef __WXDEBUG__ + logb.lbHatch = 0; +#endif break ; } logb.lbColor = ms_colour ; @@ -280,7 +265,7 @@ bool wxPen::RealizeResource(void) return FALSE; } -WXHANDLE wxPen::GetResourceHandle(void) +WXHANDLE wxPen::GetResourceHandle() { if ( !M_PENDATA ) return 0; @@ -299,7 +284,7 @@ bool wxPen::FreeResource(bool force) else return FALSE; } -bool wxPen::IsFree(void) +bool wxPen::IsFree() const { return (M_PENDATA && M_PENDATA->m_hPen == 0); } @@ -328,16 +313,7 @@ void wxPen::SetColour(const wxColour& col) RealizeResource(); } -void wxPen::SetColour(const wxString& col) -{ - Unshare(); - - M_PENDATA->m_colour = col; - - RealizeResource(); -} - -void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) +void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b) { Unshare();