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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile liblouis with 32 bit widechars #9544

Merged
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
6 changes: 3 additions & 3 deletions nvdaHelper/liblouis/sconscript
@@ -1,7 +1,7 @@
###
#This file is a part of the NVDA project.
#URL: https://www.nvaccess.org/
#Copyright 2011-2017 NV Access Limited, Joseph Lee
#Copyright 2011-2018 NV Access Limited, Joseph Lee, Babbage B.V.
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License version 2.0, as published by
#the Free Software Foundation.
Expand Down Expand Up @@ -54,7 +54,7 @@ env.Append(CPPDEFINES=[
# variants that start with an '_'. This removes those deprecation warnings. */
"_CRT_NONSTDC_NO_DEPRECATE",
("PACKAGE_VERSION", r'\"%s\"' % getLouisVersion()),
("UNICODE_BITS", 16),
"WIDECHARS_ARE_UCS4",
# Tell liblouis.h that we're exporting liblouis dll functions, not importing them.
"_EXPORTING",
])
Expand All @@ -64,7 +64,7 @@ env.Prepend(CPPPATH=[".", louisSourceDir])
env['CPPDEFINES'].remove("UNICODE")

liblouisH = env.Substfile("liblouis.h", louisSourceDir.File("liblouis.h.in"),
SUBST_DICT={"@WIDECHAR_TYPE@": "unsigned short int"})
SUBST_DICT={"@WIDECHAR_TYPE@": "unsigned int"})

sourceFiles = [
"compileTranslationTable.c",
Expand Down
8 changes: 7 additions & 1 deletion source/NVDAObjects/IAccessible/__init__.py
Expand Up @@ -14,6 +14,7 @@
import tones
import languageHandler
import textInfos.offsets
from textInfos.offsets import HIGH_SURROGATE_FIRST, HIGH_SURROGATE_LAST, LOW_SURROGATE_FIRST, LOW_SURROGATE_LAST
import colors
import time
import displayModel
Expand Down Expand Up @@ -253,9 +254,14 @@ def _getCharacterOffsets(self,offset):
except COMError:
pass
try:
return self.obj.IAccessibleTextObject.TextAtOffset(offset,IAccessibleHandler.IA2_TEXT_BOUNDARY_CHAR)[0:2]
start,end,text = self.obj.IAccessibleTextObject.TextAtOffset(offset,IAccessibleHandler.IA2_TEXT_BOUNDARY_CHAR)
LeonarddeR marked this conversation as resolved.
Show resolved Hide resolved
except COMError:
return super(IA2TextTextInfo,self)._getCharacterOffsets(offset)
if HIGH_SURROGATE_FIRST <= text <= HIGH_SURROGATE_LAST or LOW_SURROGATE_FIRST <= text <= LOW_SURROGATE_LAST:
# #8953: Some IA2 implementations, including Gecko and Chromium,
# erroneously report one offset for surrogates.
return super(IA2TextTextInfo,self)._getCharacterOffsets(offset)
return start, end

def _getWordOffsets(self,offset):
try:
Expand Down