~mshinke/nvdajp/main

« back to all changes in this revision

Viewing changes to source/braille.py

  • Committer: Masataka Shinke
  • Date: 2012-04-23 16:25:22 UTC
  • mfrom: (3493.2.734 jpmain)
  • Revision ID: mshinke@users.sourceforge.jp-20120423162522-18alcwk1h0pxzomw
mergedĀ lp:~nishimotz/nvdajp/mainĀ 4227

Show diffs side-by-side

added added

removed removed

Lines of Context:
400
400
        states = propertyValues.get("states")
401
401
        positionInfo = propertyValues.get("positionInfo")
402
402
        level = positionInfo.get("level") if positionInfo else None
 
403
        cellCoordsText=propertyValues.get('cellCoordsText')
403
404
        rowNumber = propertyValues.get("rowNumber")
404
405
        columnNumber = propertyValues.get("columnNumber")
405
406
        includeTableCellCoords = propertyValues.get("includeTableCellCoords", True)
414
415
                        states.discard(controlTypes.STATE_VISITED)
415
416
                        # Translators: Displayed in braille for a link which has been visited.
416
417
                        roleText = _("vlnk")
417
 
                elif (name or rowNumber or columnNumber) and role in controlTypes.silentRolesOnFocus:
 
418
                elif (name or cellCoordsText or rowNumber or columnNumber) and role in controlTypes.silentRolesOnFocus:
418
419
                        roleText = None
419
420
                else:
420
421
                        roleText = roleLabels.get(role, controlTypes.roleLabels[role])
428
429
                positiveStates = controlTypes.processPositiveStates(role, states, controlTypes.REASON_FOCUS, states)
429
430
                textList.extend(positiveStateLabels.get(state, controlTypes.stateLabels[state]) for state in positiveStates)
430
431
                negativeStates = controlTypes.processNegativeStates(role, states, controlTypes.REASON_FOCUS, None)
431
 
                textList.extend(negativeStateLabels.get(state, _("not %s") % controlTypes.stateLabels[state]) for state in negativeStates)
 
432
                textList.extend(negativeStateLabels.get(state, controlTypes.negativeStateLabels.get(state, _("not %s") % controlTypes.stateLabels[state])) for state in negativeStates)
432
433
        if roleText:
433
434
                textList.append(roleText)
434
435
        description = propertyValues.get("description")
447
448
                        # %s is replaced with the level.
448
449
                        textList.append(_('lv %s')%positionInfo['level'])
449
450
        if rowNumber:
450
 
                if includeTableCellCoords: 
 
451
                if includeTableCellCoords and not cellCoordsText: 
451
452
                        # Translators: Displayed in braille for a table cell row number.
452
453
                        # %s is replaced with the row number.
453
454
                        textList.append(_("r%s") % rowNumber)
455
456
                columnHeaderText = propertyValues.get("columnHeaderText")
456
457
                if columnHeaderText:
457
458
                        textList.append(columnHeaderText)
458
 
                if includeTableCellCoords:
 
459
                if includeTableCellCoords and not cellCoordsText:
459
460
                        # Translators: Displayed in braille for a table cell column number.
460
461
                        # %s is replaced with the column number.
461
462
                        textList.append(_("c%s") % columnNumber)
 
463
        if includeTableCellCoords and  cellCoordsText:
 
464
                textList.append(cellCoordsText)
462
465
        return " ".join([x for x in textList if x])
463
466
 
464
467
class NVDAObjectRegion(Region):