]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dcprint.cpp
Added CanApplyParentThemeBackground and use it in wxMSW's
[wxWidgets.git] / src / msw / dcprint.cpp
index c0f9a2c097a75d4190298e2cdc4ae9ae4d60cf46..53542de5ea305ad0c257f2203b31f4ecaab0601c 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dcprint.h"
 #endif
 
@@ -229,7 +229,6 @@ static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName)
     deviceName.clear();
 
     LPDEVNAMES  lpDevNames;
-    LPTSTR      lpszDriverName;
     LPTSTR      lpszDeviceName;
     LPTSTR      lpszPortName;
 
@@ -263,7 +262,6 @@ static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName)
     if (pd.hDevNames)
     {
         lpDevNames = (LPDEVNAMES)GlobalLock(pd.hDevNames);
-        lpszDriverName = (LPTSTR)lpDevNames + lpDevNames->wDriverOffset;
         lpszDeviceName = (LPTSTR)lpDevNames + lpDevNames->wDeviceOffset;
         lpszPortName   = (LPTSTR)lpDevNames + lpDevNames->wOutputOffset;
 
@@ -311,15 +309,10 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst)
     {
         // Retrieve the default device name
         wxString portName;
-#ifdef  __WXDEBUG__
-        bool ret =
-#else   // !Debug
-        (void)
-#endif // Debug/Release
-        wxGetDefaultDeviceName(devNameStr, portName);
-
-        wxASSERT_MSG( ret, wxT("Could not get default device name.") );
-
+        if ( !wxGetDefaultDeviceName(devNameStr, portName) )
+        {
+            return 0; // Could not get default device name
+        }
         deviceName = devNameStr.c_str();
     }
 
@@ -347,7 +340,8 @@ bool DrawBitmapUsingStretchDIBits(HDC hdc,
 {
 #if wxUSE_WXDIB
     wxDIB dib(bmp);
-    if ( !dib.IsOk() )
+    bool ok = dib.IsOk();
+    if ( !ok )
         return FALSE;
 
     DIBSECTION ds;