]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/prntdlgg.cpp
check for NULL pointer in OnMeasureItem() as well as in OnDrawItem()
[wxWidgets.git] / src / generic / prntdlgg.cpp
index 1c6f62db68f9a2201bcd94fc2128a5c621b30314..084ce72c10749ae1cfd6b75caeafd0c2ffeecfbc 100644 (file)
@@ -98,7 +98,7 @@ wxPostScriptPrintNativeData::wxPostScriptPrintNativeData()
 #if !defined(__VMS__) && !defined(__WXMSW__)
     m_printerCommand = wxT("lpr");
     m_printerOptions = wxEmptyString;
-    m_afmPath = wxEmptyString);
+    m_afmPath = wxEmptyString;
 #endif
 
     m_printerScaleX = 1.0;
@@ -136,7 +136,7 @@ END_EVENT_TABLE()
 wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
                                            wxPrintDialogData* data)
                     : wxPrintDialogBase(parent, wxID_ANY, _("Print"),
-                               wxPoint(0, 0), wxSize(600, 600),
+                               wxPoint(0,0), wxSize(600, 600),
                                wxDEFAULT_DIALOG_STYLE |
                                wxTAB_TRAVERSAL)
 {
@@ -149,7 +149,7 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
 wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
                                            wxPrintData* data)
                     : wxPrintDialogBase(parent, wxID_ANY, _("Print"),
-                               wxPoint(0, 0), wxSize(600, 600),
+                               wxPoint(0,0), wxSize(600, 600),
                                wxDEFAULT_DIALOG_STYLE |
                                wxTAB_TRAVERSAL)
 {
@@ -161,7 +161,7 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
 
 void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
 {
-  //    wxDialog::Create(parent, wxID_ANY, _("Print"), wxPoint(0, 0), wxSize(600, 600),
+  //    wxDialog::Create(parent, wxID_ANY, _("Print"), wxPoint(0,0), wxSize(600, 600),
   //                     wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL);
 
     wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
@@ -442,7 +442,7 @@ BEGIN_EVENT_TABLE(wxGenericPrintSetupDialog, wxDialog)
 END_EVENT_TABLE()
 
 wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data):
-wxDialog(parent, wxID_ANY, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL)
+wxDialog(parent, wxID_ANY, _("Print Setup"), wxPoint(0,0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL)
 {
     Init(data);
 }
@@ -513,6 +513,8 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
         item2.SetMask( wxLIST_MASK_IMAGE );
         item2.SetImage( 0 );
         m_printerListCtrl->SetItem( item2 );
+        // also select item
+        m_printerListCtrl->SetItemState( item.GetId(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
     }
 
     item.SetId( 1+ item.GetId() );
@@ -549,6 +551,8 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
                 item2.SetMask( wxLIST_MASK_IMAGE );
                 item2.SetImage( 0 );
                 m_printerListCtrl->SetItem( item2 );
+                // also select item
+                m_printerListCtrl->SetItemState( item.GetId(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
             }
 
             wxString command = wxT("lpstat -p ");
@@ -821,7 +825,7 @@ wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
     : wxPageSetupDialogBase( parent,
                 wxID_ANY,
                 _("Page Setup"),
-                wxPoint(0, 0),
+                wxPoint(0,0),
                 wxSize(600, 600),
                 wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL )
 {