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
This commit is contained in:
Vadim Zeitlin
2010-05-05 12:19:53 +00:00
parent 79d81c45ca
commit 5009cb6acc
2 changed files with 3 additions and 45 deletions

View File

@@ -24,7 +24,6 @@ class WXDLLIMPEXP_CORE wxWindowsPrinter : public wxPrinterBase
public: public:
wxWindowsPrinter(wxPrintDialogData *data = NULL); wxWindowsPrinter(wxPrintDialogData *data = NULL);
virtual ~wxWindowsPrinter();
virtual bool Print(wxWindow *parent, virtual bool Print(wxWindow *parent,
wxPrintout *printout, wxPrintout *printout,
@@ -34,8 +33,6 @@ public:
virtual bool Setup(wxWindow *parent); virtual bool Setup(wxWindow *parent);
private: private:
WXFARPROC m_lpAbortProc;
wxDECLARE_NO_COPY_CLASS(wxWindowsPrinter); wxDECLARE_NO_COPY_CLASS(wxWindowsPrinter);
}; };

View File

@@ -53,15 +53,11 @@
#include <stdlib.h> #include <stdlib.h>
#ifndef __WIN32__
#include <print.h>
#endif
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// private functions // private functions
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
LONG APIENTRY _EXPORT wxAbortProc(HDC hPr, int Code); BOOL CALLBACK wxAbortProc(HDC hdc, int error);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// wxWin macros // wxWin macros
@@ -81,16 +77,6 @@ LONG APIENTRY _EXPORT wxAbortProc(HDC hPr, int Code);
wxWindowsPrinter::wxWindowsPrinter(wxPrintDialogData *data) wxWindowsPrinter::wxWindowsPrinter(wxPrintDialogData *data)
: wxPrinterBase(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) 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); wxWindow *win = CreateAbortWindow(parent, printout);
wxYield(); wxYield();
#if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__GNUWIN32__) || !defined(__WIN32__) ::SetAbortProc(GetHdcOf(*impl), wxAbortProc);
#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
if (!win) if (!win)
{ {
@@ -471,15 +440,7 @@ bool wxWindowsPrintPreview::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum)
} }
/**************************************************************************** BOOL CALLBACK wxAbortProc(HDC WXUNUSED(hdc), int WXUNUSED(error))
FUNCTION: wxAbortProc()
PURPOSE: Processes messages for the Abort Dialog box
****************************************************************************/
LONG APIENTRY _EXPORT wxAbortProc(HDC WXUNUSED(hPr), int WXUNUSED(Code))
{ {
MSG msg; MSG msg;