Commit graph

8189 commits

Author SHA1 Message Date
Michael Meeks
abbe1de459 Update unit test data for recent master.
Also add better printout for unit-client case.

Change-Id: Ic3c5573eab55ad5469adefa5bbfbd6c0e05e571e
2019-05-03 14:04:57 +01:00
Michael Meeks
c08b2f2ba4 Improve pid collection and printout for tests.
Change-Id: I820c1acbdbae41dd2c2c6bb7285b84bbb61e79d5
2019-05-03 13:52:15 +01:00
Iván Sánchez Ortega
e6576f0447 tdf#124749:loleaflet: use "KeyboardEvent.key" to detect ignored key events
Replace KeyboardEvent.keyCode with KeyboardEvent.key for detection of "Delete" and
"Insert" keys. keyCode misbehaves when using an AZERTY/DVORAK keyboard layout, e.g.
the keyCode for "Delete" in QWERTY is the same as "." in AZERTY.

This works on all major browsers, the only outlier being MSIE8:
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key#Browser_compatibility

Change-Id: I5cbfa18ef59ab4989a866fdf4b5708610beccaad
Reviewed-on: https://gerrit.libreoffice.org/71657
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-05-03 13:53:12 +02:00
Alexandru Vlăduţu
ef1669b389 loleaflet: update vex.js library
Change-Id: I6b32c6a60a27aa27eb32784bb73e40c979f67def
Reviewed-on: https://gerrit.libreoffice.org/71726
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-03 12:17:02 +02:00
Henry Castro
2ea141c02f loleaflet: move jquery.contextMenu.js to loleaflet/js
for next patch I require to modify the contextMenu
to trigger on touch start event.

I should do updating archived-packages, but ...

Change-Id: I20f1fbda1e7e60f97cd790c055599edcf8da9d1a
2019-05-02 18:19:59 -04:00
Michael Meeks
8172885f74 PNG compression a bottleneck: thread it to accelerate things.
Also have a separate hash <-> wid cache to avoid re-rendering
older tiles as/when we see them.

Change-Id: I238fe6701a1d1cb486473c67faba8c56e9c98dcb
2019-05-02 22:36:52 +01:00
Henry Castro
9c2ca2d502 loleaflet: makefile: create variable to expand more JS libs
It simplifies and expand more Javascript Libraries to be used in
"loleaflet" bundle

Change-Id: I94aab1989fcef844344a297cd511c796ba642bd4
2019-05-02 15:53:28 -04:00
Michael Meeks
5406a25b24 tests: make SVG comparison tests much more helpful.
Dump the SVG we actually get as a .new file for easy upgrade and
comparison on mismatch.

Change-Id: I607a97ff27a9bf480524efc31877e46d74c5ee3d
Reviewed-on: https://gerrit.libreoffice.org/71681
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-02 17:16:08 +02:00
Michael Meeks
95e1034d27 test: help people run just the one that matters.
Change-Id: I1916e250613f8d50377180e38505045f71f51fd0
Reviewed-on: https://gerrit.libreoffice.org/71642
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-01 23:14:04 +02:00
Michael Meeks
98fb165c69 Adapt test for new hiddenparts field.
Change-Id: Id2173a38167b97327d0735dfe2a8c88e2dcc4bc7
Reviewed-on: https://gerrit.libreoffice.org/71640
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-01 22:56:17 +02:00
Henry Castro
bf3c4c5695 loleaflet: remove GeoJSON.js file
GeoJSON data is no longer used for document tiled rendering

