X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1aca6611e695531e77e79e19e19da12d4c57dff0..6bc176b4ab7ed858d558546bcdd0a05229b64a3b:/src/os2/pen.cpp diff --git a/src/os2/pen.cpp b/src/os2/pen.cpp index effcfc0cbe..e0af18abc5 100644 --- a/src/os2/pen.cpp +++ b/src/os2/pen.cpp @@ -168,6 +168,15 @@ wxPen::wxPen( RealizeResource(); } // end of wxPen::wxPen +bool wxPen::operator==(const wxPen& pen) const +{ + const wxPenRefData * + penData = static_cast(pen.m_refData); + + // an invalid pen is only equal to another invalid pen + return m_refData ? penData && *M_PENDATA == *penData : !penData; +} + int wx2os2PenStyle( wxPenStyle nWxStyle ); @@ -399,7 +408,7 @@ wxGDIRefData* wxPen::CreateGDIRefData() const wxGDIRefData* wxPen::CloneGDIRefData(const wxGDIRefData* data) const { - return new wxPenRefData(*wx_static_cast(const wxPenRefData*, data)); + return new wxPenRefData(*static_cast(data)); } void wxPen::SetColour( const wxColour& rColour ) @@ -479,7 +488,7 @@ void wxPen::SetCap( RealizeResource(); } // end of wxPen::SetCap -wxColour& wxPen::GetColour() const +wxColour wxPen::GetColour() const { wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );