[orca/gnome-3-6] Fix for bug 687527 - Handle applications returning 0 in minimalIncrement for Value



commit 2f0beba700f30f55b5410726f4fe33165e9bf64a
Author: Frederik Gladhorn <gladhorn kde org>
Date:   Sat Nov 3 14:13:37 2012 -0400

    Fix for bug 687527 - Handle applications returning 0 in minimalIncrement for Value

 src/orca/script_utilities.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 76ee683..7384e55 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -3007,10 +3007,15 @@ class Utilities:
             debug.println(debug.LEVEL_FINEST, "VALUE WARNING: " \
                           "Error accessing minimumIncrement for %s" % obj)
 
-        try:
-            decimalPlaces = math.ceil(max(0, -math.log10(minIncrement)))
-        except ValueError:
-            return ""
+        if minIncrement != 0.0:
+            try:
+                decimalPlaces = math.ceil(max(0, -math.log10(minIncrement)))
+            except ValueError:
+                debug.println(debug.LEVEL_FINEST, "VALUE WARNING: " \
+                    "Error calculating decimal places for %s" % obj)
+                return ""
+        else:
+            decimalPlaces = 0
 
         formatter = "%%.%df" % decimalPlaces
         return formatter % currentValue



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