Change-Id: Ic95371947b7e1705ac2431ca06b9a5814d249207
2019-04-29 22:23:18 -04:00
Michael Meeks
685709080d Revert attempts at re-using ostringstream
Cleaning up the thread variable with the shared string stream is
    something of a nightmare, for a rather marginal gain.

    ==9296== Invalid write of size 1
    ...
    ==9296==    by 0x738C092: str (sstream:195)
    ==9296==    by 0x738C092: std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::str(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (sstream:649)
    ==9296==    by 0x65383A: Log::beginLog[abi:cxx11](char const*) (Log.cpp:141)
    ==9296==    by 0x551823: Admin::~Admin() (Admin.cpp:381)
    ==9296==    by 0x7D9ECF7: __run_exit_handlers (exit.c:83)
    ==9296==    by 0x7D9ED49: exit (exit.c:105)
    ==9296==    by 0x7D86F50: (below main) (libc-start.c:342)
    ==9296==  Address 0x8ba41c0 is 0 bytes inside a block of size 513 free'd
    ==9296==    at 0x4C2FA1D: operator delete(void*) (vg_replace_malloc.c:576)
    ...
    ==9296==    by 0x738784A: ~basic_stringbuf (sstream:65)
    ==9296==    by 0x738784A: std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream() (sstream:591)
    ==9296==    by 0x7D9F27E: __call_tls_dtors (cxa_thread_atexit_impl.c:155)
    ==9296==    by 0x7D9EC0A: __run_exit_handlers (exit.c:41)
    ==9296==    by 0x7D9ED49: exit (exit.c:105)
    ==9296==    by 0x7D86F50: (below main) (libc-start.c:342)

    Good to log during shutdown / exit.

This reverts commit c315d219d5967f23fb1769e78021f61b8f9da6ec.
This reverts commit ce78fec310.

Change-Id: Ia4a15be336d89d8d883530943724d48e4b0ec9fe
Reviewed-on: https://gerrit.libreoffice.org/71444
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-04-27 23:18:11 +02:00
Michael Meeks
c2c5bd0e3e Reset the stringstream properly.
Avoids some N^2 log-line explosion; also make the method name
more findable.

Change-Id: I3ee8c521f1ac98a939cd4d758c720b577d3bfa57
Reviewed-on: https://gerrit.libreoffice.org/71443
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-04-27 23:03:16 +02:00
Tor Lillqvist
f21665f2ac tdf#124981: Fix a few object leaks
The pointer to the DocumentViewController object in the Document class
can be a weak property. This avoids a circular reference.

When the DocumentViewController is being dismissed, remove the script
message handlers and remove the view from its superview. Also, set the
webView property to nil.
2019-04-26 18:04:10 +03:00
Henry Castro
71496cfdb2 loleaflet: add 'paste' event listener to dialog
Change-Id: I2ec69117683e4dd75722b1873a373ee6b7ec7782
Reviewed-on: https://gerrit.libreoffice.org/70961
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-04-26 15:36:28 +02:00
Henry Castro
6bb4edd62c wsd: allow paste content to tunneled dialog
Change-Id: I32fabaa533a0e9d853226b329d2d8b1c489dd776
Reviewed-on: https://gerrit.libreoffice.org/70960
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-04-26 15:32:58 +02:00
Tor Lillqvist
bf520d5fa5 Log the timestamp of the template file at its site and of its cached version 2019-04-26 12:04:28 +03:00
Tor Lillqvist
db9208d364 tdf#124918: Don't crash on invalid URLs in the template list file 2019-04-26 12:04:20 +03:00
Tor Lillqvist
d550944053 tdf#124918: More logging in template download error situations 2019-04-26 12:04:09 +03:00
Tor Lillqvist
4e2ad4d2bc tdf#124918: Allow empty lines in the template list file 2019-04-26 12:04:01 +03:00
Tor Lillqvist
4247dad6f5 tdf#124950: Don't pop up keyboard on iOS when clicking in toolbar 2019-04-25 17:29:01 +03:00
Tor Lillqvist
981db95a28 tdf#124950: Don't pop up keyboard on iOS when clicking the mobile-edit-button
Only when the user taps in the document, or selects some text in it,
is it obvious that they want to be able to type into it.

This is just one of the instances where the on-screen keyboard popped
up for no good reason.
2019-04-25 17:27:30 +03:00
Tor Lillqvist
05e4cf90f9 Remove leftovers of loading.html from iOS app project, too
Change-Id: Iecbbbc8ea42c0e26e6dde3f38a57482ad60135d5
2019-04-25 17:25:15 +03:00
Henry Castro
a97b592b30 loleaflet: validate that the rectangle coordinates (x, y) belongs to ZxZ
Change-Id: Ibbb1cf1416ec441f1e3d4baaf6fdf6f47ab6041c
Reviewed-on: https://gerrit.libreoffice.org/71150
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-04-24 16:05:10 +02:00
Henry Castro
e7d3e5e37f loleaflet: enable Conditional Formatting dialog
This reverts commit b3532ebb828035dc9db8c027472bd050494fce3c.

Change-Id: Iac31520b1444832059c99e0bfb52eb99d1fd91ca
2019-04-24 10:02:06 -04:00
Tor Lillqvist
824834dfa8 Turn on Unipoll for the iOS app, too
Change-Id: Ib0b7ac53b7c936e75446004c4581ace415b1dd5c
2019-04-24 13:24:53 +03:00
Szymon Kłos
dfd22ba35c Show progressbar centered in the mobile
When Online was embodied in the nextcloud app (Android)
the progressbar was moved into top-left corner.
During a loading all functions to get container
or browser size were returning (0,0).
This hack assumed that webview size is almost equal
to the mobile screen size.

Change-Id: I0fff53639a3baa88b57d91bf671e00ad8c71180d
Reviewed-on: https://gerrit.libreoffice.org/71117
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2019-04-23 11:59:45 +02:00
Andras Timar
92562991bd change default HelpRootURL to 'https://help.libreoffice.org/help.html?'
Change-Id: I6463ad84b5c0df2860504f4e51f87b5537107f42
2019-04-23 10:05:05 +02:00
Miklos Vajna
fdc731a07d gtk: fix typo
Change-Id: Ib8bcf8b578f1d926f26a0ebae15cfa36e5d922d2
2019-04-23 09:10:18 +02:00
Ashod Nakashian
69995fa0f1 Move the Help URL to a new config path
Change-Id: I76468d1c032689099b371449aedc0e5583f0ae2d
Reviewed-on: https://gerrit.libreoffice.org/69107
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/71087
2019-04-23 07:47:04 +02:00
Ashod Nakashian
e8bcf06330 Add help URL to loolkitconfig.xcu
When blank the help button is hidden from
all dialogs.

Change-Id: Ibd43411bed496bfd3bc81056ebc8657fb77fb8fe
Reviewed-on: https://gerrit.libreoffice.org/69072
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/71086
2019-04-23 07:46:46 +02:00
Ashod Nakashian
4f4bcbc982 leaflet: do not disable the Close Document menu for read-only docs
Change-Id: I6a52b0bd807ae68ea6bf59e103c004375afae50b
Reviewed-on: https://gerrit.libreoffice.org/69110
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/71088
2019-04-23 07:46:22 +02:00
Tor Lillqvist
ede2c3432f tdf#124235: Fix the same problem on all platforms the same way
Change-Id: Ie7ede59841898a0738af7e44a3c0fe89db1cd3ee
Reviewed-on: https://gerrit.libreoffice.org/71023
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 04:52:05 +02:00
Ashod Nakashian
83a73e24e0 wsd: set the language when creating a new view
This uses the new createViewWithOptions API to
set the language of the user at the point of
creating a new view.

Change-Id: Ibf3e0af1b0cc300126388c1217692d8d969be0f3
Reviewed-on: https://gerrit.libreoffice.org/67501
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:44:07 +02:00
Ashod Nakashian
ca1a83f96b wsd: reduce tile logging from debug to trace level
These are very frequent and not very useful without
the ability to trace them across the system, which
are all done at trace level. So it's highly unlikely
that these would be used at debug.

Change-Id: I479f2ead1bbd2996b9972082e00ebf984072f785
Reviewed-on: https://gerrit.libreoffice.org/71073
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:02:36 +02:00
Ashod Nakashian
2ec5023dbf wsd: assert on 0-sized tiles
Change-Id: I10a20bb5a3ad31e368f554bdc5e1701a7ff6a22d
Reviewed-on: https://gerrit.libreoffice.org/71072
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:02:09 +02:00
Ashod Nakashian
c45dfe194b leaflet: process the most common message first
The 'tile:' message is the most common and most
latency sensitive message, so give it priority.

Change-Id: Id5790369cd493423a47acab8a3d5107ce91b0d39
Reviewed-on: https://gerrit.libreoffice.org/71071
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:01:46 +02:00
Ashod Nakashian
c7ac68e8e3 wsd: tile serializer now supports adding a suffix
Moves appending tokens into the serializer and
avoids making extra copies of itself.

Change-Id: I62d374e69d9c4a55643ea20cb5f8c2b9c75c88c5
Reviewed-on: https://gerrit.libreoffice.org/71022
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:01:30 +02:00
Ashod Nakashian
c053dc38b2 wsd: set vector size when constructing
Change-Id: I68718554017b47b6df1c6bf3b997483d4c753136
Reviewed-on: https://gerrit.libreoffice.org/71021
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:01:17 +02:00
Ashod Nakashian
ce78fec310 wsd: reuse ostringstream when logging
This is faster and reduces memory fragmentation.

Also, cleans up the logging macros and implementation.

Change-Id: I7fb00da041d1261c694c4b48b67a3c66ad0cbf8d
Reviewed-on: https://gerrit.libreoffice.org/71020
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:01:00 +02:00
Ashod Nakashian
ed0efde542 wsd: use thread_local instead of __thread
The former is the standard C++ approach
and is reportedly faster than __thread
(at least with gcc).

Change-Id: Ibdefd32172774a280637f73dd062282b7bf62025
Reviewed-on: https://gerrit.libreoffice.org/71019
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:00:44 +02:00
Ashod Nakashian
e76d27188e wsd: use fast deflate level for png
The default deflate level of 6 is quite slow
and the benefits are hardly worth the high
latency that users experience.

Tested on a writer document with some small
images and a few pages of text:

Level 4 gives virtually identical compression
ratio to level 6, but is between 5-10% faster.

Level 3 runs almost twice as fast as level 6,
but the output is typically 2-3x larger.

Perhaps this should be exposed via config
so it would be possible to reduce latency
due to compression when CPU is scarce but
network bandwidth ample, and vice versa.

Change-Id: Iba88eea8f180d11458b33c68389e797234df1a60
Reviewed-on: https://gerrit.libreoffice.org/71018
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:00:31 +02:00
Ashod Nakashian
90c8dd41b9 wsd: logging, comments, and const correctness
Change-Id: Ibfbef282e951a80fb145239df4bbcc9f3e4c8e13
Reviewed-on: https://gerrit.libreoffice.org/71017
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:00:19 +02:00
Ashod Nakashian
6b82d245fa Unipoll: integrate with the LOK mainloop in a single thread.
Unfortunately processing multiple events from the Kit socket
is causing massive document invalidations, for unknown
reasons. As such, for now we have to process one event
at a time, until the source of the invalidations is found
and fixed.

Without the invalidation, the average tile rendering
roundtrip is about 3x faster than with the invalidations
and the maximum roundrip is at least 2x faster.

Change-Id: Iafbf9ccc2b80656cb71c208b598080f72d201ca2
Reviewed-on: https://gerrit.libreoffice.org/70906
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:00:07 +02:00
Tor Lillqvist
0ae32391d0 There is no l10n directory with localisation JSON files in the iOS app
The localisation is handled differently on iOS, see the
L10N_IOS_ALL_JS stuff in loleaflet/Makefile.am and the script
loleaflet/util/create-l10n-all-js.pl.

That part of loleaflet.html is not needed in the iOS app. Whether it
will be needed in the Android app remains to be seen. Possibly we will
want to handle localisation in that the same way as in the iOS app. Or
not. So for now, do this change only for iOS.
2019-04-22 17:33:25 +03:00
Tor Lillqvist
60581962af Add branding to the iOS app
A configure argument, --with-iosapp-branding, should point to a
directory containing a branding.css file and possibly other files that
branding.css references, to be bundled and used by the iOS app. The
directory structure ends upp in the app bundle as Branding. The
generated loleaflet.html for the iOS app references
Branding/branding.css unconditionally.
2019-04-22 17:23:20 +03:00
Tor Lillqvist
9ada3e35a1 Typo fix
Change-Id: I6e4692a19d1e03c16c40eada5c4eca99b229601a
2019-04-20 23:25:01 +03:00
Michael Meeks
a088e09193 re-factor PNG compression to share and protect TileDesc updates.
Change-Id: I3cbda6ecd78c7be8ca7fc767d9a5a288a020df7b
2019-04-20 01:26:50 +01:00
Michael Meeks
adfaa76ff6 Inline PngCache lookup to avoid redundant watermark blending.
Change-Id: I6fe5cca81b9268c903e011fe0e77f478befbc836
2019-04-19 23:56:20 +01:00
Michael Meeks
2871653bf4 Simplify legacy single tile rendering code-path.
Remove redundant _id member from TileCombined, add constructor
from TileDesc, and use it to shrink the code.

Change-Id: Idc0ded63166ed350ab81b07e191b7a60d4407cd4
2019-04-19 23:51:26 +01:00