Repository: nvaccess/nvda

Issue:
LibreOffice Write: nothing spoken when reviewing a document using up and down arrows
<!--
Please thoroughly read NVDA's wiki article on how to fill in this template, including how to provide the required files.
Issues may be closed if the required information is not present.
https://github.com/nvaccess/nvda/wiki/Github-issue-template-explanation-and-examples
-->
Using NVDA alpha-19266,67bf1df6, nothing is spoken when scrolling a document under libreOffice Writer 6.3.3. 
### Steps to reproduce:
1. Open a document using libreOffice writer.
2. Try to scroll it using the up and down arrows.
### Actual behavior:
The document content is not spoken, though it is correctly displayed if you have a braille display.
### Expected behavior:
The content of each line should be spoken when arrowing on it. Used to work with NVDA 2019.2.1.
### System configuration
#### NVDA installed/portable/running from source:
NVDA installed
#### NVDA version:
alpha-19266,67bf1df6
#### Windows version:
Windows 10Ver1909 (64-bit) build 18363.476
#### Name and version of other software in use when reproducing the issue:
LibreOffice 6.3.3 64 bits
#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your PC?

#### Have you tried any other versions of NVDA? If so, please report their behaviors.



Discussion:
This should be marked as a regression. cc @leonardder  @michaelDCurran 
@MichelSuch: Please fully follow the issue template, especially the last few questions are important here.
The most important question i.e. 
> Have you tried any other versions of NVDA? If so, please report their behaviors.

has been answered but not in the proper place in the template.
@MichelSuch said:
> Used to work with NVDA 2019.2.1.


Thanks for pointing this out.

This definitely is a regression, caused by 4d1d4f640 (#10463).

I'm afraid the only thing we can do now is revert this and look at another solution for #4317. Alternative ideas @lukaszgo1?

Resolving patch:
diff --git a/source/NVDAObjects/behaviors.py b/source/NVDAObjects/behaviors.py
--- a/source/NVDAObjects/behaviors.py
+++ b/source/NVDAObjects/behaviors.py
@@ -169,6 +169,11 @@ def initOverlayClass(self):
 			self.bindGesture("kb:enter","caret_newLine")
 			self.bindGesture("kb:numpadEnter","caret_newLine")
 
+	def _caretScriptPostMovedHelper(self, speakUnit, gesture, info=None):
+		if eventHandler.isPendingEvents("gainFocus"):
+			return
+		super()._caretScriptPostMovedHelper(speakUnit, gesture, info)
+
 class EditableTextWithAutoSelectDetection(EditableText):
 	"""In addition to L{EditableText}, handles reporting of selection changes for objects which notify of them.
 	To have selection changes reported, the object must notify of selection changes via the caret event.
diff --git a/source/editableText.py b/source/editableText.py
--- a/source/editableText.py
+++ b/source/editableText.py
@@ -135,7 +135,7 @@ def _hasCaretMoved(self, bookmark, retryInterval=0.01, timeout=None, origWord=No
 		return (False,newInfo)
 
 	def _caretScriptPostMovedHelper(self, speakUnit, gesture, info=None):
-		if isScriptWaiting() or eventHandler.isPendingEvents("gainFocus"):
+		if isScriptWaiting():
 			return
 		if not info:
 			try:


Test patch: