[dasher] Rather than fix the crash caused when LP_UNIFORM=0, put in the same workaround



commit 28b2a6388a07fff6d51996f4c020eae8d01f8a7f
Author: Patrick Welche <prlw1 cam ac uk>
Date:   Thu May 14 23:00:30 2009 +0100

    Rather than fix the crash caused when LP_UNIFORM=0, put in the same workaround
    found in Gtk2/Preferences.cpp
---
 ChangeLog                         |    1 +
 Src/Win32/Widgets/AlphabetBox.cpp |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 924c1c1..4b482f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2009-05-14  Patrick Welche  <prlw1 cam ac uk>
 
 	* DasherButtons.cpp: Change box non-uniformity range again.
+	* AlphabetBox.cpp: hack to avoid crash when LP_UNIFORM is zero.
 
 2009-05-14  Alan Lawrence <acl33 inf phy cam ac uk>
 
diff --git a/Src/Win32/Widgets/AlphabetBox.cpp b/Src/Win32/Widgets/AlphabetBox.cpp
index 4ce3f5a..2a4666f 100644
--- a/Src/Win32/Widgets/AlphabetBox.cpp
+++ b/Src/Win32/Widgets/AlphabetBox.cpp
@@ -414,6 +414,9 @@ bool CAlphabetBox::Apply() {
   m_pAppSettings->SetBoolParameter( BP_LM_ADAPTIVE, SendMessage(GetDlgItem(m_hwnd, IDC_ADAPTIVE), BM_GETCHECK, 0, 0)!=0 );
   
   double NewUniform;
+  // XXX PRLW: Rather than fix the crash caused when LP_UNIFORM=0, put in
+  // the same workaround found in Gtk2/Preferences.cpp
+  if (NewUniform < 50) NewUniform = 50;
   NewUniform = SendMessage(slider, TBM_GETPOS, 0, 0);
   m_pAppSettings->SetLongParameter( LP_UNIFORM, NewUniform);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]