nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.12k stars 637 forks source link

Announcement of row/column headers to braille display #4195

Open nvaccessAuto opened 10 years ago

nvaccessAuto commented 10 years ago

Reported by nishimotz on 2014-06-13 10:22 Attached patch (as well as shown below) enables to include row/column headers in braille display if format information setting 'Table row/column headers' is checked.

Tested with Windows 7 and Excel 2010 (NVDA+shift+c/r).

diff --git a/source/braille.py b/source/braille.py
index 6971d81..58ec12c 100644
--- a/source/braille.py
+++ b/source/braille.py
@@ -492,15 +492,18 @@ def getBrailleTextForProperties(**propertyValues):
            # Translators: Displayed in braille when an object (e.g. a tree view item) has a hierarchical level.
            # %s is replaced with the level.
            textList.append(_('lv %s')%positionInfo[= propertyValues.get("rowHeaderText")
+   if rowHeaderText:
+       textList.append(rowHeaderText)
+   columnHeaderText = propertyValues.get("columnHeaderText")
+   if columnHeaderText:
+       textList.append(columnHeaderText)
    if rowNumber:
        if includeTableCellCoords and not cellCoordsText: 
            # Translators: Displayed in braille for a table cell row number.
            # %s is replaced with the row number.
            textList.append(_("r%s") % rowNumber)
    if columnNumber:
-       columnHeaderText = propertyValues.get("columnHeaderText")
-       if columnHeaderText:
-           textList.append(columnHeaderText)
        if includeTableCellCoords and not cellCoordsText:
            # Translators: Displayed in braille for a table cell column number.
            # %s is replaced with the column number.
@@ -536,6 +539,8 @@ class NVDAObjectRegion(Region):
            keyboardShortcut=obj.keyboardShortcut if presConfig["reportKeyboardShortcuts"]('level'])
+   rowHeaderText) else None,
            positionInfo=obj.positionInfo if presConfig[else None,
            cellCoordsText=obj.cellCoordsText if config.conf["documentFormatting"]("reportObjectPositionInformation"])[else None,
+           columnHeaderText=obj.columnHeaderText if hasattr(obj, "columnHeaderText") and config.conf["documentFormatting"]("reportTableCellCoords"])[else None,
+           rowHeaderText=obj.rowHeaderText if hasattr(obj, "rowHeaderText") and config.conf["documentFormatting"]("reportTableHeaders"])["reportTableHeaders"] else None,
        )
        self.rawText = text + self.appendText
        super(NVDAObjectRegion, self).update()
-- 
nvaccessAuto commented 10 years ago

Attachment 0001-use-column-row-headers-for-braille-display.patch added by nishimotz on 2014-06-13 11:50 Description:

nvaccessAuto commented 10 years ago

Comment 1 by nishimotz on 2014-06-13 11:53 I have replaced the attachment file to append the patch below (although I am not sure it is necessary):

@@ -580,6 +585,7 @@ def getControlFieldBraille(field, ancestors, reportStart, formatConfig):
        }
        if reportTableHeaders:
            props[= field.get("table-columnheadertext")
+           props["rowHeaderText"]("columnHeaderText"]) = fields.get("table-rowheadertext")
        return getBrailleTextForProperties(**props)

    elif reportStart:
nvaccessAuto commented 10 years ago

Comment 2 by Michael Curran <mick@... on 2014-06-16 02:36 In [e5dc3e35ecd0f8be3960ae7374b8aa17b346460e]:

Merge branch 't4195' into next. Incubates #4195

Changes: Added labels: incubating

nvaccessAuto commented 10 years ago

Comment 3 by jteh on 2014-08-05 01:09 Holding this back because reporting of row headers will be too verbose if they are always reported. They should only be reported if changed.

Adriani90 commented 5 years ago

@nishimotz are you still working on this? Is there a coresponding pull request on Github? Or is the work on this Feature being continued only in this issue? In my opinion a pull request would be less confusing and better to distinguish the old patch from current commits. Thanks.

LeonarddeR commented 5 years ago

cc @dkager

josephsl commented 5 years ago

Hi,

We may need to morph this one due to issues found while incubating more than two years ago. Thanks.

nishimotz commented 5 years ago

@Adriani90 I didn't create a pull request so far.