[orca] Clear the cache and try once more when the next/previous context cannot be found



commit 093b31b6f1a123fb9903c4e0c17bffafd2eeaf24
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Aug 31 15:33:18 2015 -0400

    Clear the cache and try once more when the next/previous context cannot be found

 src/orca/scripts/web/script_utilities.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 272df68..9f95b12 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1159,6 +1159,12 @@ class Utilities(script_utilities.Utilities):
         debug.println(debug.LEVEL_INFO, msg)
 
         obj, offset = self.previousContext(firstObj, firstOffset, True)
+        if not obj and firstObj:
+            msg = "WEB: Previous context is: %s, %i. Trying again." % (obj, offset)
+            debug.println(debug.LEVEL_INFO, msg)
+            self.clearCachedObjects()
+            obj, offset = self.previousContext(firstObj, firstOffset, True)
+
         msg = "WEB: Previous context is: %s, %i" % (obj, offset)
         debug.println(debug.LEVEL_INFO, msg)
 
@@ -1197,6 +1203,12 @@ class Utilities(script_utilities.Utilities):
         debug.println(debug.LEVEL_INFO, msg)
 
         obj, offset = self.nextContext(lastObj, lastOffset, True)
+        if not obj and lastObj:
+            msg = "WEB: Next context is: %s, %i. Trying again." % (obj, offset)
+            debug.println(debug.LEVEL_INFO, msg)
+            self.clearCachedObjects()
+            obj, offset = self.nextContext(lastObj, lastOffset, True)
+
         msg = "WEB: Next context is: %s, %i" % (obj, offset)
         debug.println(debug.LEVEL_INFO, msg)
 


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