Commit graph

437 commits

Author SHA1 Message Date
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
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
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
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
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
Michael Meeks
729c124b3b perftrace: consume PROFILE_FRAME messages and chart lok ProfileZones.
Also - enable performance tracing in the kit when we're logging at
trace level.

Change-Id: I838e8d7769b0ead8508c4482c58e0e2564dcee91
2019-04-16 20:27:37 +01:00
Michael Meeks
ca619e6fd7 perftrace: annotate start events as idle as well.
Change-Id: Iaf603101426caca1f48ebe10918170287aee006d
2019-04-04 20:01:19 +01:00
Tor Lillqvist
9c02d82f7c Fix build in the MOBILEAPP case
Did not check how well it works.

Change-Id: I5ca1b349aafcfddaed517e51ca6bd25e9749779d
2019-03-31 14:34:24 +03:00
Michael Meeks
201bcb0762 Use peercreds to identify processes connecting rather than URL params.
Change-Id: I241e80962fb8cf2f3fff1bb4be81d9f0ee74c648
2019-03-30 21:37:05 +00:00
Michael Meeks
81a27e26aa Switch local prisoner sockets to abstract UDS
Unix Domain Sockets are inaddressable remotely, and more efficient,
as well as allowing future SCM_CREDENTIALS / SCM_RIGHTS.

Change-Id: Ia2472260f75feb43e9022cdfa0fe005ccd489454
2019-03-30 16:51:06 +00:00
Michael Meeks
9b4afbb460 Disable potentially problematic module loads for online.
Change-Id: Iaa30486977ad783e2af0f876d790f2a2b06904f9
2019-03-29 09:49:23 +00:00
Tomaž Vajngerl
02a07d62a5 tdf#124146 touch gesture support, send pan gesture in dialogs
Pan gesture should work for comboboxes, for which panning is
implemented in core.

Change-Id: I0a7e49e9335159a302716f666e2334a9d532c115
Reviewed-on: https://gerrit.libreoffice.org/69720
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-26 10:48:17 +01:00
merttumer
5e7401c2fe Added passing watermark text to saveAs for tiled watermark
Change-Id: I2cc7c942a646a57e39d3c5862bbcc45ddfbafe4c
Signed-off-by: merttumer <mert.tumer@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/67780
2019-03-18 13:04:12 +01:00
Ashod Nakashian
ef63472e1a wsd: more informative callback failure error message
Change-Id: I8d84af03be2bd051ec03d12528dd98b245b982d0
Reviewed-on: https://gerrit.libreoffice.org/67998
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit f6a35eab4f7bcbbbb26d4fc1084d78bc3a19ad76)
Reviewed-on: https://gerrit.libreoffice.org/67506
2019-02-26 14:23:47 +01:00
Tor Lillqvist
76058ac270 Fix crash in iOS app: Just use a raw pointer as the lok_document hack
The lok_document pointer will only be used when it is valid anyway.
Fixes a crash when you open a second document after closing the first.

Change-Id: I362db282e4eccf419b56bf790ea58181594ab0fe
2019-02-26 14:07:59 +02:00
Tor Lillqvist
4dc340972c tdf#122582: Add slideshow functionality
Requires a couple of corresponding commits in core to its filter
subdirectory.

Change-Id: I3e6353752dd93e021fb6058fff5096f1d648d17e
2019-02-22 21:01:54 +02:00
Jan Holesovsky
835bb3db35 android: Perform the android-specific setup before initializing the LOK.
Change-Id: I935e6849dd41c5e66b768c7f2a79c139265c901f
2019-02-15 16:53:35 +01:00
Jan Holesovsky
f76b36193d android: #if(n)def MOBILEAPP -> #if (!)MOBILEAPP for better reliability.
Change-Id: I5f9c9420b6c83601db1c8fdba4ae5a10b17b2107
2019-02-12 12:20:11 +01:00
Andras Timar
6364ed0a2f we need share/template/common/internal/idxexample.odt for Insert TOC dialog
Change-Id: I1b33b3c74695605c0bf887d1e730f833f286c33f
Reviewed-on: https://gerrit.libreoffice.org/67117
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-01-30 11:13:47 +01:00
Andras Timar
309cb05916 remove duplicated check for 'share/config/wizard'
Change-Id: I46f274825a7be024c87ec9b3cc491c5dc91ffa14
Reviewed-on: https://gerrit.libreoffice.org/67116
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-01-30 11:11:11 +01:00
Szymon Kłos
3b93d5f61b Small conditions refactor 2
Change-Id: I11bb3a2ae2907e9cba46f3339b457812c6d1d246
2019-01-22 14:52:40 +01:00
Szymon Kłos
8613f11c75 Small refactor of conditions
Change-Id: Id3884d8385bf1c138eef2909220bfef352b95370
2019-01-22 14:52:40 +01:00
Szymon Kłos
d30ade3ff3 Show progressbar on loading
Change-Id: Id2f6b35843380726e10570c2c3e501921e882b52
2019-01-22 14:52:40 +01:00
Tor Lillqvist
669e90de20 exportSignAndUploadDocument() is not used on MOBILEAPP (and does not compile for iOS at least)
Change-Id: I23bdd461c8dffb407e6aee2a378c47dc38239618
2019-01-22 15:50:13 +02:00
Miklos Vajna
010d415e95 kit: make members private in DummyLibreOfficeKit
Change-Id: I2d29398b16272b683f9682f627b4a0574c9332b7
2019-01-18 09:07:20 +01:00
Tomaž Vajngerl
fe59a510fd send a signal that the export, sign and upload was successful
Change-Id: Ic55a2d5ea452c9153945d3bc9bcbb514a46e70e9
2019-01-17 16:58:20 +01:00
Tomaž Vajngerl
7137c953d8 add export, sign and upload as one function for PDF signing
PDF export, signing and upload needs to be done in one operation
as PDF doesn't change the current document. The workflow is just
a bit different to the ODF / OOXML that it needs a change in
behaviour.

