[rkward-cvs] SF.net SVN: rkward:[4111] trunk/rkward/rkward/plugin/rkpluginspinbox.cpp
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Tue Dec 13 08:44:41 UTC 2011
Revision: 4111
http://rkward.svn.sourceforge.net/rkward/?rev=4111&view=rev
Author: tfry
Date: 2011-12-13 08:44:41 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
Add range sanitation to r4098, and apply the same fix for integer spinboxes.
Revision Links:
--------------
http://rkward.svn.sourceforge.net/rkward/?rev=4098&view=rev
Modified Paths:
--------------
trunk/rkward/rkward/plugin/rkpluginspinbox.cpp
Modified: trunk/rkward/rkward/plugin/rkpluginspinbox.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkpluginspinbox.cpp 2011-12-12 22:22:26 UTC (rev 4110)
+++ trunk/rkward/rkward/plugin/rkpluginspinbox.cpp 2011-12-13 08:44:41 UTC (rev 4111)
@@ -50,7 +50,7 @@
if (!intmode) {
double min = xml->getDoubleAttribute (element, "min", -FLT_MAX, DL_INFO);
double max = xml->getDoubleAttribute (element, "max", FLT_MAX, DL_INFO);
- double initial = xml->getDoubleAttribute (element, "initial", 0, DL_INFO);
+ double initial = xml->getDoubleAttribute (element, "initial", qMin (max, qMax (min, 0.0)), DL_INFO);
int default_precision = xml->getIntAttribute (element, "default_precision", 2, DL_INFO);
int max_precision = xml->getIntAttribute (element, "max_precision", 8, DL_INFO);
@@ -62,7 +62,7 @@
} else {
int min = xml->getIntAttribute (element, "min", INT_MIN, DL_INFO);
int max = xml->getIntAttribute (element, "max", INT_MAX, DL_INFO);
- int initial = xml->getIntAttribute (element, "initial", min, DL_INFO);
+ int initial = xml->getIntAttribute (element, "initial", qMin (max, qMax (min, 0)), DL_INFO);
spinbox->setIntMode (min, max, initial);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list