From: Julian Smart <julian@anthemion.co.uk>
Date: Sun, 22 Sep 2013 20:22:19 +0000 (+0000)
Subject: Allow absent checkbox when transferring dimension data
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7fd80c6f685550715713208680e7d095b03c1632

Allow absent checkbox when transferring dimension data


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp
index bf976d9b4a..fc44348c27 100644
--- a/src/richtext/richtextformatdlg.cpp
+++ b/src/richtext/richtextformatdlg.cpp
@@ -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();
     }