Change-Id: I752b293494a2d677fa7f12f2317954cfcf47859b
2019-01-13 23:50:18 +01:00
Tamás Zolnai
6c6eaaadf0 Now we need gallery for inserting some special shapes
So copy it from the lotemplate.

Change-Id: I84d1514e5e06ec194e549b36f8db2dc6fdd04f38
(cherry picked from commit 66dcff38a7248fb7facc6d459ac8788882262bb1)
Reviewed-on: https://gerrit.libreoffice.org/65018
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-12-12 13:18:48 +01:00
Ashod Nakashian
e5723a22d7 wsd: update bundled headers and improve renderShapeSelection test
Unfortuantely it still fails, but this is not regression. Now
with the new patch in Core the exception is caught and so at least
the binary survives (and the API returns 0).
New unit-test added in Core to help track the issue down and fix.

Also, free the memory allocated by the API.

Change-Id: I5d788a2ee0383de1c323af4cd6b39b8615a35baf
2018-12-07 12:39:27 +01:00
Tamás Zolnai
31f99bf9f5 Introduce client-server message for requesting the selected shape as SVG
It works for Impress only now.

Change-Id: I130707d8e96e0c633f2531b1cb81ce74dc6ec6e1
2018-12-07 12:39:27 +01:00
Ashod Nakashian
feb36a4a05 wsd: hoist token parsing outside lock and optimize
Change-Id: I8710f0c3040d22588b46bec732cf8bca7c503244
2018-12-07 12:39:27 +01:00
Tomaž Vajngerl
e82c2180d1 Show and check document status when log in into vereign
This shows what the current document status is in the signing
infobar.

When logging in into vereign we need to check the current document
as we have all the needed certificates avaliable.

Change-Id: I7fb4420d0b80a6d0fa553fca2f0be7b6dec6249f
Reviewed-on: https://gerrit.libreoffice.org/64333
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-30 11:29:34 +01:00
Tor Lillqvist
637324354d Skip the signature uploading code for the mobile app case
Change-Id: If634c5b1ff77e6a56c9a195d9394c4d2906419cb
2018-11-29 23:46:16 +02:00
Tomaž Vajngerl
2645829f40 don't assert in this case, better to return
Change-Id: I38cef1185bef0de67bbb579c5c64e2697f953b0b
Reviewed-on: https://gerrit.libreoffice.org/64297
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-29 22:46:00 +01:00
Tomaž Vajngerl
5b22fac214 Upload document to Vereign
Save document to a input format (either PDF, ODT, DOCX) and send
the document to Vereign using WOPI protocol.

Change-Id: If9a7d88e91d07c7f1f831c01793f0f73d7a98131
Reviewed-on: https://gerrit.libreoffice.org/63839
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-29 21:49:51 +01:00
Tor Lillqvist
ef18d2f493 Fix ofstream API used to write an inserted image in the mobile app case
Change-Id: I67f8a74376a46f0cfd01ee4236960b29d4bc6372
2018-11-29 15:07:50 +02:00
Tor Lillqvist
9d8cc0b766 Initial attempt at C++ part of image insertion in the mobile app
Change-Id: I4b10f168f9283ba8a3f10dc272e24032af13b23b
2018-11-29 13:00:35 +02:00
Marco Cecchetti
2a86260988 hidpi dialogs: passing dpi scale value with the paintwindow msg
Change-Id: Icd0f48c98410af32e65bb44c413dfeb078ab8774
2018-11-19 13:38:20 +02:00
Miklos Vajna
cd08cbf385 Session: make members private 2018-11-13 09:04:19 +01:00
Jan Holesovsky
efe291c320 Notify about the editing context.
And also:

* Hint the compiler to warn about the missing callbacks.
* Add few missing ones.
* Update the bundled headers.

Change-Id: I8d31363eaaea289e8a517c0b9b1142b33ce3027e
2018-11-12 18:10:57 +01:00
Miklos Vajna
c863e52001 RecordedEvent: make members private 2018-11-12 09:04:01 +01:00
Miklos Vajna
24b4e7dd36 Fix -Werror,-Wstring-plus-int warning
Change-Id: I047ffbb93fc261a0c39670287a616550de249a9b
2018-11-09 09:19:40 +01:00
Tomaž Vajngerl
37e1e208c2 add "sign" function to infobar to sign with a one-time cert.
In addition:
- add methods to transport the certificate chain, signing
certificate and signing certificate to WSD
- add conversion of PEM cert. format to DER
- add transporting the certificate chain to the LO core
- run the signing function with the signing cert. and the
private key

