From 33c915e3d3abc0e8301300a505da028c763043cc Mon Sep 17 00:00:00 2001 From: Julien Cochuyt Date: Thu, 23 Jul 2020 10:04:46 +0200 Subject: [PATCH 1/2] Speech Dictionary - UI - Regex: Early detect grouping errors (#11407) --- source/gui/settingsDialogs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py index b664825d5f6..d5256a67f09 100644 --- a/source/gui/settingsDialogs.py +++ b/source/gui/settingsDialogs.py @@ -2664,7 +2664,14 @@ def onOk(self,evt): self.patternTextCtrl.SetFocus() return try: - self.dictEntry=speechDictHandler.SpeechDictEntry(self.patternTextCtrl.GetValue(),self.replacementTextCtrl.GetValue(),self.commentTextCtrl.GetValue(),bool(self.caseSensitiveCheckBox.GetValue()),self.getType()) + dictEntry = self.dictEntry = speechDictHandler.SpeechDictEntry( + self.patternTextCtrl.GetValue(), + self.replacementTextCtrl.GetValue(), + self.commentTextCtrl.GetValue(), + bool(self.caseSensitiveCheckBox.GetValue()), + self.getType() + ) + dictEntry.sub("test") # Ensure there are no grouping error (#11407) except Exception as e: log.debugWarning("Could not add dictionary entry due to (regex error) : %s" % e) # Translators: This is an error message to let the user know that the dictionary entry is not valid. From db5f30bda772aecda99e2ca3274092ee9f6f9c28 Mon Sep 17 00:00:00 2001 From: Reef Turner Date: Fri, 18 Sep 2020 17:13:40 +0200 Subject: [PATCH 2/2] update changes file for PR #11409 --- user_docs/en/changes.t2t | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 991745f20cf..b145698df1b 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -9,6 +9,8 @@ What's New in NVDA - Pressing F1 inside NVDA dialogs will now open the help file to most relevant section. (#7757) - Support for auto complete suggestions (IntelliSense) in Microsoft SQL Server Management Studio plus Visual Studio 2017 and higher. (#7504) - Symbol pronunciation: Support for grouping in a complex symbol definition and support group references in a replacement rule making them simpler and more powerful. (#11107) +- Users are now notified when attempting to create Speech Dictionary entries with invalid regular expression substitutions. (#11407) + - Specifically grouping errors are now detected. == Changes ==