Our existing function getValueAsCodePoints() returns an array of
integers that are Unicode code points, as its name says. (Code points
can be larger than 65535, especially for emojis and interesting
scripts). It does not return an array of UTF-16 code units (which are
always less than 65536).
Still, the code used the JavaScript function String.fromCharCode() on
the elements of the returned array. That function expects UTF-16 code
units, and it simply truncates the argument to 16 bits. This obviously
leads to very wrong results.
There is a function String.fromCodePoint() that would work, but it
isn't present in MSIE so we can't use it. Instead, introduce a new
function codePointsToString() that works properly, producing surrogate
pairs as necessary.
Additionally, the code in getValueAsCodePoints() that combines a
surrogate pair to a code point used 0x100000 instead of 0x10000. Had
this code been tested at all, one wonders.
Also, add some more debug output to the affected functions, bypassed
with if (false).
Fixes https://github.com/CollaboraOnline/online/issues/733
Change-Id: Id50d05ac95285edc93f1e3f5a2538a0732186476
Signed-off-by: Tor Lillqvist <tml@collabora.com>
This undoes the plumbing change in
0752631deac1e427294ebec932be6624df220452 for desktop and non-iOS mobile browsers.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I3452f18ec005a44c06ec7e4d17ede111c7c7e4c0
And make the pull request query a bit more generic, so this can be
reused for other repos as well.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic231367bcf50f86b41430b48f752bb05d4e8d25f
- set a fixed bottom position only when on calc (due to tabs)
Signed-off-by: Pedro Silva <pedro.silva@collabora.com>
Change-Id: I9f98cdc65e83c06da814fe7b89b43ebbe6760f40
Always call resize update when sidebar modifies the document
the size values, this will cause internal events to update the
document bounds, zoom, etc.
Change-Id: If8efce4b08b96e6156a87f69fe6188cf9d75f5d5
Signed-off-by: Henry Castro <hcastro@collabora.com>
It's state is inconsitent and so it fails randomly.
Change-Id: Icd84d618fc87e64228918ad2e6e1ac602eac0e05
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Unfortunately when show/hide sidebar the "offsetWidth" property
works only if the element is visible otherwise it returns parent
empty size.
To fix add temporary a visibility property, then obtain the sidebar
"offsetWidth" property and update document container size.
Change-Id: I8e1c821518a4c155340edcfc8f2313098edff8b0
Signed-off-by: Henry Castro <hcastro@collabora.com>
We need JSDialogBuilder to be a common class for other builders.
MobileWizardBuilder will handle mobile specific cases only.
Change-Id: Icff024fe70d0e5386c92bdd106b6db2e74a584b5
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
It's not consistent, that we have a cursor
after stepping into editing mode.
Change-Id: I316c2399776535aaa12a40edb4686a9b02c16c4a
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Should no longer be needed since the unipoll transition.
Change-Id: Ie534cad7da0cfa54099175a86bc28dd16c738890
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
The temporary directories created for convert-to
and insertfile are used only once and should be
cleaned up to avoid clutter.
We also de-poco the temp directory creation as
it doesn't add value and do a bit of cleanup.
Change-Id: Ie1fd5b4749788ff4407f2cc886d405258f65f97a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We now download the convert-to files into the
child-root/tmp directory and then move it into
the jail that will convert it. This way ownership
and cleanup become contained within our child-root
and jail subsystems. This reduces the chances of
leaking convert-to files and simplifies the design.
In addition, we avoid an extra file copy and improve
the security of the convert-to API.
Change-Id: I450c24d0d0dc0da447c8072b0701c3b48d07c81b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
When scroll down button was used the view was jumping
on every use what caused flickering.
Change-Id: I16de0e9d01c9d025977edc6affc16de4bd098b49
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>