X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..c782096417f0fd9de6c6d47b23174233ec6bcf57:/src/msw/brush.cpp?ds=sidebyside diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index 4fc8fb3b65..8f0e645b31 100644 --- a/src/msw/brush.cpp +++ b/src/msw/brush.cpp @@ -13,10 +13,6 @@ // declarations // ============================================================================ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "brush.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -28,11 +24,12 @@ #pragma hdrstop #endif +#include "wx/brush.h" + #ifndef WX_PRECOMP #include "wx/list.h" #include "wx/utils.h" #include "wx/app.h" - #include "wx/brush.h" #endif // WX_PRECOMP #include "wx/msw/private.h" @@ -103,7 +100,8 @@ wxBrushRefData::wxBrushRefData(const wxBitmap& stipple) } wxBrushRefData::wxBrushRefData(const wxBrushRefData& data) - : m_stipple(data.m_stipple), + : wxGDIRefData(), + m_stipple(data.m_stipple), m_colour(data.m_colour) { m_style = data.m_style; @@ -126,7 +124,7 @@ bool wxBrushRefData::operator==(const wxBrushRefData& data) const // don't compare HBRUSHes return m_style == data.m_style && m_colour == data.m_colour && - m_stipple == data.m_stipple; + m_stipple.IsSameAs(data.m_stipple); } void wxBrushRefData::DoSetStipple(const wxBitmap& stipple) @@ -149,9 +147,10 @@ void wxBrushRefData::Free() } } -static int TransllateHatchStyle(int style) -{ #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) + +static int TranslateHatchStyle(int style) +{ switch ( style ) { case wxBDIAGONAL_HATCH: return HS_BDIAGONAL; @@ -162,19 +161,18 @@ static int TransllateHatchStyle(int style) case wxVERTICAL_HATCH: return HS_VERTICAL; default: return -1; } -#else // __WXMICROWIN__ - return -1; -#endif } +#endif // !__WXMICROWIN__ && !__WXWINCE__ + HBRUSH wxBrushRefData::GetHBRUSH() { if ( !m_hBrush ) { -#ifndef __WXWINCE__ - int hatchStyle = TransllateHatchStyle(m_style); +#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) + int hatchStyle = TranslateHatchStyle(m_style); if ( hatchStyle == -1 ) -#endif +#endif // !__WXMICROWIN__ && !__WXWINCE__ { switch ( m_style ) { @@ -246,16 +244,6 @@ wxBrush::~wxBrush() // wxBrush house keeping stuff // ---------------------------------------------------------------------------- -wxBrush& wxBrush::operator=(const wxBrush& brush) -{ - if ( *this != brush ) - { - Ref(brush); - } - - return *this; -} - bool wxBrush::operator==(const wxBrush& brush) const { const wxBrushRefData *brushData = (wxBrushRefData *)brush.m_refData; @@ -337,5 +325,3 @@ void wxBrush::SetStipple(const wxBitmap& stipple) M_BRUSHDATA->SetStipple(stipple); } - -