Skip to content

Commit c545bb5

Browse files
authored
Merge 5341d7e into e06f2b8
2 parents e06f2b8 + 5341d7e commit c545bb5

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

source/JABHandler.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def getAccessibleTextSelectionInfo(self):
647647
bridgeDll.getAccessibleTextSelectionInfo(self.vmID, self.accContext, byref(textSelectionInfo))
648648
return textSelectionInfo
649649

650-
def getAccessibleTextRange(self, start, end):
650+
def _javaGetAccessibleTextRange(self, start, end):
651651
length = (end + 1) - start
652652
if length <= 0:
653653
return ""
@@ -656,6 +656,24 @@ def getAccessibleTextRange(self, start, end):
656656
bridgeDll.getAccessibleTextRange(self.vmID, self.accContext, start, end, buf, length)
657657
return textUtils.getTextFromRawBytes(buf.raw, numChars=length, encoding=textUtils.WCHAR_ENCODING)
658658

659+
# Constant gotten from AccessBridgePackages.h,
660+
# minus one to accommodate the null character
661+
MAX_BUFFER_SIZE = 10239
662+
663+
def getAccessibleTextRange(self, start, end):
664+
length = (end + 1) - start
665+
if length <= 0:
666+
return ""
667+
668+
text = []
669+
while start <= end:
670+
bufferSize = min(self.MAX_BUFFER_SIZE, length)
671+
text.append(self._javaGetAccessibleTextRange(start, start + bufferSize - 1))
672+
start += bufferSize
673+
length = (end + 1) - start
674+
675+
return "".join(text)
676+
659677
def getAccessibleTextLineBounds(self, index):
660678
index = max(index, 0)
661679
log.debug("lineBounds: index %s" % index)

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Prefix matching on command line flags, e.g. using `--di` for `--disable-addons`
5353

5454
### Bug Fixes
5555

56+
* NVDA will no longer crash when selecting whole text in specific source files in Android Studio or IntelliJ Idea. (#17418, @thgcode)
5657
* Math reading has been fixed for some web elements.
5758
Specifically, MathML inside of span and other elements that have the attribute `role="math"`. (#15058)
5859
* Native support for the Dot Pad tactile graphics device from Dot Inc as a multiline braille display. (#17007)

0 commit comments

Comments
 (0)