On Thu, 08 Oct 2015 10:18:15 +0100
Caolán McNamara <caolanm@redhat.com> wrote:
On Thu, 2015-10-08 at 08:52 +0100, Richard Wordingham wrote:
The intent of the call is to delete one Unicode character;
On reading the GTK documentation, it is clear that the arguments are
in terms of Unicode characters, and not UTF-16 code units.
I imagine you need to change signalIMDeleteSurrounding where we have
nDeletePos = nPosition + offset and
nDeleteEnd = nDeletePos + nchars
and instead of adding "offset" and adding "nchars" you need to call
getText on xText to get the string, then use
OUString::iterateCodePoints to count forward from nPosition by
"offset" IM codepoints to get the utf-16 offset for LibreOffice, and
similarly iterateCodePoints by IM nchars to get the LibreOffice
utf-16 nchars to delete.
might suck rocks for performance.
I can't fathom how getText() works - obfuscation by abstraction!
However, as using OUString::iterateCodePoints would appear to involve,
at the very least, copying a long string, I have coded up a similar
function that works directly with the 'editable accessible' string
(and associated data). I have added a patch to the bug report
https://bugs.documentfoundation.org/show_bug.cgi?id=94753 .
Richard
Context
- Re: Can't track flow of characters in from Input Method Editor (continued)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.