Change-Id: I1a005e88cacbd81144df40d315197561401db427
Reviewed-on: https://gerrit.libreoffice.org/63156
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-09 09:06:51 +01:00
Tomaž Vajngerl
852ed5d981 handle signature status and prepare document signing in WSD
This adds handling of signature status (manually request for the
status or as a callback) in WSD.

In addition prepare support for signing of document, but don't yet
trigger the actual LOKit function (needs the JS building blocks
set up first to know how to handle the payload - certificate and
private key)

Change-Id: Ic76baa5847bb52adde616338187d5979e0093c6d
Reviewed-on: https://gerrit.libreoffice.org/62533
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-09 09:06:02 +01:00
Miklos Vajna
83bd75476e StateRecorder: make members private 2018-11-09 08:41:35 +01:00
Tor Lillqvist
1521685c81 Avoid assertion failure in the MOBILEAPP case
The dummy Unit thing is of type Wsd, not Kit, there. Just put this
into #ifndef.

Change-Id: Ic709472154fd17761a82df9814e5d3746f96f607
2018-11-08 15:01:45 +02:00
Miklos Vajna
df0b3835c5 DeltaBitmapRow: make members private 2018-11-08 09:16:57 +01:00
Michael Meeks
fa74404019 Add a time limit for badly behaved / huge document load / conversions.
Also improve debug printing of load times in dumpstate.

Change-Id: Ib3fd70dffb57588cd90bd928c4be9890cee8bc65
2018-11-08 01:27:40 +00:00
Tor Lillqvist
adbcc28273 If we skipped all tiles, don't bother sending an empty tilecombine: message
It would just be ignored later anyway, and produce the warning "WRN
Dropping empty tilecombine response".

Change-Id: I6d92367262dc306369f2ca6c2e1964b5d151acc1
Reviewed-on: https://gerrit.libreoffice.org/63013
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-11-07 14:19:02 +01:00
Miklos Vajna
175ddd4c40 DeltaData: make members private 2018-11-07 09:09:12 +01:00
Miklos Vajna
af22ebbbc0 CacheEntry: make members private 2018-11-05 10:04:22 +01:00
Tor Lillqvist
b52456aeee Use non-empty dummy values of 'jailId' and 'pid'
Just in case some code checks them for being non-empty.

Change-Id: I6e595272f3fb6d3c2e57a31c291a89b0fb02563a
2018-11-01 18:34:14 +02:00
Jan Holesovsky
8c9e126a23 Insert graphic: Pass the remote url to the core for download & insertion.
Change-Id: I871de173c255dcb7b184582e486328d7f66a2fae
2018-10-31 18:12:07 +01:00
Miklos Vajna
4c423fad84 CallbackDescriptor: make members private 2018-10-31 09:02:15 +01:00
Tor Lillqvist
ffe66b3efc Avoid 'Unused variable' warnings in the MOBILEAPP casse
Change-Id: I30d631559379da4baa5a73712f002435b1a36360
2018-10-30 22:03:04 +02:00
Tor Lillqvist
888b529ffc For MOBILEAPP, call SocketPoll::wakeupWorld() when lokit_main() is dying
This wakes up the mainWait poll in LOOLWSD::innerMain(), causing the
process to get back to the clean idle state right away, without having
to wait for the mainWait poll to get a timeout.

Change-Id: Ifbe586d41661737be2864bedaddf9a40d23501f4
2018-10-30 21:09:43 +02:00
Miklos Vajna
54d788e69b UserInfo: make members private 2018-10-30 08:41:52 +01:00
Tor Lillqvist
f7ebab8902 Use Poco to convert from pathname to URI
(Yesterday I talked about GLib in a commit message, I meant Poco of
course, for this source file. It's gtk/mobile.cpp that uses GTK+.)
2018-10-26 10:22:33 +03:00
Tor Lillqvist
3b901020d2 Actually it's enough to pass instdir as the 2nd parameter to lok_init_2()
The "/user" will be tacked on by core code anyway. We don't need two
levels of "/user".
2018-10-25 16:02:45 +03:00
Tor Lillqvist
76ff3d5c2a The 2nd parameter to lok_init_2 should be a URL
Sure, there is some GLib API I could use to properly convert from a
pathname to a file: URL. But I am lazy, and this is not an end-user
program.
2018-10-25 16:02:45 +03:00
Tor Lillqvist
5b13757d4a Remove obsolete comment
"-1" was changed to "all" (the meaning of which is more obvious) over
a year ago.

Change-Id: I929cff2b35c7493efeb523bf30b6967b983bc068
2018-10-23 13:20:53 +03:00
Tor Lillqvist
fc2023723e Attempt to fix the thread problems in the GTK+ testbed app
Use g_idle_add() to make the webkit_web_view_run_javascript() call run
on the GTK+ thread. Correspondingly, need to use a separate
short-lived thread to do the fakeSocketWrite() calls from
handle_lool_message(), so that the GTK+ main loop is ready to run the
added lambda. Or something like that.

Now it gets a bit further, doesn't crash, but just sudddenly exits
before showing the document even.
2018-10-17 23:30:26 +03:00
Tor Lillqvist
d1e550f01e Reset the global 'document' variable to null when not needed any more
Doesn't matter in "real" Online where the kit process will die shortly
after that ayway, but matters a lot in the mobile app, where there is
just one process all the time that handles document after document.

Now I can successfully load another document after closing the first
in the iOS app.
2018-10-17 20:10:52 +03:00
Tor Lillqvist
fb8e6dd820 For MOBILEAPP, don't set TerminationFlag in KitWebSocketHandler::onDisconnect()
Helps in the struggle to get loading of another document after closing
the first to work.
2018-10-17 20:10:52 +03:00
Tor Lillqvist
bd8d612c9f In the MOBILEAPP case, don't set TerminationFlag when there are no sessions
The global TerminationFlag is an abomination that has caused lots of
trouble when developing the mobile app. The less we use it the better.
Here, it gets set elsewhere already when needed; just having no
sessions is not reason enough to set it.
2018-10-17 20:10:52 +03:00
Tor Lillqvist
9afe021b86 Move the non-namespaced anonymizeUrl() to build for MOBILEAPP, too
Also, initialise the AnonymizeFilenames and AnonymizeUsernames
variables to false in the MOBILEAPP case.
2018-10-17 12:35:34 +03:00
Tor Lillqvist
017df44f89 Bypass bTraceStartup thing on MOBILEAPP 2018-10-17 11:48:51 +03:00
Ashod Nakashian
4e186aca18 wsd: fixed remaining anonymization issues
(cherry picked from commit b7f5809a792e2a0b816d3cfd96511cdd93582d15)

Change-Id: I756ccd4b810fdc4dd62a83c1704c59c6a947e615
2018-10-16 20:12:23 -04:00
Ashod Nakashian
b6333ada8d wsd: anonymization improvements and unittests
Also support anonymization of downloadas documents
and renaming of documents.

Reviewed-on: https://gerrit.libreoffice.org/57541
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 78248a542c9ca31bf9ad4cad9b55d78690384395)

