internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: nvaccess/nvda

Issue:
Gesture for temporary disable all configuration profile triggers
**Reported by leonarddr on 2015-02-20 12:47**
(Spun off ticket:4898#comment:17.)
This ticket deals with creating an unbound gesture for temporary disabling all configuration profile triggers. I have a text editing profile which reports several pieces of text information, which i'd like to disable at some times.



Discussion:

Resolving patch:
diff --git a/source/globalCommands.py b/source/globalCommands.py
--- a/source/globalCommands.py
+++ b/source/globalCommands.py
@@ -2034,6 +2034,24 @@ def script_activateConfigProfilesDialog(self, gesture):
 	script_activateConfigProfilesDialog.__doc__ = _("Shows the NVDA Configuration Profiles dialog")
 	script_activateConfigProfilesDialog.category=SCRCAT_CONFIG
 
+	def script_toggleConfigProfileTriggers(self,gesture):
+		if config.conf.profileTriggersEnabled:
+			config.conf.disableProfileTriggers()
+			# Translators: The message announced when temporarily disabling all configuration profile triggers.
+			state = _("Configuration profile triggers disabled")
+		else:
+			config.conf.enableProfileTriggers()
+			# Explicitly trigger profiles for the current application.
+			mod = api.getForegroundObject().appModule
+			trigger = mod._configProfileTrigger = appModuleHandler.AppProfileTrigger(mod.appName)
+			trigger.enter()
+			# Translators: The message announced when re-enabling all configuration profile triggers.
+			state = _("Configuration profile triggers enabled")
+		ui.message(state)
+	# Translators: Input help mode message for toggle configuration profile triggers command.
+	script_toggleConfigProfileTriggers.__doc__=_("Toggles disabling of all configuration profile triggers. Disabling remains in effect until NVDA is restarted")
+	script_toggleConfigProfileTriggers.category=SCRCAT_CONFIG
+
 	def script_interactWithMath(self, gesture):
 		import mathPres
 		mathMl = mathPres.getMathMlFromTextInfo(api.getReviewPosition())


Test patch:
Repository: nvaccess/nvda

Issue:
Excel: NVDA does not announce when ENTER is pressed to move to a new line
When adding data into an Excel spreadsheet, a convenient way of moving is by pressing TAB to move to the cell to the right, then ENTER to move to the next row, at the first column you pressed TAB from, announcing the new cell as it moves.

This works fine if you enter data into cells as you go.  If you press ENTER without having typed anything into the last cell, the focus moves as expected, however, NVDA does not announce anything.  If NVDA+TAB is pressed at this point, NVDA also does not read the correct cell (it reads the previous cell).

To replicate:
1. Open a blank workbook
2. Type something in A1
3. Press ENTER.  Note that NVDA reads that the focus has moved to A2.
3. Press ENTER again.  The focus has moved to A3 however NVDA does not read anything.
4. Press NVDA+tab.  NVDA reads A2.
5. Press TAB to move to the next column.  NVDA reads B3, confirming that the focus at step 4 was actually in A3.

Immediate workaround is to recommend to use arrows to navigate if not editing cell contents, however this situation could be confusing if someone pressed ENTER, particularly if they then press NVDA+TAB to confirm where the focus is.

Tested in both Excel 2007 and 2016.



Discussion:
P2 because this could be very confusing and because the fix is ridiculously easy.

As a side note, I didn't realise enter worked in this situation. I assumed enter was only valid when editing. Pressing enter to move to the next row when not entering seems counter-intuitive to me, but maybe it's just me. :)


