X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f884a0dccd6b642f35c441ac9bfc87a6d5b4d35..cce10ca06ba6406cc39d14b8721f5c460b0b4cfc:/include/wx/gdiobj.h diff --git a/include/wx/gdiobj.h b/include/wx/gdiobj.h index fc2e0756d7..d38a44bb7e 100644 --- a/include/wx/gdiobj.h +++ b/include/wx/gdiobj.h @@ -20,12 +20,19 @@ // the same native GDI object // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_FWD_CORE wxGDIRefData : public wxObjectRefData +class WXDLLIMPEXP_CORE wxGDIRefData : public wxObjectRefData { public: + // Default ctor which needs to be defined just because we use + // wxDECLARE_NO_COPY_CLASS() below. + wxGDIRefData() { } + // override this in the derived classes to check if this data object is // really fully initialized virtual bool IsOk() const { return true; } + +private: + wxDECLARE_NO_COPY_CLASS(wxGDIRefData); }; // ---------------------------------------------------------------------------- @@ -36,11 +43,11 @@ class WXDLLIMPEXP_CORE wxGDIObject : public wxObject { public: // checks if the object can be used - bool IsOk() const + virtual bool IsOk() const { // the cast here is safe because the derived classes always create // wxGDIRefData objects - return m_refData && wx_static_cast(wxGDIRefData *, m_refData)->IsOk(); + return m_refData && static_cast(m_refData)->IsOk(); } // don't use in the new code, use IsOk() instead @@ -74,7 +81,7 @@ protected: virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const { - return CloneGDIRefData(wx_static_cast(const wxGDIRefData *, data)); + return CloneGDIRefData(static_cast(data)); } virtual wxGDIRefData *CreateGDIRefData() const = 0;