Change-Id: I81a80e6290217659987d73f625e5f0fb81cb7ef2
2018-10-16 20:12:23 -04:00
Ashod Nakashian
00a44d6e81 wsd: flush logs before existing
This is important for when we abort with some explanation.
Often said explanation doesn't show up anywhere to be useful.

Also, issue fatal logs for abnormal exist and use SFL to log errno.

Reviewed-on: https://gerrit.libreoffice.org/57540
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit ad7964393eadb68873b820e0a620fb40f1e1b06a)

Change-Id: Ic67064ef40ef6e93d26e5847ecd32bdd49c3cc8b
2018-10-16 20:12:23 -04:00
Ashod Nakashian
053161b3f5 wsd: move string utilities into Util
Reviewed-on: https://gerrit.libreoffice.org/57539
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit fb2671c4145edd4d4e359f0dcf5cc84835487cd4)

Change-Id: Idc578dff4e8ee5e48c1b7780d3feb2d21c6a9b13
2018-10-16 20:12:23 -04:00
Ashod Nakashian
4587dde56f wsd: anonymize filename by using the WOPI file ID
Reviewed-on: https://gerrit.libreoffice.org/57254
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 5e3568ff1029da948f05d1c0e0c56c6d0706690e)

Change-Id: I869cae3846c8630b192246bc68cc90e70c50d1fd
2018-10-16 20:12:23 -04:00
Ashod Nakashian
1d5b6ca20b wsd: use obfascated user id when provided by WOPI
Change-Id: I69a17dff0e5e6b27e4538d9fe9019e4d1eebb16f
Reviewed-on: https://gerrit.libreoffice.org/57171
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 62dadb8aaa5cf9ba8cbbe0bc7f84dfc1076104c1)
2018-10-16 20:12:23 -04:00
Jan Holesovsky
564fd6c621 anonymization: Anonymize urls in Kit.cpp
(cherry picked from commit 3a530d247496e577ed994c9cbece5faebd68e850)

Change-Id: I02c24e53664dbc971e8b5b4bdc3e607a53769bd0
2018-10-16 20:12:23 -04:00
Ashod Nakashian
a483d7ddef wsd: anonymize saveas
Change-Id: I58e349781952a97c3251b0e52e26abb34d44e9c0
2018-10-16 20:12:23 -04:00
Ashod Nakashian
f8ec98c144 wsd: anonymize downloadas
Change-Id: I6dff7189d78d339f1f5db7afef2b62da4df23759
2018-10-16 20:12:23 -04:00
Ashod Nakashian
6c18aa7e88 kit: anonymize usernames and filenames in Kit
Change-Id: Id7928136db71ded7bf6b1a5e8e387db7251f8a35
2018-10-16 20:12:23 -04:00
Ashod Nakashian
380c55d9eb wsd: disable tracing after initialization
The first child had tracing enabled even after
initial startup is completed. This would leak
user details when anonymization is enabled.

Change-Id: I5325e02d1a1078bff6640af85f5672b556c00aeb
2018-10-16 20:12:23 -04:00
Ashod Nakashian
f3d02cb9e2 wsd: support polling on client thread
Previously SocketPoll expected to be
running its own thread for polling.
This is unnecessary when we have a
spare thread (e.g. main) that can
(and should, for efficiency) be used
for polling rather than starting
dedicated thread.

Not starting the SocketPoll's thread
and calling SocketPoll::poll() directly
worked, the warning logs on each activity
notwithstanding.

The warnings aren't just noisy, they are
a performance drain as well, and signal
that something is wrong. The new code
now makes the API cleaner and avoids
unnecessary warning logs, while being
faster.