Resolving patch:
diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -869,6 +869,8 @@ def script_changeSelection(self,gesture):
 	__changeSelectionGestures = (
 		"kb:tab",
 		"kb:shift+tab",
+		"kb:enter",
+		"kb:numpadEnter",
 		"kb:upArrow",
 		"kb:downArrow",
 		"kb:leftArrow",


Test patch:
Repository: nvaccess/nvda

Issue:
read-only not announced for checkboxes
Read only state is not announced for checkboxes with aria-readonly set. The latest [ARIA specifications](http://www.w3.org/TR/wai-aria-1.1/#aria-readonly) include checkbox as an aria-readonly compatible role. It is possible for sighted users to know the read-only state without interacting with the checkbox through different styling of "read-only" checkboxes. This is not possible for NVDA users.


Discussion:
I imagine this would be a fairly quick fix, and provides good value. I would be interested in some example of this in the wild? Any comment on how often this crops up?
Assigning this a priority 2, based on being quick to implement.


Resolving patch:
diff --git a/source/controlTypes.py b/source/controlTypes.py
--- a/source/controlTypes.py
+++ b/source/controlTypes.py
@@ -2,7 +2,7 @@
 #A part of NonVisual Desktop Access (NVDA)
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
-#Copyright (C) 2007-2014 NV Access Limited
+#Copyright (C) 2007-2016 NV Access Limited, Babbage B.V.
 
 ROLE_UNKNOWN=0
 ROLE_WINDOW=1
@@ -646,7 +646,7 @@ def processPositiveStates(role, states, reason, positiveStates):
 		positiveStates.discard(STATE_LINKED)
 		if role in (ROLE_LISTITEM, ROLE_TREEVIEWITEM, ROLE_MENUITEM, ROLE_TABLEROW) and STATE_SELECTABLE in states:
 			positiveStates.discard(STATE_SELECTED)
-	if role != ROLE_EDITABLETEXT:
+	if role not in (ROLE_EDITABLETEXT, ROLE_CHECKBOX):
 		positiveStates.discard(STATE_READONLY)
 	if role == ROLE_CHECKBOX:
 		positiveStates.discard(STATE_PRESSED)


Test patch:
Repository: nvaccess/nvda

Issue:
Speak typed characters and words in Excel in protected view (Excel 2016 at least)
When a spreadsheet is downloaded from the internet, Excel opens it in "Protected view" so that macros and other potentially malicious content cannot be run.  The workbook is also read only.

If you move to any cell in the workbook and type text, Excel ignores it - the original content of the cell is retained and visually, it never appears to go into edit mode (typed characters never appear anywhere).

With "speak typed characters" on, NVDA reads any characters typed twice.  With "speak typed words" on, NVDA, when spacebar is pressed, NVDA reads the word that was typed as individual letters.  For instance, type:

The

With speak typed characters on, NVDA reads:

T t h h e e

as you type.  When you press space, if speak typed characters is on, NVDA reads:

tthhee space space

With speak typed characters off, text is not read as you type it (but the "word" is still read if speak typed words is on).

The expected behaviour should be to alert the user in some manner that the text is not being typed (as a sighted user will see that the text is not being typed).




Discussion:

Resolving patch:
diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -8,6 +8,7 @@
 import comtypes.automation
 import wx
 import time
+import winsound
 import re
 import uuid
 import collections
@@ -1155,6 +1156,15 @@ def _get_states(self):
 			states.add(controlTypes.STATE_UNLOCKED)
 		return states
 
+	def event_typedCharacter(self,ch):
+		# #6570: You cannot type into protected cells.
+		# Apart from speaking characters being miss-leading, Office 2016 protected view doubles characters as well.
+		# Therefore for any character from space upwards (not control characters)  on protected cells, play the default sound rather than speaking the character
+		if ch>=" " and controlTypes.STATE_UNLOCKED not in self.states and controlTypes.STATE_PROTECTED in self.parent.states: 
+			winsound.PlaySound("Default",winsound.SND_ALIAS|winsound.SND_NOWAIT|winsound.SND_ASYNC)
+			return
+		super(ExcelCell,self).event_typedCharacter(ch)
+
 	def getCellWidthAndTextWidth(self):
 		#handle to Device Context
 		hDC = ctypes.windll.user32.GetDC(self.windowHandle)


Test patch:
Repository: nvaccess/nvda

Issue:
MS Edge: support quicknav to buttons
In Edge, quicknav of b / shift+b should move to buttons. 
If this is implemented similarly to other form controls, currently this may locate buttons in composite controls where the button itself is not represented in the text pattern. For example, file upload, or audio and video tags. These particular issues have been reported to Microsoft (MS bug 8370271, and MS bug 4379303).

This should be implemented as normal, with the expectation that the above Microsoft bugs are addressed.
P2 as this does annoy some people.


Discussion:
Note that with out the MS bugs being fixed, this will still work in the majority of cases (I.e. moving to a submit button etc).

Resolving patch:
diff --git a/source/UIABrowseMode.py b/source/UIABrowseMode.py
--- a/source/UIABrowseMode.py
+++ b/source/UIABrowseMode.py
@@ -256,6 +256,9 @@ def _iterNodesByType(self,nodeType,direction="next",pos=None):
 		elif nodeType=="link":
 			condition=UIAHandler.handler.clientObject.createPropertyCondition(UIAHandler.UIA_ControlTypePropertyId,UIAHandler.UIA_HyperlinkControlTypeId)
 			return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)
+		elif nodeType=="button":
+			condition=UIAHandler.handler.clientObject.createPropertyCondition(UIAHandler.UIA_ControlTypePropertyId,UIAHandler.UIA_ButtonControlTypeId)
+			return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)
 		elif nodeType=="checkBox":
 			condition=UIAHandler.handler.clientObject.createPropertyCondition(UIAHandler.UIA_ControlTypePropertyId,UIAHandler.UIA_CheckBoxControlTypeId)
 			return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)


