]> git.saurik.com Git - wxWidgets.git/commitdiff
correct handling of positive quality values (2nd part of patch 1851381)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 5 Jan 2008 18:44:36 +0000 (18:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 5 Jan 2008 18:44:36 +0000 (18:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/print.cpp

index 876888780b36f6290e43acfe3ecb521fbb3f948f..d19b567da547e531ece7ad04a6709c5a640204e7 100644 (file)
@@ -2269,8 +2269,6 @@ void wxGtkPrintPreview::Init(wxPrintout * WXUNUSED(printout),
                              wxPrintout * WXUNUSED(printoutForPrinting),
                              wxPrintData *data)
 {
-    DetermineScaling();
-
     // convert wxPrintQuality to resolution (input pointer can be NULL)
     wxPrintQuality quality = data ? data->GetQuality() : wxPRINT_QUALITY_MEDIUM;
     switch ( quality )
@@ -2283,10 +2281,6 @@ void wxGtkPrintPreview::Init(wxPrintout * WXUNUSED(printout),
             wxFAIL_MSG( "unknown print quality" );
             // fall through
 
-        case wxPRINT_QUALITY_MEDIUM:
-            m_resolution = 600;
-            break;
-
         case wxPRINT_QUALITY_LOW:
             m_resolution = 300;
             break;
@@ -2294,7 +2288,25 @@ void wxGtkPrintPreview::Init(wxPrintout * WXUNUSED(printout),
         case wxPRINT_QUALITY_DRAFT:
             m_resolution = 150;
             break;
+
+        default:
+            if ( quality > 0 )
+            {
+                // positive values directly indicate print resolution
+                m_resolution = quality;
+                break;
+            }
+
+            wxFAIL_MSG( "unknown print quality" );
+            // fall through
+
+        case wxPRINT_QUALITY_MEDIUM:
+            m_resolution = 600;
+            break;
+
     }
+
+    DetermineScaling();
 }
 
 wxGtkPrintPreview::wxGtkPrintPreview(wxPrintout *printout,