Skip to content
Permalink
Browse files

Compile liblouis with 32 bit widechars (#9544)

* Build liblouis with 32-bit unicode support (UCS-4)

* Remove the /WX flag when compiling liblouis

* Fix character offsets for IA2

* Review action

* No longer remove /WX flag for liblouis builds
  • Loading branch information...
leonardder authored and michaelDCurran committed Jun 17, 2019
1 parent 9cfa14e commit c312713b64df4345c5b4a9b7326c2757deb54960
Showing with 10 additions and 4 deletions.
  1. +3 −3 nvdaHelper/liblouis/sconscript
  2. +7 −1 source/NVDAObjects/IAccessible/__init__.py
@@ -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.
@@ -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",
])
@@ -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",
@@ -15,6 +15,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
@@ -254,9 +255,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)
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:

0 comments on commit c312713

Please sign in to comment.
You can’t perform that action at this time.