Change-Id: Ibf9a223c59dae6522a5fc2e5d84a8ef191b577b1
2018-10-16 20:12:23 -04:00
Ashod Nakashian
a7a03c3c5d wsd: send copied text to client upon .uno:Copy
Change-Id: I39181a0e29e00a0eae389fbab6ee253cf2f23f84
2018-10-16 20:12:23 -04:00
Tor Lillqvist
ef3e09728f Revert "Drop one use of TerminationFlag"
Turns out not to be useful for the iOS app after all.

This reverts commit bff5c17693.

Change-Id: I93367e9de1b6e66b1cbb7587259f1136564e53a4
2018-10-16 01:03:47 +03:00
Tor Lillqvist
c05079d6d5 Mention TerminationFlag in a couple more log lines
Why log something vague like "Stop flagged" when we can log what we
actually do?

Also, the log lines already include the name of the thread, so no need
to prefix with "Kit:".

Change-Id: I5a05492aa4e8a26714889cc6341a26862c80e4d0
2018-10-16 00:08:44 +03:00
Tor Lillqvist
bff5c17693 Drop one use of TerminationFlag
Doesn't help my current issue in the iOS app, but the less use of
TerminationFlag the better, I think. (Doesn't break 'make check' on
Linux.)

Change-Id: I8fef271d6e0e81dea92e0da76ecb7211239adab6
2018-10-15 17:59:40 +03:00
Tor Lillqvist
8ead4af199 Say "TerminationFlag" in logging when that is what we mean
We already did in other places.
2018-10-15 15:36:51 +03:00
Tor Lillqvist
7073d4feca Don't call std::_Exit() in the mobile app
Instead we should just exit the thread(s) that serve the document that
was being edited, and the app should return to showing the document
browser. (Or whatever we eventually will have as its state when the
user is not editing or viewing a document.) Work in progress.
2018-10-15 15:36:51 +03:00
Tor Lillqvist
ab54f21a54 Adapt to change in core: paintTile() now takes a buffer pointer also on iOS
Makes the code here a little bit simpler.
2018-10-10 16:31:38 +03:00
Tor Lillqvist
1f6eabafce Bin leftover verbose dump of part of a tile 2018-10-09 15:54:46 +03:00
Tamás Zolnai
07e99ad336 Fix tilesBeingRendered tracking by client
I changed the code in this commit:
c2a5f6acb0

To make kit send a tilecombine message even if it does not
send actual tile data so we can track that the rendering was
done and so we can update the clients' _tilesBeingRendered
list. The issue is that tileBeingRendered object
belongs to not only one client, but more and so we don't
know which client gets the actual empty tile response.

So revert this method and rather use a smaller timeout for "waiting" the
arrival of the rendered tile.

Change-Id: I2dbbab1a62b81cbbb5314f2f37fdbc3415c69130
2018-09-29 09:27:06 +02:00
Tor Lillqvist
f3786f5cb7 Pass correct argument on iOS as pBuffer to lok::Document::paintTile()
On iOS it shouldn't actually be pointer to a pixel char buffer, but a
craphics context reference. (This is how it has been since the
experimental TiledLibreOffice app, maybe five years ago? Sadly it
wasn't documented in the LibreOfficeKit include file. But it is how
LibreOfficeLight used the API, too.)

In TiledLibreOffice we rendered tiles directly into the CALayer of the
view. In this Online-based app we of course do render tiles into pixel
char buffers, just like in real Online, but we need to create bitmap
graphics contexts for them and pass that to paintTile().

Now I get white tiles, not totally zero-filled ones. But still no
document contents rendered.

I don't yet want to change the pBuffer parameter to actually be a
buffer pointer on iOS, too, like on other platforms. Also, changing it
will mean the LibreOfficeLight app would need changing, too, and I
don't feel like doing that. But ideally, sure, that should be done.
2018-09-21 10:29:56 +03:00
Tor Lillqvist
95eb849217 Still more iOS app and related Online C++ code hacking
Re-think the plumbing between the different parts of the C++ Online
code. Do try to have it work more like in real Online on all but the
lowest socket level. Except that we don't have multiple processes, but
threads inside the same process. And instead of using actual system
sockets for WebSocket traffic between the threads, we use our own
FakeSocket things, with no WebSocket framing of messages.

Reduce the amount of #ifdef MOBILEAPP a bit also by compiling in the
UnitFoo things. Hardcode that so that no unit testing is ever
attempted, though. We don't try to dlopen any library.

Corresponding changes in the app Objective-C code. Plus fixes and
functionality improvements.

Now it gets so far that the JavaScript code thinks it has the document
tiles presented, and doesn't crash. But it hangs occasionally. And all
tiles show up blank.

Anyway, progress.

Change-Id: I769497c9a46ddb74984bc7af36d132b7b43895d4
2018-09-19 11:31:18 +03:00
Tor Lillqvist
7fd28d5676 Revert part of my iOS related commit, causes compilation warning with Clang
Won't actually be needed anyway, the way the code is going in my work
tree.

Change-Id: I4480ed59fe96ddcfad8483517f2a23452606f332
Reviewed-on: https://gerrit.libreoffice.org/60576
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-17 12:51:07 +02:00
Tor Lillqvist
87b85ff8f0 Be consistent in how we name "interface" abstract classes
We already use a suffix "Interface" for SocketHandlerInterface, so
rename IDocumentManager to DocumentManagerInterface.

Naming "interface" classes with an "I" prefix is C# and COM style.
Sure, that is a convention as good as any other, but let's try to be
consistent within this rather small code-base.

