Skip to content

Commit 2b3e13e

Browse files
authored
Merge 6d4c16e into 5e9c47f
2 parents 5e9c47f + 6d4c16e commit 2b3e13e

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

source/NVDAObjects/JAB/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2006-2023 NV Access Limited, Leonard de Ruijter, Joseph Lee, Renaud Paquay, pvagner
2+
# Copyright (C) 2006-2025 NV Access Limited, Leonard de Ruijter, Joseph Lee, Renaud Paquay, pvagner, hwf1324
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
55

66
import ctypes
77
import re
88
from typing import (
9-
Dict,
109
Any,
1110
)
1211
import eventHandler
@@ -22,7 +21,7 @@
2221
from logHandler import log
2322
from locationHelper import RectLTWH
2423

25-
JABRolesToNVDARoles: Dict[str, controlTypes.Role] = {
24+
JABRolesToNVDARoles: dict[str, controlTypes.Role] = {
2625
"alert": controlTypes.Role.DIALOG,
2726
"column header": controlTypes.Role.TABLECOLUMNHEADER,
2827
"canvas": controlTypes.Role.CANVAS,
@@ -127,6 +126,8 @@ def _processHtml(text: str) -> str:
127126

128127

129128
class JABTextInfo(textInfos.offsets.OffsetsTextInfo):
129+
obj: "JAB"
130+
130131
def _getOffsetFromPoint(self, x: int, y: int) -> int:
131132
info = self.obj.jabContext.getAccessibleTextInfo(x, y)
132133
offset = max(min(info.indexAtPoint, info.charCount - 1), 0)
@@ -171,6 +172,9 @@ def _getStoryLength(self) -> int:
171172
self._storyLength = textInfo.charCount
172173
return self._storyLength
173174

175+
def _getStoryText(self) -> str:
176+
return self._getTextRange(0, self._getStoryLength())
177+
174178
def _getTextRange(self, start: int, end: int) -> str:
175179
# Java needs end of range as last character, not one past the last character
176180
text = self.obj.jabContext.getAccessibleTextRange(start, end - 1)
@@ -191,7 +195,7 @@ def _getLineOffsets(self, offset: int) -> tuple[int, int]:
191195
return (start, end)
192196

193197
def _getParagraphOffsets(self, offset: int) -> tuple[int, int]:
194-
return self._getLineOffsets(offset)
198+
return super()._getLineOffsets(offset)
195199

196200
def _getFormatFieldAndOffsets(self, offset: int, formatConfig, calculateOffsets=True):
197201
attribs: JABHandler.AccessibleTextAttributesInfo

user_docs/en/changes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
### Bug Fixes
1212

13+
* Fixed support for paragraph mouse text unit in Java applications. (#18231, @hwf1324)
14+
1315
### Changes for Developers
1416

1517
Please refer to [the developer guide](https://download.nvaccess.org/documentation/developerGuide.html#API) for information on NVDA's API deprecation and removal process.

0 commit comments

Comments
 (0)