@@ -362,7 +362,7 @@ def getObjectPropertiesSpeech( # noqa: C901
362362 positionInfo = obj .positionInfo
363363 elif value and name == "current" :
364364 # getPropertiesSpeech names this "current", but the NVDAObject property is
365- # named "isCurrent".
365+ # named "isCurrent", it's type should always be controltypes.IsCurrent
366366 newPropertyValues ['current' ] = obj .isCurrent
367367 elif value :
368368 # Certain properties such as row and column numbers have presentational versions, which should be used for speech if they are available.
@@ -1611,15 +1611,12 @@ def getPropertiesSpeech( # noqa: C901
16111611 if rowCount or columnCount :
16121612 # The caller is entering a table, so ensure that it is treated as a new table, even if the previous table was the same.
16131613 oldTableID = None
1614- ariaCurrent = propertyValues .get ('current' , False )
1615- if ariaCurrent :
1616- try :
1617- ariaCurrentLabel = controlTypes .isCurrentLabels [ariaCurrent ]
1618- textList .append (ariaCurrentLabel )
1619- except KeyError :
1620- log .debugWarning ("Aria-current value not handled: %s" % ariaCurrent )
1621- ariaCurrentLabel = controlTypes .isCurrentLabels [True ]
1622- textList .append (ariaCurrentLabel )
1614+
1615+ # speak isCurrent property EG aria-current
1616+ isCurrent = propertyValues .get ('current' , controlTypes .IsCurrent .NO )
1617+ if isCurrent != controlTypes .IsCurrent .NO :
1618+ textList .append (isCurrent .displayString )
1619+
16231620 placeholder : Optional [str ] = propertyValues .get ('placeholder' , None )
16241621 if placeholder :
16251622 textList .append (placeholder )
@@ -1682,7 +1679,7 @@ def getControlFieldSpeech( # noqa: C901
16821679 name = ""
16831680 states = attrs .get ('states' ,set ())
16841681 keyboardShortcut = attrs .get ('keyboardShortcut' , "" )
1685- ariaCurrent = attrs .get ('current' , None )
1682+ isCurrent = attrs .get ('current' , controlTypes . IsCurrent . NO )
16861683 placeholderValue = attrs .get ('placeholder' , None )
16871684 value = attrs .get ('value' ,"" )
16881685 if reason == OutputReason .FOCUS or attrs .get ('alwaysReportDescription' , False ):
@@ -1712,7 +1709,7 @@ def getControlFieldSpeech( # noqa: C901
17121709 keyboardShortcutSequence = getPropertiesSpeech (
17131710 reason = reason , keyboardShortcut = keyboardShortcut
17141711 )
1715- ariaCurrentSequence = getPropertiesSpeech (reason = reason , current = ariaCurrent )
1712+ isCurrentSequence = getPropertiesSpeech (reason = reason , current = isCurrent )
17161713 placeholderSequence = getPropertiesSpeech (reason = reason , placeholder = placeholderValue )
17171714 nameSequence = getPropertiesSpeech (reason = reason , name = name )
17181715 valueSequence = getPropertiesSpeech (reason = reason , value = value )
@@ -1829,7 +1826,7 @@ def getControlFieldSpeech( # noqa: C901
18291826 getProps ['columnHeaderText' ] = attrs .get ("table-columnheadertext" )
18301827 tableCellSequence = getPropertiesSpeech (_tableID = tableID , ** getProps )
18311828 tableCellSequence .extend (stateTextSequence )
1832- tableCellSequence .extend (ariaCurrentSequence )
1829+ tableCellSequence .extend (isCurrentSequence )
18331830 types .logBadSequenceTypes (tableCellSequence )
18341831 return tableCellSequence
18351832
@@ -1878,7 +1875,7 @@ def getControlFieldSpeech( # noqa: C901
18781875 out .extend (stateTextSequence if speakStatesFirst else roleTextSequence )
18791876 out .extend (roleTextSequence if speakStatesFirst else stateTextSequence )
18801877 out .append (containerContainsText )
1881- out .extend (ariaCurrentSequence )
1878+ out .extend (isCurrentSequence )
18821879 out .extend (valueSequence )
18831880 out .extend (descriptionSequence )
18841881 out .extend (levelSequence )
@@ -1913,8 +1910,8 @@ def getControlFieldSpeech( # noqa: C901
19131910 # Special cases
19141911 elif not speakEntry and fieldType in ("start_addedToControlFieldStack" ,"start_relative" ):
19151912 out = []
1916- if ariaCurrent :
1917- out .extend (ariaCurrentSequence )
1913+ if isCurrent != controlTypes . IsCurrent . NO :
1914+ out .extend (isCurrentSequence )
19181915 # Speak expanded / collapsed / level for treeview items (in ARIA treegrids)
19191916 if role == controlTypes .ROLE_TREEVIEWITEM :
19201917 if controlTypes .STATE_EXPANDED in states :
0 commit comments