Change-Id: I9c356df327debd780f23ed2b2e6d6e630328861e
2018-09-12 19:27:23 +03:00
Tor Lillqvist
b59d160a08 Intermediate commit of work in progress on an iOS app
The app is unimaginatively called "Mobile" for now.

Runs but crashes pretty quickly after loading the document by the LO
core. Will need some heavy changes to get a ClientSession object
created in there, too, to handle the (emulated) WebSocket messages
from the JavaScript. It would then handle some of these messages
itself, and forwards some to the ChildSession, which in this case is
in the same process. Now the messsages from the JavaScript go to a
ChildSession, which is wrong. As the assertion says, "Tile traffic
should go through the DocumentBroker-LoKit WS"
2018-09-12 18:32:05 +03:00
Tor Lillqvist
290137c99b Bin unnecessary assert(loKit)
We already explicitly check earlier, after attempting to create it,
and log a fatal error and exit on failure.

Change-Id: Ia3fde4026839a255d4d19932300e16a05f9a33d2
2018-09-12 13:36:00 +03:00
Tor Lillqvist
d5f913486a Add a clarifying comment
Change-Id: Ia32b3ad65dd410e0f9f9d18c11be2d566ca0d6e0
2018-09-11 13:01:37 +03:00
Tor Lillqvist
3110bea2ea Add two missing values to kitCallbackTypeToString() 2018-09-10 19:55:29 +03:00
Tor Lillqvist
75438baa70 More mobile app stuff, very much early state of work in progress
Re-think Linux vs mobile ifdefs a bit. Use #ifdef __linux only to
surround code that actually is Linux-specific. Use #ifdef MOBILEAPP
for code that is for a mobile version (with no separste wsd, forkit,
and kit processes, and with no WebSocket protocol used).

Bypass UnitFoo for mobile. Possibly we do want the UnitFoo stuff after
all on mobile, to run in some special testing mode? Hard to say, let's
skipt it for now.
2018-09-10 15:13:43 +03:00
Miklos Vajna
9ed7c1065c common, kit, test, wsd: these parameters are copied for each invocation ...
... but passing by const ref is enough
2018-08-13 09:26:15 +02:00
Jan Holesovsky
ac7d67f43e Fix networking in the chroot.
The needed files were not copied, and consequently the hostname
resolution did not work in the chroot.

Change-Id: Id3dccc4f70cd1deeddb83c8e672f240e06748e34
2018-08-03 05:22:03 +02:00
Tamás Zolnai
c2a5f6acb0 Store number of tiles sent to kit for rendering
and use that info also to avoid sending to much tiles on the network.

Change-Id: Iab2d7af64693047a3c1cfe9f73de80a7100bbc13
2018-07-24 20:52:53 +02:00
Tor Lillqvist
a8b41b0cbb Log also when retrying the saveAs
Although, at least for me, after calling LOK's saveAs with an
intentionally bogus file extension 'file:///user/docs/u0.frobozz'
retrying with 'file:///user/docs/u0.frobozz.odt' does not work either.

Actually, I am not sure how useful this retry feature is as it is now.
If the user tries to save as some unsupported format, why can we
assume that maybe they want to save in some other format instead, and
possibly overwrite an existing file? Maybe the retry should be done
only if the file name to saveAs was without extension? But that was
already discussed in gerrit, I see.

Change-Id: I8bd4fbf241cb492d9654ae893af4baaf28b6b3a0
2018-07-11 12:15:26 +03:00
Michael Meeks
7e6e81eb46 Implement client websocket masking.
Disable this for easy strace debugging and a bit of perf. to the forkit.

Change-Id: Ia330582817481410d26df50db5eb42b4692ad01c
2018-06-15 14:54:19 +01:00
Ashod Nakashian
b9db83518b wsd: warn when we have no kits and we are not exiting just yet
Change-Id: I8c19dcea3eb900a989aebac7ef96793af31bdce8
Reviewed-on: https://gerrit.libreoffice.org/55576
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-14 17:05:46 +02:00
Miklos Vajna
d718b1c054 kit: let alphaBlend() take an std::vector<char> instead of raw pointer
So that it's more obvious that the two for loops don't read past the end
of the vector.

Change-Id: I49752c1bc316b6d73568ab334b07727ef60bdce5
2018-05-28 09:12:30 +02:00
Miklos Vajna
8f4c348be3 kit: let getPixmap() return an std::vector<char> instead of raw pointer
So the callers can know not only the address of the pixmap, but also the
size of it.

Change-Id: I3aecc33cb354f5878364b11398c276fcabd3103e
2018-05-25 09:11:54 +02:00
Miklos Vajna
51631b4e22 kit: remove unused using declarations
Change-Id: Ide76d327b3b064180aa4eaa28f13827d665edaa5
2018-05-23 09:14:04 +02:00
Michael Meeks
c5cef26fb6 Shutdown kit process if connection dies.
Change-Id: I34e627a03a9859ccd3ae9f9925fe6ab080697b72
2018-05-18 16:06:03 +01:00
Jan Holesovsky
6c31b7793c Post the message to the poll thread.
Change-Id: Ibd28090a420b5396b64fdfe676bef8cf06991116
2018-05-18 15:16:40 +02:00
Jan Holesovsky
6996139e5f Use correct path in the client websockets.
Change-Id: Ie0bf6646ff3f6e6cf99b505143a416c86a3a33b8
2018-05-18 15:16:40 +02:00
Jan Holesovsky
98ed24257b Move the functionality from connectToMonitor() to SocketPoll.
Change-Id: Iab2ac09638323f5e59f7a2ea0d880f52989ad64d
2018-05-18 15:16:40 +02:00
Jan Holesovsky
35ec3649bb Change Kit to use the new client websocket code.
Change-Id: Ib4e62ea618da5bd8992b51165b0d7ee955c61637
2018-05-18 15:16:40 +02:00
Jan Holesovsky
62df2c114f Revert "ChildSession: use NoFileSync as default during convert-to as well"
This reverts commit 684d730221.

