]> git.saurik.com Git - wxWidgets.git/commitdiff
No real changes, just clean up wxAbortProc mess.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 5 May 2010 12:19:53 +0000 (12:19 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 5 May 2010 12:19:53 +0000 (12:19 +0000)
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

include/wx/msw/printwin.h
src/msw/printwin.cpp

index de5b3975e30c021a88590f8d2ebaeb4d04cbdbbb..d515ef25a33cd0159ed64202c622dafcdc1a8c90 100644 (file)
@@ -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);
 };
 
index 587a4749fc2846a8797d1bbf7b39f5e31544b804..26aa924725b18a5272e0a21b74d530a9439517bd 100644 (file)
 
 #include <stdlib.h>
 
-#ifndef __WIN32__
-    #include <print.h>
-#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;