[orca] Fix for bug 687527 - Handle applications returning 0 in minimalIncrement for Value
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Fix for bug 687527 - Handle applications returning 0 in minimalIncrement for Value
- Date: Sat, 3 Nov 2012 18:14:07 +0000 (UTC)
commit a958d7eca181a42e68ed4b8c3ac96e0922eb3c94
Author: Frederik Gladhorn <gladhorn kde org>
Date: Sat Nov 3 14:12:47 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 0054d47..b4ed4ab 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2913,10 +2913,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]