]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow absent checkbox when transferring dimension data
authorJulian Smart <julian@anthemion.co.uk>
Sun, 22 Sep 2013 20:22:19 +0000 (20:22 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 22 Sep 2013 20:22:19 +0000 (20:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextformatdlg.cpp

index bf976d9b4ae166affd6647de1daa5ddefe5a0a2b..fc44348c27a63ee9e3522180ce8001c9b20b5544 100644 (file)
@@ -598,7 +598,8 @@ void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxT
 
     if (!dim.IsValid())
     {
-        checkBox->SetValue(false);
+        if (checkBox)
+            checkBox->SetValue(false);
         valueCtrl->SetValue(wxT("0"));
         unitsCtrl->SetSelection(0);
 #if 0
@@ -608,7 +609,8 @@ void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxT
     }
     else
     {
-        checkBox->SetValue(true);
+        if (checkBox)
+            checkBox->SetValue(true);
         if (dim.GetUnits() == wxTEXT_ATTR_UNITS_TENTHS_MM)
         {
             unitsIdx = 1;
@@ -632,7 +634,7 @@ void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxT
 
 void wxRichTextFormattingDialog::GetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl, wxCheckBox* checkBox)
 {
-    if (!checkBox->GetValue())
+    if (checkBox && !checkBox->GetValue())
     {
         dim.Reset();
     }