Commit graph

4030 commits

Author SHA1 Message Date
Henry Castro
b60f596a64 loolwsd: avoid getenv() nullptr
what():  basic_string::_S_construct null not valid
2016-10-06 15:02:13 -04:00
Henry Castro
0f86fde3e0 loleaflet: add .uno:AutoSum 2016-10-06 14:37:06 -04:00
Henry Castro
9b1087e000 loolwsd: test: .uno:AutoSum 2016-10-06 14:22:18 -04:00
Marco Cecchetti
fd3aba3be7 loleaflet: page-up/down - visible area is not scrolled as on desktop
Change-Id: Id6a61e93cd195cf731237961c0694685b2d497b4
2016-10-06 17:53:47 +02:00
Tor Lillqvist
c99379d67f The 'invalidatepreview' event handling seems to be unimplemented
No need to fire it if nothing happens. Just confuses a reader of the
code.

I don't really understand JavsScript events etc, so if I have
misunderstood something, feel free to revert.
2016-10-06 15:43:41 +03:00
Tor Lillqvist
e121e90f41 We don't use LOOLWSD_LOGFILE in any source code any longer
So no need to emit its definition to config.h.
2016-10-06 13:43:16 +03:00
Tor Lillqvist
3800c988b6 Don't claim log is available in a file if it isn't
Also, when it is, show the actual pathname from loolwsd.xml, not the
default.
2016-10-06 13:37:57 +03:00
Michael Meeks
39b2c725d9 Improve and standardize version details: display on start. 2016-10-06 11:18:50 +01:00
Tor Lillqvist
d7cabad884 We don't care that much about the distinction of TEXT vs BINARY frames
We shouldn't assert such details.

protocol.txt says:

    The WebSocket distinction between 'text' and 'binary' frames has
    no meaning for us for messages that don't contain additional
    binary data; such messages can be either 'binary' or 'text' from
    the WebSocket point of view even if we require them (the single
    line) to be UTF-8. In other words, an implementation is free to
    send such a single-line message as a WebSocket 'binary' frame, and
    the receiving implementation must treat that equally as if it was
    a 'text' frame.
2016-10-06 11:32:22 +03:00
Tor Lillqvist
7a3111632b Prefer string literals to pointless variables 2016-10-06 11:29:52 +03:00
Pranav Kant
2f59e19252 loolwsd: Also handle WOPI urls with spaces
URI::getPath() returns a _decoded_ path which was then being used
for the requests. This leads to failure for WOPI urls having
space in them.

Change-Id: I47bef643b09a919c56f9f0ec7b4dee8604dde089
Reviewed-on: https://gerrit.libreoffice.org/29536
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 06:00:06 +00:00
Ashod Nakashian
5b3e5f73a2 loolwsd: trade view creation and assert lock ownership
Change-Id: Ib593bec4d6e6b810d5f6cfb4bdf7d3f1212709b4
Reviewed-on: https://gerrit.libreoffice.org/29549
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:58:11 +00:00
Ashod Nakashian
c9349886c2 loolwsd: unittest cleanup
Change-Id: Ie5eca4a3d656b308932ead005788845d5ddf81fb
Reviewed-on: https://gerrit.libreoffice.org/29548
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:57:48 +00:00
Ashod Nakashian
d681d9b8d4 loolwsd: testGraphicInvalidate cleanup
Change-Id: I933aceb2873d393a93b942ccb13ab544aca4db9d
Reviewed-on: https://gerrit.libreoffice.org/29547
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:57:02 +00:00
Ashod Nakashian
ae2c5ba92b loolwsd: unittest cleanup
Change-Id: I4d7ff79a0d1c0993dfaf36d02df9adc46901a02c
Reviewed-on: https://gerrit.libreoffice.org/29546
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:56:30 +00:00
Ashod Nakashian
c542fde244 loolwsd: factor out getViewIds and broadcasting
This minimizes unlocking and relocking
on the LOK Document.