Change-Id: I4500e09f678f889ee5ea35cb0f36896de1e11824
2018-05-10 09:51:38 +02:00
Jan Holesovsky
7f3c4b9dd8 Revert "kit: use NoFileSync flag for save"
Turned out this might corrupt .ods files...

This reverts commit d0d87401c1.

Change-Id: I251de8c7d450fffb3b13a3c8eccf3921eddb9f80
2018-05-10 09:51:36 +02:00
Miklos Vajna
7e9ba2e8c6 tdf#117077 kit: opt-in to embed images in HTML export
Changing the default in core.git has various up and downsides, so just
opt in for embedding here.

Change-Id: I3f8013800e3fdf759fcb09bce848e8754c8aa44c
2018-04-27 14:32:32 +02:00
Miklos Vajna
cb761748ed Avoid unnecessary copy-initialization
These are copy-constructed from a const reference but are only used as
const reference; make them a const reference.

Change-Id: Id193905b65224c2db4aab88999a92e60d3af3fdf
2018-04-17 09:13:54 +02:00
Michael Meeks
03bbe52665 Ensure the forkit does not have lingering threads after preinit.
Change-Id: I216a03a0ada628189355ebfd4016bf6033430eef
2018-04-16 20:04:23 +01:00
Tamás Zolnai
ffd7151443 Writer: View jumps to cursor position even if it is moved by an other view.
Need to get the viewid which moved our visible cursor, so we can check
whether it positioned changed by the owner of the cursor or not.

Change-Id: Ie7b1fafc8d8f11fba0c0b0d5f02d755e15284514
Reviewed-on: https://gerrit.libreoffice.org/52571
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-04-10 17:00:21 +02:00
Marco Cecchetti
89f37b5dd5 calc: drop down button marker
Change-Id: Ic069ad40e6749f43709760e7f4f0d96b39d5a4ce
Reviewed-on: https://gerrit.libreoffice.org/51598
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2018-04-03 21:42:27 +02:00
Marco Cecchetti
d887b08d60 calc: added support for hidden sheets and validation of cell content
Change-Id: I5db971b8826de7d5be2f88354925cd107082da77
Reviewed-on: https://gerrit.libreoffice.org/49112
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2018-04-03 21:41:22 +02:00
Tor Lillqvist
e9ea5e8bc7 Python is also a special snowflake
Change-Id: I1689f992494e1abe50c45b1ae975b76b00e1b080
2018-03-28 20:17:32 +03:00
Michael Meeks
ad21717498 Avoid copying most code into the chroot jail.
Last lingering bits are the xpdfimport import support and
some horrors required for NSS.

This requires a reasonably new core.

Change-Id: I2e08b841668722af0e3b947cf2b06687cca73b53
2018-03-28 16:38:10 +01:00
Tor Lillqvist
630d8d736c We want notifications from vnd.sun.star.script: thingies, too
Change-Id: Ic407bcc1a2534854812c2732cc262f859d4adfe5
2018-03-28 12:28:13 +03:00
Tor Lillqvist
bb4c1a7fa7 Don't filter out all scripts, just Java and JavaScript ones
Change-Id: I3054a3f36ae1777b162fb5a1b9a456f1bce9248b
Reviewed-on: https://gerrit.libreoffice.org/51991
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2018-03-28 11:18:43 +02:00
Miklos Vajna
684d730221 ChildSession: use NoFileSync as default during convert-to as well
This already worked for normal save, but not for convert-to.

Depends on core.git commit 0518bb5c3a98d973c3675fdd4cb8c52a669a3507
(desktop lok: handle NoFileSync in saveAs(), 2018-03-26).

Change-Id: Iec1a92fba2094f3954cc1a4ed6ee3372076fddc5
2018-03-27 09:20:50 +02:00
Michael Meeks
8f134aa1a9 Allow running without seccomp and capabilities.
There are some significant security trade-offs here which are now
at least configurable.

Change-Id: I1d879d69e91392f4ccf5db250a2277f53df60db7
2018-03-19 20:46:17 +00:00
Michael Meeks
6803ee4087 Use a hard random /tmp directory for document intermediates.
Requires a lok tweak to reset the tmpdir globals on init.

Change-Id: I602705f20fa016ef415088be8d1ada6d465d2a8d
2018-03-15 11:01:51 +00:00
Miklos Vajna
b6e1a4e281 kit: avoid manual management for Watermark::_pixmap
A simple std::vector is enough here and results in simpler code.

