Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast vertical QuickNav in Gecko-based textInfos #16385

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/browseMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ def iterFactory(direction: str, pos: textInfos.TextInfo) -> Generator[TextInfoQu
elif itemType == "verticalParagraph":
def paragraphFunc(info: textInfos.TextInfo) -> int | None:
try:
return info.NVDAObjectAtStart.location[0]
except AttributeError:
return info.location[0]
except (AttributeError, TypeError):
return None

def iterFactory(direction: str, pos: textInfos.TextInfo) -> Generator[TextInfoQuickNavItem, None, None]:
Expand Down
4 changes: 2 additions & 2 deletions source/textInfos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,8 @@ def moveToCodepointOffset(
info.setEndPoint(tmpInfo, which="endToEnd")
raise RuntimeError("Infinite loop during binary search.")



def _get_location(self) -> locationHelper.RectLTWH:
return self.NVDAObjectAtStart.location


RE_EOL = re.compile("\r\n|[\n\r]")
Expand Down
7 changes: 7 additions & 0 deletions source/virtualBuffers/gecko_ia2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import config
from NVDAObjects.IAccessible import normalizeIA2TextFormatField, IA2TextTextInfo
import documentBase
import locationHelper


def _getNormalizedCurrentAttrs(attrs: textInfos.ControlField) -> typing.Dict[str, typing.Any]:
Expand Down Expand Up @@ -253,6 +254,12 @@ def _normalizeFormatField(self, attrs):
attrs[name] = int(val)
return super(Gecko_ia2_TextInfo,self)._normalizeFormatField(attrs)

def _get_location(self) -> locationHelper.RectLTWH:
document = self.obj.rootNVDAObject.IAccessibleObject
docHandle, ID = self._getFieldIdentifierFromOffset(self._startOffset)
location = document.accLocation(ID)
return locationHelper.RectLTWH(*location)


seanbudd marked this conversation as resolved.
Show resolved Hide resolved
class Gecko_ia2(VirtualBuffer):

Expand Down