Repository: nvaccess/nvda

Issue:
NVDA Chinese input error

[nvda.log](https://github.com/nvaccess/nvda/files/3303956/nvda.log)
<!--
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.
[nvda.log](https://github.com/nvaccess/nvda/files/3303945/nvda.log)
https://github.com/nvaccess/nvda/wiki/Github-issue-template-explanation-and-examples
-->
In NVDA version 17633, NVDA warns when typing Chinese in edit blanks of files renaming of windows Explorer. 
### Steps to reproduce:
1. Start NVDA. 
2. Install Chinese input status for windows 10. 
3. Select any file in Windows Explorer(Including desktop items). 
4. Press F2 or open application menu to activate renaming action. 
5. Switch to Chinese input status. 
6. Type with a keyboard. 

### Actual behavior:
Error warning and reporting nothing. 

### Expected behavior:
Reporting typed characters.

### System configuration
#### NVDA installed/portable/running from source:
Both in Installed version and portable version

#### NVDA version:
1. NVDA 2019.2 beta 1, 
2. NVDA Beta 17522, 
3. NVDA Beta 17633. 

#### Windows version:
Windows 10Ver1903 (64Bit) build 18362.175

#### Name and version of other software in use when reproducing the issue:
Windows explorer

#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your PC?
Yes

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
This error begins with nvda Alpha-16953, So, It is speculated that the occurrence of this error may be related to [PR 8643](https://github.com/nvaccess/nvda/pull/8643).


Discussion:
cc @josephsl and
@leonardder 
It seems Japanese IME is related as well.

Resolving patch:
diff --git a/source/appModules/dllhost.py b/source/appModules/dllhost.py
--- a/source/appModules/dllhost.py
+++ b/source/appModules/dllhost.py
@@ -1,6 +1,6 @@
 # -*- coding: UTF-8 -*-
 # A part of NonVisual Desktop Access (NVDA)
-# Copyright (C) 2018 NV Access Limited, Łukasz Golonka
+# Copyright (C) 2018-2019 NV Access Limited, Łukasz Golonka
 # This file may be used under the terms of the GNU General Public License, version 2 or later.
 # For more details see: https://www.gnu.org/licenses/gpl-2.0.html
 
@@ -16,5 +16,5 @@ class AppModule(appModuleHandler.AppModule):
 
 	def chooseNVDAObjectOverlayClasses(self, obj, clsList):
 		windowClass = obj.windowClassName
-		if windowClass == "Edit":
+		if windowClass == "Edit" and controlTypes.STATE_READONLY in obj.states:
 			clsList.insert(0, ReadOnlyEditBox)
diff --git a/source/appModules/explorer.py b/source/appModules/explorer.py
--- a/source/appModules/explorer.py
+++ b/source/appModules/explorer.py
@@ -1,6 +1,7 @@
+# -*- coding: UTF-8 -*-
 #appModules/explorer.py
 #A part of NonVisual Desktop Access (NVDA)
-#Copyright (C) 2006-2018 NV Access Limited, Joseph Lee
+#Copyright (C) 2006-2019 NV Access Limited, Joseph Lee, Łukasz Golonka
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
 
@@ -184,7 +185,7 @@ class ReadOnlyEditBox(IAccessible):
 
 	def _get_windowText(self):
 		windowText = super(ReadOnlyEditBox, self).windowText
-		if windowText is not None and controlTypes.STATE_READONLY in self.states:
+		if windowText is not None:
 			return windowText.replace(CHAR_LTR_MARK,'').replace(CHAR_RTL_MARK,'')
 		return windowText
 
@@ -219,7 +220,7 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
 					clsList.insert(0, NotificationArea)
 			return 
 
-		if windowClass == "Edit":
+		if windowClass == "Edit" and controlTypes.STATE_READONLY in obj.states:
 			clsList.insert(0, ReadOnlyEditBox)
 			return # Optimization: return early to avoid comparing class names and roles that will never match.
 


Test patch: