]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/printdlg.cpp
detect horizontal overflow in wxHtmlPrintout and warn the user about it
[wxWidgets.git] / src / msw / printdlg.cpp
index 46d877613e1352ab6441426ac2e336c092a36209..f2b04942b7374bc5784145dec66711d689762706 100644 (file)
@@ -46,7 +46,6 @@
 // wxWindowsPrintNativeData
 //----------------------------------------------------------------------------
 
-#ifdef __WXDEBUG__
 static wxString wxGetPrintDlgError()
 {
     DWORD err = CommDlgExtendedError();
@@ -79,7 +78,6 @@ static wxString wxGetPrintDlgError()
     }
     return msg;
 }
-#endif // __WXDEBUG__
 
 static HGLOBAL
 wxCreateDevNames(const wxString& driverName,
@@ -366,11 +364,7 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
             pd.hDevMode = NULL;
             pd.hDevNames = NULL;
 
-#ifdef __WXDEBUG__
-            wxString str(wxT("Printing error: "));
-            str += wxGetPrintDlgError();
-            wxLogDebug(str);
-#endif // __WXDEBUG__
+            wxLogDebug(wxT("Printing error: ") + wxGetPrintDlgError());
         }
         else
         {
@@ -412,10 +406,9 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
         {
             // NB: the cast is needed in the ANSI build, strangely enough
             //     dmDeviceName is BYTE[] and not char[] there
-            wxStrncpy(reinterpret_cast<wxChar *>(devMode->dmDeviceName),
+            wxStrlcpy(reinterpret_cast<wxChar *>(devMode->dmDeviceName),
                       name.wx_str(),
-                      WXSIZEOF(devMode->dmDeviceName) - 1);
-            devMode->dmDeviceName[WXSIZEOF(devMode->dmDeviceName) - 1] = wxT('\0');
+                      WXSIZEOF(devMode->dmDeviceName));
         }
 
         //// Colour
@@ -697,7 +690,7 @@ bool wxWindowsPrintDialog::ConvertToNative( wxPrintDialogData &data )
 
     pd->hwndOwner = NULL;
     pd->hInstance = NULL;
-    pd->lCustData = NULL;
+    pd->lCustData = 0;
     pd->lpfnPrintHook = NULL;
     pd->lpfnSetupHook = NULL;
     pd->lpPrintTemplateName = NULL;