From: Vadim Zeitlin Date: Wed, 5 May 2010 12:19:53 +0000 (+0000) Subject: No real changes, just clean up wxAbortProc mess. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5009cb6accf219ec5ce6010b9b1ea88bece64e03 No real changes, just clean up wxAbortProc mess. Remove m_lpAbortProc which is not needed at all and just requires ugly casts because its type was different from the real type of wxAbortProc. Get rid of the rest of the old Win16 code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/printwin.h b/include/wx/msw/printwin.h index de5b3975e3..d515ef25a3 100644 --- a/include/wx/msw/printwin.h +++ b/include/wx/msw/printwin.h @@ -24,7 +24,6 @@ class WXDLLIMPEXP_CORE wxWindowsPrinter : public wxPrinterBase public: wxWindowsPrinter(wxPrintDialogData *data = NULL); - virtual ~wxWindowsPrinter(); virtual bool Print(wxWindow *parent, wxPrintout *printout, @@ -34,8 +33,6 @@ public: virtual bool Setup(wxWindow *parent); private: - WXFARPROC m_lpAbortProc; - wxDECLARE_NO_COPY_CLASS(wxWindowsPrinter); }; diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 587a4749fc..26aa924725 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -53,15 +53,11 @@ #include -#ifndef __WIN32__ - #include -#endif - // --------------------------------------------------------------------------- // private functions // --------------------------------------------------------------------------- -LONG APIENTRY _EXPORT wxAbortProc(HDC hPr, int Code); +BOOL CALLBACK wxAbortProc(HDC hdc, int error); // --------------------------------------------------------------------------- // wxWin macros @@ -81,16 +77,6 @@ LONG APIENTRY _EXPORT wxAbortProc(HDC hPr, int Code); wxWindowsPrinter::wxWindowsPrinter(wxPrintDialogData *data) : wxPrinterBase(data) { - m_lpAbortProc = (WXFARPROC)wxAbortProc; -} - -wxWindowsPrinter::~wxWindowsPrinter() -{ - // avoids warning about statement with no effect (FreeProcInstance - // doesn't do anything under Win32) -#if !defined(__WIN32__) && !defined(__NT__) - FreeProcInstance((FARPROC) m_lpAbortProc); -#endif } bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) @@ -185,24 +171,7 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt wxWindow *win = CreateAbortWindow(parent, printout); wxYield(); -#if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__GNUWIN32__) || !defined(__WIN32__) -#ifdef STRICT - ::SetAbortProc((HDC) impl->GetHDC(), (ABORTPROC) m_lpAbortProc); -#else - ::SetAbortProc((HDC) impl->GetHDC(), (FARPROC) m_lpAbortProc); -#endif -#else - ::SetAbortProc((HDC) impl->GetHDC(), (int (_stdcall *) - // cast it to right type only if required - // FIXME it's really cdecl and we're casting it to stdcall - either there is - // something I don't understand or it will crash at first usage -#ifdef STRICT - (HDC, int) -#else - () -#endif - )m_lpAbortProc); -#endif + ::SetAbortProc(GetHdcOf(*impl), wxAbortProc); if (!win) { @@ -471,15 +440,7 @@ bool wxWindowsPrintPreview::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum) } -/**************************************************************************** - - FUNCTION: wxAbortProc() - - PURPOSE: Processes messages for the Abort Dialog box - -****************************************************************************/ - -LONG APIENTRY _EXPORT wxAbortProc(HDC WXUNUSED(hPr), int WXUNUSED(Code)) +BOOL CALLBACK wxAbortProc(HDC WXUNUSED(hdc), int WXUNUSED(error)) { MSG msg;