Test patch:
Repository: nvaccess/nvda

Issue:
MS Edge: support find in browse mode
Find (NVDA+control+f) etc must be supported in browse mode for Microsoft Edge.

To do this, UIATextInfo::find must be implemented making use of IUIAutomationTextRange::findText.

Once implemented, this will expose a bug in Microsoft Edge where findText matches on hidden text (such as display:none) that is not exposed via the UIAutomation text pattern. This has been reported as MS bug 9888158.
P2 as this feature is pretty standard for browse mode.  


Discussion:

Resolving patch:
diff --git a/source/NVDAObjects/UIA/__init__.py b/source/NVDAObjects/UIA/__init__.py
--- a/source/NVDAObjects/UIA/__init__.py
+++ b/source/NVDAObjects/UIA/__init__.py
@@ -34,6 +34,25 @@ class UIATextInfo(textInfos.TextInfo):
 		UIAHandler.TextUnit_Character
 	] if UIAHandler.isUIAAvailable else []
 
+	def find(self,text,caseSensitive=False,reverse=False):
+		tempRange=self._rangeObj.clone()
+		documentRange=self.obj.UIATextPattern.documentRange
+		if reverse:
+			tempRange.MoveEndpointByRange(UIAHandler.TextPatternRangeEndpoint_Start,documentRange,UIAHandler.TextPatternRangeEndpoint_Start)
+		else:
+			if tempRange.move(UIAHandler.TextUnit_Character,1)==0:
+				return False
+			tempRange.MoveEndpointByRange(UIAHandler.TextPatternRangeEndpoint_End,documentRange,UIAHandler.TextPatternRangeEndpoint_End)
+		try:
+			r=tempRange.findText(text,reverse,not caseSensitive)
+		except COMError:
+			r=None
+		if r:
+			r.MoveEndpointByRange(UIAHandler.TextPatternRangeEndpoint_End,r,UIAHandler.TextPatternRangeEndpoint_Start)
+			self._rangeObj=r
+			return True
+		return False
+
 	def _getFormatFieldAtRange(self,range,formatConfig,ignoreMixedValues=False):
 		"""
 		Fetches formatting for the given UI Automation Text range.


Test patch:
Repository: nvaccess/nvda

Issue:
Excel: row/column headers should be remembered when copying sheets
Currently if row/column headers are set by NVDA on an Excel sheet, and that sheet is copied within the same workbook, NVDA does not detect the set row and column headers on the new copy. This is because NVDA stores defined names globally on the workbook, rather than per sheet. 


Discussion:

Resolving patch:
diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -670,7 +670,24 @@ def _get_excelApplicationObject(self):
 		self.excelApplicationObject=self.excelWorksheetObject.application
 		return self.excelApplicationObject
 
-	re_definedName=re.compile(ur'^((?P<sheet>\w+)!)?(?P<name>\w+)(\.(?P<minAddress>[a-zA-Z]+[0-9]+)?(\.(?P<maxAddress>[a-zA-Z]+[0-9]+)?(\..*)*)?)?$')
+	re_definedName=re.compile(
+		# Starts with an optional sheet name followed by an exclamation mark (!).
+		# If a sheet name contains spaces then it is surrounded by single quotes (')
+		# Examples:
+		# Sheet1!
+		# ''Sheet2 (4)'!
+		# 'profit and loss'!
+		u'^((?P<sheet>(\'[^\']+\'|[^!]+))!)?'
+		# followed by a unique name (not containing spaces). Example:
+		# rowtitle_ab12-cd34-de45
+		u'(?P<name>\w+)'
+		# Optionally followed by minimum and maximum addresses, starting with a period (.). Example:
+		# .a1.c3
+		# .ab34
+		u'(\.(?P<minAddress>[a-zA-Z]+[0-9]+)?(\.(?P<maxAddress>[a-zA-Z]+[0-9]+)?'
+		# Optionally followed by a period (.) and extra random data (sometimes produced by other screen readers)
+		u'(\..*)*)?)?$'
+	)
 
 	def populateHeaderCellTrackerFromNames(self,headerCellTracker):
 		sheetName=self.excelWorksheetObject.name
@@ -680,6 +697,8 @@ def populateHeaderCellTrackerFromNames(self,headerCellTracker):
 			if not nameMatch:
 				continue
 			sheet=nameMatch.group('sheet')
+			if sheet and sheet[0]=="'" and sheet[-1]=="'":
+				sheet=sheet[1:-1]
 			if sheet and sheet!=sheetName:
 				continue
 			name=nameMatch.group('name').lower()
@@ -748,13 +767,15 @@ def setAsHeaderCell(self,cell,isColumnHeader=False,isRowHeader=False):
 		else:
 			raise ValueError("One or both of isColumnHeader or isRowHeader must be True")
 		name+=uuid.uuid4().hex
+		relativeName=name
+		name="%s!%s"%(cell.excelRangeObject.worksheet.name,name)
 		if oldInfo:
 			self.excelWorksheetObject.parent.names(oldInfo.name).delete()
 			oldInfo.name=name
 		else:
 			maxColumnNumber=self._getMaxColumnNumberForHeaderCell(cell.excelCellObject)
 			self.headerCellTracker.addHeaderCellInfo(rowNumber=cell.rowNumber,columnNumber=cell.columnNumber,rowSpan=cell.rowSpan,colSpan=cell.colSpan,maxColumnNumber=maxColumnNumber,name=name,isColumnHeader=isColumnHeader,isRowHeader=isRowHeader)
-		self.excelWorksheetObject.parent.names.add(name,cell.excelRangeObject)
+		self.excelWorksheetObject.names.add(relativeName,cell.excelRangeObject)
 		return True
 
 	def _getMaxColumnNumberForHeaderCell(self,excelCell):


Test patch:
Repository: nvaccess/nvda

Issue:
Manual update check doesn't always respect progress bar output config
gui.IndeterminateProgressDialog.done() doesn't check the configured output method for progress bars.
Also slight ugliness in the hard-coded frequencies and lengths of the beeps. Maybe add functions beepIndeterminate() and beepDone() to the tones module?


Discussion:
Would you expect this to say "done"? Note that this often might not be
heard due to the foreground window change that often accompanies a
completed action. Still, at least you wouldn't hear the beep.

The length of the beep is also hard-coded in
NVDAObjects.behaviors.ProgressBar. I guess we could put a constant in tones
for the progress bar beep length, but this feels weird, since tones is an
output module and arguably shouldn't have any behaviour specific code.
@feerrenrut, thoughts?

> Would you expect this to say "done"?

No, but neither do I expect it to beep when I have disabled that feature. In that case it would be a simple check, either beep or just return.
Arguably the "done" beep doesn't provide much information because the dialog is likely to change at that time anyway.
I'm not familiar enough with all the ways that the tones module is used to be sure we are able to generalise. I can agree that the tones module isn't the place for those constants.

There are a few similarities in how `beep` is used in progress bars and in the mouse tracking code. In both cases there the beeps are indicating a value along an axis (or two). Perhaps we could abstract that pattern and generalise it, creating an in-between module/class that allows code like `beepPosition(minValue, maxValue, actualValue)` or similar. It could take the min and max frequency as well as the length as parameters on construction. Those values can either be constants in the class (in the case of `IndeterminateProgressBar`), or come from config (in the case of mouse tracking).
In terms of prioritising this issue, while it does not look like it would take long to fix the impact is fairly low. Setting to P3
So let's leave adding constants or otherwise refactoring the beeps out of this issue for now. It looks like it needs more thought.
But do we agree that the "done" state should not cause a beep if the output method is set to Speech or None? I can create a PR for this, it seems rather simple.
Agree that done shouldn't beep if output should be speech only. However,
please leave the beep as is when output is beeps or both.


Resolving patch:
diff --git a/source/gui/__init__.py b/source/gui/__init__.py
--- a/source/gui/__init__.py
+++ b/source/gui/__init__.py
@@ -829,7 +829,8 @@ def IsActive(self):
 
 	def done(self):
 		self.timer.Stop()
-		if self.IsActive():
+		pbConf = config.conf["presentation"]["progressBarUpdates"]
+		if pbConf["progressBarOutputMode"] in ("beep", "both") and (pbConf["reportBackgroundProgressBars"] or self.IsActive()):
 			tones.beep(1760, 40)
 		self.Hide()
 		self.Destroy()


Test patch:
Repository: nvaccess/nvda

Issue:
Certain bullets not reported in Microsoft Word
**Reported by csm120 on 2015-08-05 09:05**
I have tried this in NVDA 2015.2 and in the latest snapshots.
Steps to reproduce:
1. In Microsoft Word 2010 through 2016 open a blank document
2. Press the star key (Shift 8 on numbers row) then type a line of text and press enter.
3. Type another line and press enter twice.
4. You should now have a bulleted list with 2 items.
5. Arrow through the list and on my end NVDA won't indicate that bullets are there.
6. Do the same steps above but instead of typing a star, type 1. As you type lines of text word automatically puts numbers pressing enter twice stops the auto-numbered list. Again NVDA doesn't indicate numbers here.



Discussion:

Resolving patch:
diff --git a/source/NVDAObjects/window/winword.py b/source/NVDAObjects/window/winword.py
--- a/source/NVDAObjects/window/winword.py
+++ b/source/NVDAObjects/window/winword.py
@@ -324,6 +324,21 @@
 }
 formatConfigFlag_includeLayoutTables=0x20000
 
+# Map some characters from PUA to Unicode. Meant to be used with bullets only.
+# Doesn't care about the actual font, so can give incorrect Unicode in rare cases.
+mapPUAToUnicode = {
+	# from : to # fontname
+	u'\uF06E' : u'\u25A0', # Wingdings
+	u'\uF076' : u'\u2756', # Wingdings
+	u'\uF0A7' : u'\u2663', # Symbol
+	u'\uF0A8' : u'\u2666', # Symbol
+	u'\uF0B7' : u'\u2022', # Symbol
+	u'\uF0D8' : u'\u27A2', # Wingdings
+	u'\uF0E8' : u'\u21D2', # Wingdings
+	u'\uF0F0' : u'\u21E8', # Wingdings
+	u'\uF0FC' : u'\u2714', # Wingdings
+}
+
 class WordDocumentHeadingQuickNavItem(browseMode.TextInfoQuickNavItem):
 
 	def __init__(self,nodeType,document,textInfo,level):
@@ -791,6 +806,9 @@ def _normalizeFormatField(self,field,extraDetail=False):
 			else:
 				v=self.obj.getLocalizedMeasurementTextForPointSize(v)
 			field[x]=v
+		bullet=field.get('line-prefix')
+		if bullet and len(bullet)==1:
+			field['line-prefix']=mapPUAToUnicode.get(bullet,bullet)
 		return field
 
 	def expand(self,unit):


Test patch:
Repository: nvaccess/nvda

Issue:
Error durring update check
Hi,

When I try to check for update, I have the following error in the log:
ERROR - stderr (11:18:59):
Exception in thread Thread-103:
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "updateCheck.pyc", line 126, in _bg
  File "updateCheck.pyc", line 173, in setNextCheck
  File "wx_misc.pyc", line 1324, in Start
PyAssertionError: C++ assertion "wxThread::IsMain()" failed at ....\src\common\timerimpl.cpp(60) in wxTimerImpl::Start(): timer can only be started from the main thread

I use NVDA version next-13392,621e5393
I might be caused by the recent changes on WX.

Thanks.



Discussion:
I can confirm this.

I can also confirm this.

Due to no longer suppressing wx assertions.

In the long-term we need to fix the code actually causing the 
assertions, but for now we'll try and come up with a better way of 
logging them that does not stop any code from running.

On 7/07/2016 10:25 PM, Elshara Silverheart wrote:

> I can also confirm this.
> 
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub 
> https://github.com/nvaccess/nvda/issues/6152#issuecomment-231062782, 
> or mute the thread 
> https://github.com/notifications/unsubscribe/ANf5nRF9w1ya5ZXg2i8ZKJBIgBl-ZaLYks5qTPA2gaJpZM4JG6Sb.

## 

Michael Curran
Executive Director, NV Access Limited
Phone: +61 7 3149 3306
Website: http://www.nvaccess.org/
Twitter: @NVAccess
Facebook: http://www.facebook.com/NVAccess


Resolving patch:
diff --git a/source/updateCheck.py b/source/updateCheck.py
--- a/source/updateCheck.py
+++ b/source/updateCheck.py
@@ -2,7 +2,7 @@
 #A part of NonVisual Desktop Access (NVDA)
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
-#Copyright (C) 2012-2015 NV Access Limited
+#Copyright (C) 2012-2016 NV Access Limited
 
 """Update checking functionality.
 @note: This module may raise C{RuntimeError} on import if update checking for this build is not supported.
@@ -170,8 +170,9 @@ def terminate(self):
 		self._checkTimer = None
 
 	def setNextCheck(self, isRetry=False):
-		self._checkTimer.Stop()
-		self._checkTimer.Start((RETRY_INTERVAL if isRetry else CHECK_INTERVAL) * 1000, True)
+		# #6127: Timers must be manipulated from the main thread.
+		wx.CallAfter(self._checkTimer.Stop)
+		wx.CallAfter(self._checkTimer.Start, (RETRY_INTERVAL if isRetry else CHECK_INTERVAL) * 1000, True)
 
 	def _started(self):
 		log.info("Performing automatic update check")
@@ -292,7 +293,8 @@ def _guiExec(self, func, *args):
 		self._guiExecFunc = func
 		self._guiExecArgs = args
 		if not self._guiExecTimer.IsRunning():
-			self._guiExecTimer.Start(50, True)
+			# #6127: Timers must be manipulated from the main thread.
+			wx.CallAfter(self._guiExecTimer.Start, 50, True)
 
 	def _guiExecNotify(self):
 		self._guiExecFunc(*self._guiExecArgs)


Test patch: