Commit graph

6683 commits

Author SHA1 Message Date
Andras Timar
3719faf5e9 loleaflet: remove latin access keys in parentheses (in case of CJK, Indian, etc. langs)
Change-Id: I15763165535771511a4871882dd067fc689baaa3
2018-07-16 09:04:05 +02:00
Andras Timar
d239a3b373 adjust paths of toolbar.js and unocommands.js
Change-Id: I0373f1a05d18a85d5e351fd11bf3b81c43367279
2018-07-16 09:04:05 +02:00
Pranav Kant
6f8b15dfa8 wsd: missing include
Change-Id: I561db86b4b46f1cff0d9f0c744c556d9ec74291f
2018-07-16 10:34:24 +05:30
Tor Lillqvist
0c425c82d3 Be consistent, no space before the '|' in LOG_BODY()
Change-Id: Iecab73efcb19562c5a7ebee506f13668b1a827c3
2018-07-13 17:51:21 +03:00
Tor Lillqvist
b4192de6fa Output '|' before the source file name in LOG_END(), too, like in LOG_BODY()
Change-Id: I57d825d03321992d680670f3560e951bc0cb2005
2018-07-13 17:49:21 +03:00
Tor Lillqvist
3a9e536dfa When asked to convert to PNG, look for an embedded ODF thumbnail first
Change-Id: Ib777572fe5f79b1cfdd95ec3a7f84484a13ae145
2018-07-12 19:27:54 +03:00
Tor Lillqvist
405b66c8db Add a cache of "thumbnails" (PNG images) generated using the convert-to API
When asked to "convert" a document to a PNG image, i.e. what one can
call a thumbnail, check if we have a cached PNG for the same docuemnt
already, and in that case return it.

When we have done such a convert-to operation to PNG, save the result
in the cache for later re-use.

This change adds no thumbnail cache cleanup mechanism. That will have
to be implemented separately using a cron job or whatever.

There are further improvement possibilities: For instance, if the
document is of a type that contains an embedded thumbnail (like ODF),
just extract and return that. For ODF that embedded thumbnail even
already is in PNG format.

Change-Id: I882efe97acc1d81041dc7a4ccb222995940e4836
Reviewed-on: https://gerrit.libreoffice.org/57345
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2018-07-12 18:27:23 +02:00
Tor Lillqvist
63a24e0082 Accept also localhost and IPv4-mapped IPv6 addresses
Change-Id: Ifc295d164276c0dd17592ff27066a522482fe04a
Reviewed-on: https://gerrit.libreoffice.org/57351
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2018-07-12 17:43:11 +02:00
Tor Lillqvist
b152e021b3 Drop noise output
Make prints the sudo setcap commands it executes, no need to
additionally echo "Set required capabilities".

Especially as "set" can be misunderstood as being in the imperative
mood, telling the developer to do something, instead of being past
tense telling what was done on the previous line.

Change-Id: I1138fa28a4d08b57d55552d0e012dcfd778b423c
2018-07-12 11:46:56 +03:00
Tor Lillqvist
3b4269a301 Use Util::symbolicErrno()
I think the general policy should be to always log errno using both
Util::symbolicErrno() and std::strerror(), never log a naked errno.
But only in cases where we know that it is highly likely that it is
the most recent system call that has failed, so errno makes sense.

Change-Id: I4a1fb31e375ea949e7da17687464361efe7c1761
2018-07-11 13:05:22 +03:00
Tor Lillqvist
40f4cf17c9 Add a symbolicErrno() function to Util
For a developer, it is much nicer to see "EXDEV" in a log than "18",
for instance. (Sure, we often also log strerror(), but might that
perhaps be localised? And the symbolic names are what one uses when
coding anyway.)

Change-Id: I456a8c2589147dcad87f1b4c3a20b3bd5a35d097
2018-07-11 12:54:27 +03:00
Tor Lillqvist
1c09d4a607 Improve logging a bit
Log all error: cases in ClientSession::handleKitToClientMessage(), not
just the case of cmd=load with kind= some password failure.

