]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/print.cpp
compilation fixes for PCH-less build after r57074
[wxWidgets.git] / src / gtk / print.cpp
index 3bebe3ddc124d863326f556b5271372ede7b8520..a7c6f95081cb5b444af27b3cd0c5e5332d16c7e5 100644 (file)
@@ -1074,7 +1074,7 @@ wxDC* wxGtkPrinter::PrintDialog( wxWindow *parent )
     }
 
     m_printDialogData = dialog.GetPrintDialogData();
-    
+
     return new wxPrinterDC( m_printDialogData.GetPrintData() );
 }
 
@@ -1132,7 +1132,7 @@ wxGtkPrinterDCImpl::wxGtkPrinterDCImpl(wxPrinterDC *owner, const wxPrintData& da
 #if wxCAIRO_SCALE
     m_PS2DEV = 1.0;
     m_DEV2PS = 1.0;
-    
+
     cairo_scale( m_cairo, 72.0 / (double)m_resolution, 72.0 / (double)m_resolution );
 #else
     m_PS2DEV = (double)m_resolution / 72.0;
@@ -1192,7 +1192,8 @@ void wxGtkPrinterDCImpl::DoGradientFillConcentric(const wxRect& rect, const wxCo
     wxCoord w =  rect.width;
     wxCoord h = rect.height;
 
-    double radius = sqrt((w/2)*(w/2)+(h/2)*(h/2));
+    const double r2 = (w/2)*(w/2)+(h/2)*(h/2);
+    double radius = sqrt(r2);
 
     unsigned char redI = initialColour.Red();
     unsigned char blueI = initialColour.Blue();
@@ -1865,7 +1866,7 @@ void wxGtkPrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wxCo
 void wxGtkPrinterDCImpl::Clear()
 {
 // Clear does nothing for printing, but keep the code
-// for later reuse 
+// for later reuse
 /*
     cairo_save(m_cairo);
     cairo_set_operator (m_cairo, CAIRO_OPERATOR_SOURCE);
@@ -1901,7 +1902,7 @@ void wxGtkPrinterDCImpl::SetPen( const wxPen& pen )
     m_pen = pen;
 
     double width;
-    
+
     if (m_pen.GetWidth() <= 0)
         width = 0.1;
     else
@@ -2179,7 +2180,7 @@ void wxGtkPrinterDCImpl::DoGetTextExtent(const wxString& string, wxCoord *width,
     // Set layout's text
     const wxUTF8Buf dataUTF8 = string.utf8_str();
 
-    gint oldSize;
+    gint oldSize=0;
     if ( theFont )
     {
         // scale the font and apply it
@@ -2250,7 +2251,7 @@ void wxGtkPrinterDCImpl::SetPrintData(const wxPrintData& data)
 
 // overriden for wxPrinterDC Impl
 
-wxRect wxGtkPrinterDCImpl::GetPaperRect()
+wxRect wxGtkPrinterDCImpl::GetPaperRect() const
 {
     // Does GtkPrint support printer margins?
     int w = 0;
@@ -2259,7 +2260,7 @@ wxRect wxGtkPrinterDCImpl::GetPaperRect()
     return wxRect( 0,0,w,h );
 }
 
-int wxGtkPrinterDCImpl::GetResolution()
+int wxGtkPrinterDCImpl::GetResolution() const
 {
     return m_resolution;
 }
@@ -2356,7 +2357,7 @@ void wxGtkPrintPreview::DetermineScaling()
         wxSize sizeDevUnits(paper->GetSizeDeviceUnits());
         sizeDevUnits.x = wxRound((double)sizeDevUnits.x * (double)m_resolution / 72.0);
         sizeDevUnits.y = wxRound((double)sizeDevUnits.y * (double)m_resolution / 72.0);
-        
+
         wxSize sizeTenthsMM(paper->GetSize());
         wxSize sizeMM(sizeTenthsMM.x / 10, sizeTenthsMM.y / 10);