@@ -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.
@@ -1606,15 +1606,12 @@ def getPropertiesSpeech( # noqa: C901
16061606 if rowCount or columnCount :
16071607 # The caller is entering a table, so ensure that it is treated as a new table, even if the previous table was the same.
16081608 oldTableID = None
1609- ariaCurrent = propertyValues .get ('current' , False )
1610- if ariaCurrent :
1611- try :
1612- ariaCurrentLabel = controlTypes .isCurrentLabels [ariaCurrent ]
1613- textList .append (ariaCurrentLabel )
1614- except KeyError :
1615- log .debugWarning ("Aria-current value not handled: %s" % ariaCurrent )
1616- ariaCurrentLabel = controlTypes .isCurrentLabels [True ]
1617- textList .append (ariaCurrentLabel )
1609+
1610+ # speak isCurrent property EG aria-current
1611+ isCurrent = propertyValues .get ('current' , controlTypes .IsCurrent .NO )
1612+ if isCurrent != controlTypes .IsCurrent .NO :
1613+ textList .append (isCurrent .displayString )
1614+
16181615 placeholder : Optional [str ] = propertyValues .get ('placeholder' , None )
16191616 if placeholder :
16201617 textList .append (placeholder )
@@ -1677,7 +1674,7 @@ def getControlFieldSpeech( # noqa: C901
16771674 name = ""
16781675 states = attrs .get ('states' ,set ())
16791676 keyboardShortcut = attrs .get ('keyboardShortcut' , "" )
1680- ariaCurrent = attrs .get ('current' , None )
1677+ isCurrent = attrs .get ('current' , controlTypes . IsCurrent . NO )
16811678 placeholderValue = attrs .get ('placeholder' , None )
16821679 value = attrs .get ('value' ,"" )
16831680 if reason == controlTypes .REASON_FOCUS or attrs .get ('alwaysReportDescription' ,False ):
@@ -1707,7 +1704,7 @@ def getControlFieldSpeech( # noqa: C901
17071704 keyboardShortcutSequence = getPropertiesSpeech (
17081705 reason = reason , keyboardShortcut = keyboardShortcut
17091706 )
1710- ariaCurrentSequence = getPropertiesSpeech (reason = reason , current = ariaCurrent )
1707+ isCurrentSequence = getPropertiesSpeech (reason = reason , current = isCurrent )
17111708 placeholderSequence = getPropertiesSpeech (reason = reason , placeholder = placeholderValue )
17121709 nameSequence = getPropertiesSpeech (reason = reason , name = name )
17131710 valueSequence = getPropertiesSpeech (reason = reason , value = value )
@@ -1824,7 +1821,7 @@ def getControlFieldSpeech( # noqa: C901
18241821 getProps ['columnHeaderText' ] = attrs .get ("table-columnheadertext" )
18251822 tableCellSequence = getPropertiesSpeech (_tableID = tableID , ** getProps )
18261823 tableCellSequence .extend (stateTextSequence )
1827- tableCellSequence .extend (ariaCurrentSequence )
1824+ tableCellSequence .extend (isCurrentSequence )
18281825 types .logBadSequenceTypes (tableCellSequence )
18291826 return tableCellSequence
18301827
@@ -1873,7 +1870,7 @@ def getControlFieldSpeech( # noqa: C901
18731870 out .extend (stateTextSequence if speakStatesFirst else roleTextSequence )
18741871 out .extend (roleTextSequence if speakStatesFirst else stateTextSequence )
18751872 out .append (containerContainsText )
1876- out .extend (ariaCurrentSequence )
1873+ out .extend (isCurrentSequence )
18771874 out .extend (valueSequence )
18781875 out .extend (descriptionSequence )
18791876 out .extend (levelSequence )
@@ -1908,8 +1905,8 @@ def getControlFieldSpeech( # noqa: C901
19081905 # Special cases
19091906 elif not speakEntry and fieldType in ("start_addedToControlFieldStack" ,"start_relative" ):
19101907 out = []
1911- if ariaCurrent :
1912- out .extend (ariaCurrentSequence )
1908+ if isCurrent != controlTypes . IsCurrent . NO :
1909+ out .extend (isCurrentSequence )
19131910 # Speak expanded / collapsed / level for treeview items (in ARIA treegrids)
19141911 if role == controlTypes .ROLE_TREEVIEWITEM :
19151912 if controlTypes .STATE_EXPANDED in states :
0 commit comments