@@ -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 )
0 commit comments