From d14612c6621bf7dd9c711e2f94856137b926e863 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karsten=20Ball=C3=BCder?= Date: Sat, 3 Apr 1999 16:48:12 +0000 Subject: [PATCH] Attempt at fixing the broken printer dialog. *Lots* of unitialised variables! Not fixed yet. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/prntdlgg.cpp | 46 +++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/generic/prntdlgg.cpp b/src/generic/prntdlgg.cpp index c5ea11ae15..3602295dab 100644 --- a/src/generic/prntdlgg.cpp +++ b/src/generic/prntdlgg.cpp @@ -136,6 +136,7 @@ void wxGenericPrintDialog::Init(wxWindow *parent) choices[1] = _("Pages"); m_fromText = (wxTextCtrl*)NULL; + m_toText = (wxTextCtrl*)NULL; if (m_printDialogData.GetFromPage() != 0) { @@ -276,28 +277,29 @@ bool wxGenericPrintDialog::TransferDataToWindow() if(m_printDialogData.GetFromPage() != 0) { - if (m_printDialogData.GetEnablePageNumbers()) - { - m_fromText->Enable(TRUE); - m_toText->Enable(TRUE); - - sprintf(buf, "%d", m_printDialogData.GetFromPage()); - m_fromText->SetValue(buf); - sprintf(buf, "%d", m_printDialogData.GetToPage()); - m_toText->SetValue(buf); - - if (m_printDialogData.GetAllPages()) + if(m_fromText) + { + if (m_printDialogData.GetEnablePageNumbers()) + { + m_fromText->Enable(TRUE); + m_toText->Enable(TRUE); + sprintf(buf, "%d", m_printDialogData.GetFromPage()); + m_fromText->SetValue(buf); + sprintf(buf, "%d", m_printDialogData.GetToPage()); + m_toText->SetValue(buf); + if (m_printDialogData.GetAllPages()) m_rangeRadioBox->SetSelection(0); - else + else m_rangeRadioBox->SetSelection(1); - } - else - { - m_fromText->Enable(FALSE); - m_toText->Enable(FALSE); - m_rangeRadioBox->SetSelection(0); - m_rangeRadioBox->wxRadioBox::Enable(1, FALSE); - } + } + else + { + m_fromText->Enable(FALSE); + m_toText->Enable(FALSE); + m_rangeRadioBox->SetSelection(0); + m_rangeRadioBox->wxRadioBox::Enable(1, FALSE); + } + } } sprintf(buf, "%d", m_printDialogData.GetNoCopies()); m_noCopiesText->SetValue(buf); @@ -313,8 +315,8 @@ bool wxGenericPrintDialog::TransferDataFromWindow() { if (m_printDialogData.GetEnablePageNumbers()) { - m_printDialogData.SetFromPage(atoi(m_fromText->GetValue())); - m_printDialogData.SetToPage(atoi(m_toText->GetValue())); + if(m_fromText) m_printDialogData.SetFromPage(atoi(m_fromText->GetValue())); + if(m_toText) m_printDialogData.SetToPage(atoi(m_toText->GetValue())); } if (m_rangeRadioBox->GetSelection() == 0) m_printDialogData.SetAllPages(TRUE); -- 2.45.2