Change-Id: Ibe5045c82008df907dc329c1530cb50138b0c211
Reviewed-on: https://gerrit.libreoffice.org/29545
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:54:54 +00:00
Ashod Nakashian
f137a96d5c loolwsd: use less intrusive way of asserting lock ownership
Change-Id: I180cfc4effdf67e83ea4c4ca9958806d87d3f193
Reviewed-on: https://gerrit.libreoffice.org/29544
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:53:38 +00:00
Michael Meeks
e04cde4107 Avoid the returnValue hook - when not needed. 2016-10-05 23:24:23 +01:00
Michael Meeks
8a8323d0a0 More UnitPrefork cleanup.
Log data to std::cerr - so it goes to the log files.
Dump PSS / Dirty per child process for comparison.
Copy the child socket array before operating on it to fix a crash.
Add debug to ensure we are getting each child's true size.
2016-10-05 23:17:33 +01:00
Michael Meeks
d3daa2d9d9 Mend UnitPrefork.
Count pre-forked processes more correctly.
Use Unit's returnValue implementation to fix failure exit codes.
Accept new loolwsd.log socket as being authentic.
2016-10-05 22:38:07 +01:00
Andras Timar
fd1991a961 Revert "loleaflet: add 'Freeze panes' item to View menu of Calc"
This reverts commit 81f374a940.
2016-10-05 16:01:07 +02:00
Pranav Kant
198b41676f loolwsd: new viewinfo message test
Change-Id: Icf9c74006bf6ee15864a266fef5aa49003ca1a70
2016-10-05 18:48:53 +05:30
Pranav Kant
aa674fbdbd loolwsd: Set view id before calling documentStatus
... otherwise in some cases viewid that is set internally in core
is different from the one which is being loaded resulting in an
incorrect status message which then leads to lot of other problems as
well.

Change-Id: I8488d7d54b211a6b6f6028128f8dfc3388b73efd
2016-10-05 17:08:40 +05:30
Pranav Kant
d5fdb210aa loolwsd: Kill unused code
Change-Id: I7c8d16ce2358ca9ab41fcc57a8e9b9241b240150
2016-10-05 17:08:40 +05:30
Andras Timar
81f374a940 loleaflet: add 'Freeze panes' item to View menu of Calc 2016-10-05 13:21:53 +02:00
Andras Timar
f4731c6875 loolwsd: add a few more supported file types to discovery.xml 2016-10-05 12:18:34 +02:00
Miklos Vajna
5fe8c5969f lint-discovery: detect missing file types
Which are known by core.git, but not advertised by discovery.xml.

Change-Id: Ic11b34dabb25b21899055c461b2eb791bd81cab1
2016-10-05 11:47:54 +02:00
Ashod Nakashian
a0f6f4e41c loolstress: use new URI for loading documents
Change-Id: If811deffc4b7a9b2cf290b93d9f87a840e64dc4e
Reviewed-on: https://gerrit.libreoffice.org/29531
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-04 23:35:04 +00:00
Miklos Vajna
d8daaff1e9 WOPI discovery: change action name to 'view' when we can import the format
Also add a script that can detect if discovery.xml is no longer in sync
with the core.git filter configuration.

richdocuments.git d6b65b79835bc499f720d15bb6c00441079b2fd6 (Respect WOPI
action names, 2016-10-04) can launch a read-only loleaflet based on this
info.

Change-Id: I09232bb53844d0737dfdc66cd0e87342b9dd0fb6
2016-10-04 18:50:46 +02:00
Tor Lillqvist
c453f2626a Let's not use lcl_ prefixes here 2016-10-04 15:41:50 +03:00
Jan Holesovsky
a1e9c1eb42 Handle the Impress slide previews with low priority + unit test.
After processing a tile request for a slide preview, move the rest of them to
the end of the queue, so that other events are processed before we render the
next preview.

Change-Id: I82aa411406d6731b1c0bf3b849780220b5e68110
2016-10-04 14:25:52 +02:00
Tor Lillqvist
97adaf935b Don't let 'canceltiles' messages affect slide thumbnails being rendered
Document that the 'id' parameter of a 'tile' message is not (should
not be) used for anything except slide thumbnails.

