From: Vadim Zeitlin Date: Sun, 22 Oct 2006 13:04:28 +0000 (+0000) Subject: call Init() from wxBufferedDC ctors to ensure that layout direction is inherited... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c4a34cf8c5b5261f8726fdbfe0b2464dd35df268?ds=inline call Init() from wxBufferedDC ctors to ensure that layout direction is inherited in any case git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/dcbuffer.h b/include/wx/dcbuffer.h index 4c0b1e954a..6e26da6f97 100644 --- a/include/wx/dcbuffer.h +++ b/include/wx/dcbuffer.h @@ -50,29 +50,25 @@ public: // Construct a wxBufferedDC using a user supplied buffer. wxBufferedDC(wxDC *dc, - const wxBitmap &buffer = wxNullBitmap, + const wxBitmap& buffer = wxNullBitmap, int style = wxBUFFER_CLIENT_AREA) - : m_dc(dc), - m_buffer(&buffer), - m_style(style) + : m_dc(NULL), + m_buffer(NULL) { - UseBuffer(); + Init(dc, buffer, style); } // Construct a wxBufferedDC with an internal buffer of 'area' // (where area is usually something like the size of the window // being buffered) - wxBufferedDC(wxDC *dc, const wxSize &area, int style = wxBUFFER_CLIENT_AREA) - : m_dc(dc), - m_buffer(NULL), - m_style(style) + wxBufferedDC(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA) + : m_dc(NULL), + m_buffer(NULL) { - UseBuffer(area.x, area.y); + Init(dc, area, style); } - // default copy ctor ok. - // The usually desired action in the dtor is to blit the buffer. virtual ~wxBufferedDC() { @@ -80,8 +76,7 @@ public: UnMask(); } - // These reimplement the actions of the ctors for two stage creation, but - // are not used by the ctors themselves to save a few cpu cycles. + // These reimplement the actions of the ctors for two stage creation void Init(wxDC *dc, const wxBitmap& buffer = wxNullBitmap, int style = wxBUFFER_CLIENT_AREA) @@ -270,6 +265,5 @@ inline wxDC* wxAutoBufferedPaintDCFactory(wxWindow* window) else return new wxBufferedPaintDC(window); } - #endif // _WX_DCBUFFER_H_