Change-Id: I53c959068f5642ae41157e8feb14fd34fc59dc9a
2018-07-11 12:33:42 +03: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
Tor Lillqvist
c852d9340b Fix the help message after my option handling changes last night
Change-Id: I9cc869b9957236803d41f3495eb1a444fa8ebad1
2018-07-11 11:35:59 +03:00
Tor Lillqvist
42e6a1e96d Make the loolconvert tool compatible with libreoffice --convert-to
Accept the same options, as applicable. Ignore irrelevant options
(like -env:userInstallation or --headless, but actually just ignore
anything we don't need). Handle options manually so that we can accept
them also with just one dash.

Drop superfluous verbosity. Succeed silently, as is The Unix
Philosophy (haha).

Change-Id: I05793b11886f61955db4746b864be97a6bef5674
2018-07-11 01:29:57 +03:00
Tor Lillqvist
bc0f76d6ad It's /lool/convert-to, not /convert-to
(But it doesn't seem to work anyway any more.)

Change-Id: I53261cd24d945dc47e156ff16240679beeb85f6a
2018-07-10 23:14:51 +03:00
Tor Lillqvist
32036fcadf We can pass a std::string directly to LOG_ERR()
Change-Id: I10027e680ad009eb04e44913323ca91c61821b87
2018-07-10 23:14:51 +03:00
Tor Lillqvist
a97c8c3455 Fis our use of inet_ntop() etc
We had:
    auto ipv4 = (struct sockaddr_in *)&clientInfo.sin_addr
even if the clientInfo variable itself was a struct sockaddr_in.

And then we also had:
    auto ipv6 = (struct sockaddr_in6 *)&clientInfo.sin_addr
which makes even less sense.

Instead, make clientInfo into a struct sockaddr_in6, which is big
enough to also to be interpreted as a sockaddr_in. Pass the address of
the correct field, either sin_addr or sin6_addr, to inet_ntop(). (Note
that sin_addr in sockaddr_in has a different offset than sin6_addr in
sockaddr_in6.)

At least on my Fedora 28, when I connect using IPv4, accept4() still
returns the client address as an IPv4 mapped IPv6 address, that is
::ffff:192.168.1.113 for 192.168.1.113. So the sample
net.post_allow.host value in loolwsd.xml.in should probably be changed
to have that ::ffff: prefix, too.

Change-Id: I0ad774616b210d94b904982e2f7dc928adc879ed
2018-07-10 23:14:51 +03:00
Tor Lillqvist
73dbf27ede The std::string compare() method is like strcmp(): it returns 0 on equality
Change-Id: I4d080afd98419cbdaa531cc6f2c306533bbc1737
2018-07-10 23:14:51 +03:00
Tor Lillqvist
c783485a3b The option is called "server" and not "uri"
(It's the parameter of that option that is called "uri".)

Change-Id: If247a932bf8879b4eb626d850e813c3e8d5a7d60
2018-07-10 23:14:51 +03:00
Miklos Vajna
8ad281e12f wsd: avoid unnecessary value parameter 2018-07-09 09:11:20 +02:00
Tor Lillqvist
72dfbc9594 Our zoom step factor is 1.2, not 2 as in upstream
This change makes the zooming animation of the document while doing a
pinch gesture (closing and/or opening) match the finger movement much
better.

(But sure, there is till lots of weird jumping around after finishing
the pinch gesture.)

Change-Id: I9d5affe653c1a0ebaebced54629bc9e8d9de5854
Reviewed-on: https://gerrit.libreoffice.org/57089
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2018-07-07 00:01:28 +02:00
Tor Lillqvist
ed69ecf81f Add Emacs mode lines to get the indent level right
It's irritating to have to manually align lines even when just adding
temporary console.debug() calls. Sure, these mode lines should be
added in all .js files; these are just some I happened to be touching
now.

Change-Id: I13b3a62e66e4430878713fd64a459c72c014ded1
2018-07-05 16:05:31 +03:00
Tor Lillqvist
26b5a3745e Better and more dynamic way to show ruler conditionally
Use conditional CSS, setting the ruler height to zero if it would be
too high. Now the ruler even shows up and disappears dynamically as
the window height changes, for instance when turning a mobile device
between landscape and portrait orientation. No JS conditional needed
after all.

Change-Id: Iebfbd182d1675f4d6abd2f252389fdcdf46ed4d3
2018-07-04 16:44:46 +03:00
Tor Lillqvist
1800a8ee17 Decide whether to display a ruler based on ruler percentage of window height
If the ruler would be over 5% of the window height, don't display it.

Change-Id: Ieed55318fc76dfe0f9248985b816e306b6654dee
2018-07-04 16:00:58 +03:00
Tor Lillqvist
23c7c7d2a9 Don't show the ruler if the window has too small height
Of course, for this to really be worthy of being called "responsive"
web design, we should update this decision also if the window is
re-sized dynamically, like when a desktop browser's window is
arbitrarily re-sized by the user, or a mobile device is rotated
between portrait and landscape orientation, or a mobile device enters
or leaves some kind of split-screen mode where another application
than the browser shares the display.

Also, it would be nice if the window height limit used here, 1280, was
some kind of global variable. (For width limits used to detect mobile
devices, we use 768 or 768px here and there in our JS code. (And,
interestingly, 767px, too.) Ideally this 1280 and those 768s should be
defined in some common place. No idea how to do that correctly in
JavaScript.

Change-Id: I02bb54f309bc116ae1a0b5264e72b9ba674f56e4
Reviewed-on: https://gerrit.libreoffice.org/56936
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2018-07-04 13:29:46 +02:00
Andras Timar
3f0f2c671c loleaflet: no fill or automatic color handling in color picker
Change-Id: Iab98aadf54f0c1b041fe46eb2be1a798662d935b
2018-07-02 16:53:16 +02:00
Henry Castro
68ce5cac97 loleaflet: disable default context menu, part 2
Change-Id: I92548bffdfd96811155560b77ff28e49f3289ba4
2018-07-01 17:49:34 -04:00
Henry Castro
43a7b465bf lolefalet: mobile mode, hide tooltips
Change-Id: I0bc1f10184f63318c483b590139d570380a47222
Reviewed-on: https://gerrit.libreoffice.org/56421
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-07-01 17:47:13 -04:00
Henry Castro
276e367977 loleaflet: set bottom position of tooltip
Change-Id: I2ff39ce70df1f87788b7d5a1233cd97d2d0af5d7
Reviewed-on: https://gerrit.libreoffice.org/56392
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-07-01 17:43:36 -04:00
Henry Castro
22416fc45c loleaflet: disable the overflow buttons on the formula toolbar
Change-Id: I788625dd5c7fbd96372a19f3cdbcbefdddeb51c8
Reviewed-on: https://gerrit.libreoffice.org/56059
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/56783
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2018-07-01 23:41:05 +02:00
Jérémie Lesage
238b754f2b add docKey in documents response 2018-06-29 18:10:25 +01:00
Jérémie Lesage
f084ea53f6 Ensure all sessions have a sessionId and are subscribed.
Simplify constructors, and factor out subscription code.

Change-Id: I4f3ed1eb06abec193d6db1f7c78815ffe1e1b5aa
2018-06-29 18:10:03 +01:00
Jan Holesovsky
46b4c62139 Cell borders: Implement the 'More...' button.
Change-Id: I3551cec69cf1e4dca02c0fcdbee23a4e06b1e36a
2018-06-28 21:39:46 +02:00
Pranav Kant
8156c2a8f1 wsd: in case of multiple query param, handle &attachment= correctly
In case of integration with OC/NC, we have WOPISrc= as query param used
for load balancing. So, the earlier approach failed with integration.

Change-Id: Ib73f4f18eaec870dd53b67886b1b6016416a2e78
Reviewed-on: https://gerrit.libreoffice.org/56531
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2018-06-28 18:45:57 +02:00
Marco Cecchetti
1580639831 On-demand loading of the page previews in the Online Draw/Impress
Change-Id: I56b1febd7f57324e878f06d417d2f58754e850fc
Reviewed-on: https://gerrit.libreoffice.org/56275
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2018-06-28 18:01:01 +02:00
Jan Holesovsky
9d4469a79b borders: This has to be global in order to have the event working.
Change-Id: I7a1f52c825905f4fe0ba33fdfd16cf979e3d378d
2018-06-20 13:31:04 +02:00
Andras Timar
a2a6c5990c fix indentation issues
Change-Id: I565fe5e46daa5c41d7ee0dc6921fd7d2039c4287
2018-06-20 13:31:04 +02:00
Jan Holesovsky
314164fa39 borders: Send .uno:SetBorderStyle with the appropriate params to the core.
Change-Id: I703dda35d3b412ff60602a6802b260d8709762fd
Reviewed-on: https://gerrit.libreoffice.org/56093
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-06-20 13:31:04 +02:00
Jan Holesovsky
8309734edd borders: Improve the look.
Change-Id: Ib7ca90285bb012a09f5fd2d867a3d588e831ec3a
Reviewed-on: https://gerrit.libreoffice.org/56092
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-06-20 13:31:04 +02:00
Henry Castro
77e913e46a loleaflet: add cell borders in Calc
Change-Id: I0105ee6c98b0eb043b60b56ea80007bae967df90
Reviewed-on: https://gerrit.libreoffice.org/56091
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-20 13:31:04 +02:00
Andras Timar
62a547cf52 loleaflet: updated UI pot file
Change-Id: Ia6c570b4d65d19e6fc3a0bfbcfd2c3479433030b
2018-06-19 09:42:59 +02:00
Adolfo Jayme Barrientos
f17a2d5f50 tdf#117496 Drop the word “Microsoft” per design team decision
Change-Id: I53206c0c2e94d2620b62e980ae9b90d9933bef1c
Reviewed-on: https://gerrit.libreoffice.org/54407
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-06-19 09:40:35 +02:00
Michael Meeks
a521527777 Fix logging a little.
Change-Id: I858ffb40e071eae3907eeff9c2d6291fd805dc02
2018-06-15 17:38:12 +01:00
Tamás Zolnai
30e4f586ec Hide text cursor while performing the zoom
Change-Id: Ic358b2f345ba4e1e1d826b6e2cc96b3cc53269d6
Reviewed-on: https://gerrit.libreoffice.org/55881
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-06-15 17:38:20 +02: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
Michael Meeks
5741d76a5d Outgoing websocket - remove silly stuff.
Change-Id: I53d763158007221e9df327ec9d3b07ad2029cbfd
2018-06-15 14:54:19 +01:00
Andras Timar
1fd5dbd787 Do not use the word 'Error' here (tinderbox)
Change-Id: If5bbfceb624974801ffb84e52e6aa1b7e599a7ae
2018-06-15 15:14:14 +02:00
Andras Timar
6c42c2bc91 redirect stderr of find to /dev/null, non existing search paths can be ignored
Change-Id: Icf2a77f8cd78da2f9d4ff7adc11308cb96464e65
2018-06-15 15:04:25 +02:00
Andras Timar
3984206b69 No need to load l10n framework for a page that appears for fragment of a second
Change-Id: Id23ab66fadb714316cdf73e93501b0cea870880d
Reviewed-on: https://gerrit.libreoffice.org/55850
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-06-15 12:34:16 +02:00