[orca] Remove any pre-calculated values for other cells in row during generation



commit 71cc8c25be29a9b25dd73e947177e5f7f7566ce0
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Thu Jan 23 10:34:29 2020 -0500

    Remove any pre-calculated values for other cells in row during generation
    
    When generating the full contents of a row, not all properties apply
    to all cells in the same row (e.g. the pre-calculated-for-performance)
    string. Remove these before generation so we don't get bogus results.

 src/orca/generator.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/generator.py b/src/orca/generator.py
index da7653ed2..d7b6f5bef 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -906,8 +906,18 @@ class Generator:
         args['readingRow'] = True
         result = []
         cells = self._script.utilities.getShowingCellsInSameRow(obj, forceFullRow=True)
+
+        # Remove any pre-calcuated values which only apply to obj and not row cells.
+        doNotInclude = ['startOffset', 'endOffset', 'string']
+        otherCellArgs = args.copy()
+        for arg in doNotInclude:
+            otherCellArgs.pop(arg, None)
+
         for cell in cells:
-            cellResult = self._generateRealTableCell(cell, **args)
+            if cell == obj:
+                cellResult = self._generateRealTableCell(cell, **args)
+            else:
+                cellResult = self._generateRealTableCell(cell, **otherCellArgs)
             if cellResult and result and self._mode == 'braille':
                 result.append(braille.Region(object_properties.TABLE_CELL_DELIMITER_BRAILLE))
             result.extend(cellResult)


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