If we later need some more generic way to distinguish the purpose of
tile requests, need to come up with something else, like a 'purpose'
parameter.
2016-10-04 13:31:36 +03:00
Andras Timar
b5f95c2aed loleaflet: add Insert Footnote, Endnote, Page and Column break to Writer menu 2016-10-04 11:21:10 +02:00
Tor Lillqvist
7a2a1b1b99 Add another FIXME rant 2016-10-04 11:04:36 +03:00
Tor Lillqvist
dba94a9c03 Avoid annoying line wrapping of cppunit output 2016-10-04 11:04:22 +03:00
Tor Lillqvist
f9a6ed93d5 Add FIXME rant 2016-10-04 09:21:20 +03:00
Tor Lillqvist
c46986166c The coding style here is to put 'else if' on one line 2016-10-03 22:31:10 +03:00
Henry Castro
e684089c89 loolwsd: force websocket close if client does not want to close
Even if sever send a close frame, the client could still send
more messages, but no close frame.
2016-10-03 14:36:02 -04:00
Miklos Vajna
3dbaae7f44 Util: avoid unnecessary copy
Change-Id: I773cc9bafc1593e125af2dbcd2471daf4685d125
2016-10-03 08:38:38 +02:00
Pranav Kant
7e57ae5dce loleaflet: Don't add these layers in readonly mode
Change-Id: I17437f53921dc3d5036be4a9650213a7eb0895dd
2016-10-03 11:16:32 +05:30
Pranav Kant
3fa2115fa1 loolwsd: security: Cleanup HTTP download request
Sanitize for some funny inputs.

Change-Id: I450cb5ed6e03e9809308e8f763af2c2a66fcecb0
2016-10-03 11:16:32 +05:30
Pranav Kant
700a310d35 loolwsd: Fix incorrect log messsage
This can be a POST request too.

Change-Id: I673fb94fc8a4b0cc09ed166f04dbad94ca2a041a
2016-10-03 11:16:32 +05:30
Ashod Nakashian
dba4d84010 loolwsd: new per-part tile invalidation unittest
Change-Id: I70c1b3d339bdd6dc017b3e09132e32ea0a2133ec
Reviewed-on: https://gerrit.libreoffice.org/29469
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-03 05:34:26 +00:00
Ashod Nakashian
23f7560bf1 loolwsd: fix and enable tile invalidation test for Calc
Change-Id: I105857026507ff3dedd798f66bcebcc111e6c072
Reviewed-on: https://gerrit.libreoffice.org/29468
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-03 05:33:45 +00:00
Ashod Nakashian
ce832fbc11 loolwsd: get the invalidated part from the callback directly
By default LOK doesn't provide the part where the invalidated
tile is. The part # is found using API, but due to the fact
that callbacks are processed asynchronously, the part #
may well have changed by the time the invalidation is
processed. This could result in buggy invalidations
where no modification took place.

With the new API flag LOK_FEATURE_PART_IN_INVALIDATION_CALLBACK
the part # is included in the callback, which is parsed
and used to inform the client with the correct part #.

Change-Id: Ibd85764bfdc41ebf1aae490df335bd503284ae91
Reviewed-on: https://gerrit.libreoffice.org/29467
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-03 05:32:45 +00:00
Ashod Nakashian
2907d802a5 loolwsd: cleanup and logs
Change-Id: I46eafb970ca144e7eb0837c80d790433cf1e151a
Reviewed-on: https://gerrit.libreoffice.org/29466
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-03 05:31:26 +00:00
Henry Castro
4074587a12 loleaflet: the cell view cursor displays user name 2016-10-02 16:46:30 -04:00
Andras Timar
e1e703c727 loolwsd: do not install 'unittest' binary
(cherry picked from commit 60834bfcec39755eebe73fe6a2d272e3a5ae59aa)
2016-10-02 19:01:28 +02:00
Marco Cecchetti
5edb4cb8c4 loolwsd: Calc: core and client could be on 2 different tabs
The check for the current part was done before set view on core to the
one of the sender message

Change-Id: If4b9264c981ecc4e858d23366045e42be603c7c4
2016-10-01 20:07:39 +02:00
Henry Castro
97fa8e45f9 loleaflet: fix error message localization 2016-10-01 11:35:19 -04:00