Change-Id: I7e6ad268aca13c4efb445c7918a3afd14e0ed146
2018-03-14 09:04:36 +01:00
Pranav Kant
c73026cdf9 postExtTextInputEvent -> postWindowExtTextInputEvent
Change-Id: If5612bffac612ca7f52c8eec242e5ad9984cd669
2018-02-27 19:16:17 +05:30
Ashod Nakashian
1c4b458158 wsd: send valid empty JSON response
Change-Id: I066c22dd0ccc64cb6a40b1ff260269b1bac2de37
Reviewed-on: https://gerrit.libreoffice.org/50149
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-23 16:55:23 +01:00
Pranav Kant
fc4d6aeeb9 ime: Don't eat space
Encode/decode so that ' ' as payload of compositionupdate event doesn't
get lost.

Change-Id: Ia31abe85f1cf19f8f286c9069097bdc72297e664
2018-02-21 21:29:50 +05:30
Pranav Kant
6d4f02ac2a Adapt to IME API changes; better reuse of Map's key handler
Change-Id: I670243ea155ac698c694531d3fc16a574f418bf4
2018-02-14 23:50:51 +05:30
Ashod Nakashian
b834545e79 kit: makeRenderParams now static
Change-Id: I1c79991a73044a91ed9f8389e23ccffd8b2bcbce
Reviewed-on: https://gerrit.libreoffice.org/49572
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-11 22:17:02 +01:00
Ashod Nakashian
2562d8919a ut: log the test name for easier traceability
Change-Id: Icbcbb36857b748c2ac2d0d36a5c4c23609f5453a
Reviewed-on: https://gerrit.libreoffice.org/49568
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-11 19:22:14 +01:00
Pranav Kant
ad1da235d3 IME support
Dialogs still need to be adapted to this. Only works for documents as of
now.

Change-Id: I0fb1114e279a9e563943f3f65dd5a577523e9841
2018-02-08 14:16:34 +05:30
Miklos Vajna
e76485d8b9 kit: spell out non-trivial autos to improve readability
Change-Id: I69b025b08a69c8780d40b39074d7d7abb12cc3af
2018-02-07 10:18:12 +01:00
Samuel Mehrbrodt
00dc0658d3 Missing capabilities: Add hint to check mount options
Change-Id: I946df0082b385b2eaaad9c23b9e5e7ac508f64aa
2018-01-31 11:45:03 +01:00
Samuel Mehrbrodt
e89584f933 Show info instead of error when linking is not possible
we still try to copy the file after this and fail if that doesn't work.

Change-Id: Ie37022b2454e71f4b1a92217e01e56e58070448b
Reviewed-on: https://gerrit.libreoffice.org/48907
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-01-30 14:33:51 +01:00
Michael Meeks
fbc28b91b3 Avoid copying code into the chroot if LINK_NO_CODE is set.
Change-Id: Ibba7dfa87c779b4d809cc2ac53d0802bba1c37ef
2018-01-29 15:12:05 +00:00
Pranav Kant
1d22f7bc54 kit: start spamming the logs when linking/copying is slowww
This is sometimes the case in docker when the link operation 'copies up'
things from lower layers to the working docker container's layer. In
such cases, let the admin know.

Change-Id: Ib72b67304a292c3832838379cc76bcb4a7268cb3
Reviewed-on: https://gerrit.libreoffice.org/48710
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2018-01-26 16:40:56 +01:00
Pranav Kant
c16d198560 Print humanized bytes in the logs
Change-Id: I2ebdea0c3a360be1573ae13fa9cbe6f432436f29
2018-01-26 20:03:22 +05:30
Henry Castro
90cd7791fa kit: remove unused debug code
Change-Id: Ibd69a2b451be0a075759524acff5f0e9fc820d05
2018-01-20 16:41:13 -04:00
Tor Lillqvist
eb2e62ebcd Fix misleading trace output: There is nothing called CallbackWorker::callback
Change-Id: I951d4a7706e0009b5a7266c86ea5b66a29242448
2018-01-17 12:35:38 +02:00
Miklos Vajna
d0d87401c1 kit: use NoFileSync flag for save
What LibreOffice sees as a save destination is just a temporary output
from the outside, so there is no point in doing fsync for that file.

This depends on core.git e90a16d71cdcfbd785401613a2e5a29cb1167acf (sfx2
store: handle NoFileSync for Save (not SaveAs), 2018-01-15).
2018-01-16 09:59:27 +01:00
Tor Lillqvist
457ec5b2b2 Use strdup() instead of fragile malloc+strncpy pairs...
...with manually counted string literal lengths even.

Change-Id: If11c65be25953b710a16d11e790d1b6d40119287
2018-01-10 16:09:41 +02:00
Tor Lillqvist
217636ed44 Drop meaningless "loolnb" word from a comment, drop two related #if 0 blocks
"loolnb" used to mean the concept of using non-blocking sockets back
when that was experimental proof-of-concept work in progress, but that
work has been merged in long ago and there is no neeed for the term
any longer.

Change-Id: I4c49b625fe8be8892b82115eaaa47bcba0f29500
Reviewed-on: https://gerrit.libreoffice.org/47699
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-10 13:01:26 +01:00
Ashod Nakashian
95af839fd9 wsd: trace first child's startup activity
To help debug early failure, log the first
child's statup at trace-level.

Change-Id: I8a6c8fe535bbc971174c0d950a2243460f81a2c7
Reviewed-on: https://gerrit.libreoffice.org/47628
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-09 13:06:48 +01:00