Commit graph

241 commits

Author SHA1 Message Date
Marco Cecchetti
a46fa588b1 calc: formula input bar: adding support for text selection handles
Change-Id: I6bc276945a7fd33f1358a3aa82ce0e7f45237771
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88090
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2020-02-06 15:58:36 +01:00
Ashod Nakashian
da0f3a950a wsd: per-user cookies
Cookies may be passed from the client to the storage,
in which case each user may have its own unique set
of cookies. These cookies are now preserved in the
ClientSession, which is per connection, and are then
passed to the storage to use when communicating with
the WOPI-like backend.

(cherry picked from commit 6022faf3cc9b622b490c3f8ca91efbff8e542414)

Change-Id: Ic2e13fa541a5ee01b7383939bbbf7d46ea75684b
2020-01-28 18:10:14 +01:00
Michael Meeks
9cef0f385d watermarking: create SessionMap template to canonicalize views.
Use a fully reliable uniqueness check, rather than a hash, and get
simpler ids as a bonus. Fetch view data from the session itself
rather than passing it in too.

Change-Id: Ibcd625156b5a98eb280e35d6537b5c8c026d0197
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86150
Reviewed-by: Mert Tümer <mert.tumer@collabora.com>
Tested-by: Mert Tümer <mert.tumer@collabora.com>
2020-01-06 13:52:29 +01:00
Marco Cecchetti
836ce7d636 formula bar: function complete
lok clients can request to complete a function name partially typed in
the formula input box.

Change-Id: If8e4485c5ed9f91a594dfcec04e0c0b10becdcd0
Reviewed-on: https://gerrit.libreoffice.org/83985
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2019-12-02 17:34:13 +01:00
Michael Meeks
84c218786b fix calc simple, single cell content copy; add origin to plain text.
Change-Id: I7a6b0c90a74f6e3a91a840bf77c0935a300321f2
2019-11-27 19:17:27 +00:00
Gabriel Masei
2164f5207c Add REST endpoint for admin metrics.
Change-Id: I701485631931334d27594c4907cb770f9888e5bf
Reviewed-on: https://gerrit.libreoffice.org/82492
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-11-25 13:06:01 +01:00
Ashod Nakashian
7c4ba459ff Encode the ExtendedData to make it safer while embedding in messages
Change-Id: I1d4bdb2775d89e9a52a96d833228ca8577ee3561
Reviewed-on: https://gerrit.libreoffice.org/83044
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-11-22 01:51:11 +01:00
Tor Lillqvist
c6497bda19 No need to "rescue" the clipboard in the iOS app
Change-Id: I805c14f2405eeed39127bdac29d7c93374ddc942
Reviewed-on: https://gerrit.libreoffice.org/83340
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2019-11-20 17:26:09 +01:00
Jan Holesovsky
efa293290c killpoco: Remove trivial StringTokenizer uses from some files.
Particularly those used on Android...

Change-Id: I47bf9692f5e99ba30140d698558472201168a198
Reviewed-on: https://gerrit.libreoffice.org/82302
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-11-08 22:21:31 +01:00
Ashod Nakashian
10ffdc1e4a testSaveOnDisconnect: sync after pasting and better logging
Reviewed-on: https://gerrit.libreoffice.org/80898
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 230fcd2f07192f30fb6d6671d905800fde71495e)

Change-Id: Iaacbe0bdc6a7ba88d2f09c343d9579315033acbb
Reviewed-on: https://gerrit.libreoffice.org/81569
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-10-29 01:43:17 +01:00
mert
86489d3dcd Include normalizedViewId to TileCache
Change-Id: Ib23afa023d79189f7fd7aca8b5b0e198c3011fbc
2019-10-15 18:13:03 +03:00
mert
2ee14aa148 Extend TileDesc with normalizedViewId
Change-Id: I92046106e346289240884632d6ec6e0da7b8eabb
2019-10-15 18:13:03 +03:00
Szymon Kłos
74ce4a9261 jsdialogs: send events to the core
Change-Id: I23a5a14b93bda205c9c276a697e58d1dc4147f0c
Reviewed-on: https://gerrit.libreoffice.org/80838
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2019-10-15 15:59:16 +02:00
Szymon Kłos
ca4351e6ef Revert "jsdialogs: send events to the core"
core not yet ready

This reverts commit 80ecaa60f6.
2019-10-15 14:06:08 +02:00
Szymon Kłos
80ecaa60f6 jsdialogs: send events to the core
Change-Id: I23a5a14b93bda205c9c276a697e58d1dc4147f0c
2019-10-14 19:18:07 +02:00
Andras Timar
d1ae1b36c2 typo fixes in comments and code
Change-Id: Idd98516d30d98dea18eda9bbec8ac9777063b553
2019-10-08 11:49:45 +02:00
Marco Cecchetti
8741339064 single msg for deleting multiple characters
Change-Id: I589dbc933e4450d5dbcf35e99b1a55598d3dee76
2019-10-03 14:50:17 +01:00
Ashod Nakashian
a93d8f1e1c leaflet: check that we are ready to render
On some mobile devices we can start rendering
when we don't fully have all our variables
initialized. The result is that we send to WSD
'NaN' and 'Infinity' coordinates and other
values.

To avoid this, we try to check that we have downloaded
and loaded all the JS files and that we have the bare
minimal map members in valid state before we proceed
with rendering. If not, we retry with a small delay.

Change-Id: I0c57da8829a830acf4e06ff6206c73debb54bfe6
Reviewed-on: https://gerrit.libreoffice.org/79920
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2019-10-01 10:13:05 +02:00
Ashod Nakashian
3dcc68e6f1 Pass Extended Data in Action_Save from the client to the WOPI host
Clients often need to communicate with their wopi hosts when
invoking Action_Save to provide more context when storing the
document in question. Action_Save now support passing arbitrary
string as ExtendedData entry that can be used by client to
pass any context or otherwise flags to the WOPI host, which
will receive it via the X-LOOL-WOPI-ExtendedData custom header.

See reference.html for more details.

Change-Id: I1814d1f3d984a553ffa60cec13d23b014ba59eb3
Reviewed-on: https://gerrit.libreoffice.org/74135
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-09-03 01:53:12 -04:00
Ashod Nakashian
d80fdefcbe wsd: don't use DocBrokers marked to be destroyed
There are cases when we do get client-requests
while we are about to unload and destroy
the DocBroker. This protects against the use
of partially-destroyed DocBroker (specifically,
when TileCache is already destroyed).

Change-Id: I963f2239fd62280e70b1938d3c6f653e8af91b1e
Reviewed-on: https://gerrit.libreoffice.org/74132
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-09-03 01:53:12 -04:00
Ashod Nakashian
30c3de53f7 wsd: support resizing of the sidebar
(cherry picked from commit d3a900d3484e4e6690d8c625f1edc73289baba4d)

Change-Id: If7d7b356563f503dfedfb0686c1d1b5be9b7b221
2019-09-03 01:53:12 -04:00
Ashod Nakashian
36b5109d21 wsd: cosmetic formatting
Change-Id: I552b2468432ce6ed52c50e22b6f19d8055c5dbb1
2019-09-03 01:53:12 -04:00
Michael Meeks
f384b8a414 Add watermark opacity setting.
Change-Id: I839e8aef91acfed40d4afd8c1b50176ed54c670a
2019-08-26 16:29:12 -04:00
DarkByt31
7850c944e2 tdf#107038 Poco::Timestamp replacement with std::chrono
Change-Id: I85e041a778f14071e55fa6bd05b7b145f7887c57
2019-08-26 16:29:12 -04:00
Henry Castro
2872bc7be9 post logs JavaScript runtime errors to the loolwsd server
Change-Id: Ic8ccff52d2f051ea6d31b6d2bfe08fc08ea4d8c2
Reviewed-on: https://gerrit.libreoffice.org/77849
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-08-20 18:24:04 +02:00
Ashod Nakashian
6d94b35c35 wsd: block save of read-only documents
WSD is responsible for checking permissions,
as we do with DisableCopy and DisablePrint,
but until now we allowed saving even on
read-only documents.

The reason, it seems, was that when we failed
to save a document due to disk space, we
set documents as read-only. So presumably
we still had to allow saving, so users
preserve their latest changes when the disk
has some free space. Meanwhile, we didn't
let users make further changes. At least
this seems to be a reasonable explanation.

Unfortunately this meant that we allowed
saving when the user had no permission,
or the document was loaded as read-only.

Now we no longer mark documents that fail
to save due to disk-space limitation as
read-only, and instead expect the client
to notify the user and (possibly) block
further edits. And read-only documents,
or users without write permission, are
no longer allowed to get saved.

This change makes sure that the ctrl+s
shortcut respects the read-only flag,
while we allow clients to disable
the default handler and decide what to
do (although now they cannot force saving
when the user has no permission, something
they could do previously).

Change-Id: I16c3b75fd3e54435d750948a25afd6f71c9f963b
Reviewed-on: https://gerrit.libreoffice.org/77594
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-08-17 04:44:51 +02:00
Ashod Nakashian
2eab5cea76 wsd: leaflet: support reordering of slides via drag-and-drop
Change-Id: I1b471ba07dd0a1016a0759de729171ae968262cb
Reviewed-on: https://gerrit.libreoffice.org/69635
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71099
2019-08-17 04:33:04 +02:00
Ashod Nakashian
8e118889cb wsd: leaflet: support statusupdate: messages to sync clients
This new message is identical to status: except it doesn't
imply (re)connection. It's unfortunate that status: is
assumed to be sent only when establishing connection and
loading a document, so we need a different notification
that can be sent at any time, without triggering
initalization logic on the client-side.

Change-Id: I9c804119aec292b873aeed132cc32f13c030d845
Reviewed-on: https://gerrit.libreoffice.org/69634
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71098
2019-08-17 04:32:09 +02:00
Ashod Nakashian
eaed3615bb wsd: loleaflet: select multiple parts
Primarily support for selecting multiple slides
to edit their properties together.

Change-Id: I96c7ec048668494b5b769677db6874df91cbb42d
Reviewed-on: https://gerrit.libreoffice.org/69631
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71095
2019-08-17 04:30:05 +02:00
Ashod Nakashian
226c2fe71c wsd: unify anonymization flags under one
This simplifies the anonymization configuration
as virtually always they are all either enabled
together, or not at all.

Change-Id: I6fe60f5287fc5d71cd7a6ac3268eac67e5e6e9fb
Reviewed-on: https://gerrit.libreoffice.org/70033
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71090
2019-08-17 03:42:19 +02:00
Tor Lillqvist
a158686422 The SavedClipboards stuff presumably makes no sense for MOBILEAPP
It seems to be strongly related to HTTP things at least in error
handling. So bypass as cleanly as possible in the MOBILEAPP case for
now.

Change-Id: If9540f166293635513a3ab06371f01ad381a8cb2
2019-08-12 13:20:52 +03:00
Miklos Vajna
1263694944 common: wrap ShutdownRequestFlag in a getter function to avoid ODR violation
Otherwise both loolwsd and unit-copy-paste.so would have a
ShutdownRequestFlag:

==13663==ERROR: AddressSanitizer: odr-violation (0x00000208f860):
  [1] size=1 'ShutdownRequestFlag' ../common/SigUtil.cpp:60:19
  [2] size=1 'ShutdownRequestFlag' common/SigUtil.cpp:60:19
These globals were registered at these points:
  [1]:
    #0 0x5f9a18 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0x7f9b903f1d0b in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60ad0b)

  [2]:
    #0 0x5f9a18 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0xe2b9fe in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2b9fe)

Change-Id: I247760325f804813249e814dbb4576493619dee7
2019-08-12 09:03:42 +02:00
Tor Lillqvist
c1ebc62c3a Fix build for MOBILEAPP
The iOS app does not work any longer, though. Hits an assertion failure.

Change-Id: Ia135c12a79427e5c2b6c3c98adef4c354d1ceb68
2019-08-07 14:41:37 +03:00
Michael Meeks
617a5d69b0 Account for a state change race.
We can have un-processed incoming mesages in transit after a local
transition to WAIT_DISCONNECT including some that change state.

Change-Id: I577aebbc0a6ecca695f4bc35b4d226e1a465817d
2019-08-06 14:50:52 -04:00
Michael Meeks
80fb9ac96f clipboard: unit tests need clipboard tags during init.
Ensure we always have a valid clipboard key at start.

Change-Id: Ia2d37e038d8baa877d147f507a5ff4c867f55813
2019-08-06 14:50:52 -04:00
Ashod Nakashian
d12227c839 wsd: send clipboard key on loading
While we don't send the clipboard key
to the client during the construction
of ClientSession, we do so upon handshake
(loolclient message), and by then our state
is no longer DETACHED, rather it is LOADING.

This restores copy/paste across documents.

Change-Id: I0db50210f232afa05b1273edeb2cc163fd07c504
2019-08-05 22:21:54 -04:00
Michael Meeks
9e791fb0d4 clipboard: persist selections for a while after a view closes.
re-factor ClientSession state to be a simpler state machine.
Have a nice disconnect / disconnected handshake on view close.

Change-Id: Ie933cc5c7dfab46c66f4d38a4d75c459aa1cff87
2019-08-05 22:21:54 -04:00
Ashod Nakashian
2492faf225 wsd: add 'meta origin' to clipboardcontent payloads too
Change-Id: I61233fd9b2559a28a0da67dd0a869e97c8b34da7
2019-08-05 21:58:10 -04:00
Michael Meeks
eeff5ee173 clipboard: include /lool/ into the clipboard base URL.
Helps older load-balancers.

Change-Id: Ibc1529a5784bb7fe6e11f914f4ee01cd1bae52a2
2019-08-05 21:46:39 -04:00
Michael Meeks
fbd021958b clipboard: de-combine whole clipboard fetch from just text/html.
Now we can copy/paste smileys internally again.

Change-Id: Ibc6c77ccb9c501230947a7172cf591b2e12531b3
2019-08-05 21:44:29 -04:00
Szymon Kłos
18305c8a44 Request text/html in get clipboard
Change-Id: I9096fb2470da0255722f58bdeaeba87fcae3511d
2019-08-05 21:38:01 -04:00
Michael Meeks
b3415abea0 clipboard: test two separate views' clipboards.
Change-Id: Ie6f2eeb1f1dd3c762cca847f4c77a5cd7d39f70a
2019-08-05 21:36:49 -04:00
Szymon Kłos
3fab8a9937 Fix crash: Send bad request when no data
Change-Id: I705c47925b1e44bf7b112325f06c915e841dab2a
2019-08-05 21:28:09 -04:00
Michael Meeks
3c42f3525a Rename to clipboardkey.
Change-Id: Idba1d839e75a5525a8b0e71b9aecff17b8aa05e9
2019-08-05 21:21:45 -04:00
Michael Meeks
13469e8b00 clipboard - set it with a post now.
Change-Id: I6b9234988185984335408da502f479ccda8a95a7
2019-08-05 21:18:44 -04:00
Michael Meeks
9726ce6f77 Various copy/paste fixes, unit test passing, parsing of result.
Change-Id: I9168853dd011e86896c3bd474a4d05ee82c0e336
2019-08-05 21:18:12 -04:00
Michael Meeks
c7956349f6 More work getting the unit test closer to passing.
Change-Id: If2ec0d5465a84e11dec1f5c5b9839a369b393784
2019-08-05 21:16:37 -04:00
Michael Meeks
245e509413 clipboard: start of rotating clipboard key management.
Change-Id: I8caab267ec5391e2cd7cb20907fa080111cc70dd
2019-08-05 21:16:37 -04:00
Ashod Nakashian
da455c486a Serve a decidedly unpretty clipboard download page
The initial bits to serving some page with provision
to ingest the different formats into a table.

Doesn't yet link with the actual document, but it's
a start.

The link will have some unique id(s) in it to
reference the document in question, which will
be some hash (possibly changing with some logic for
security reasons). This hash will have to be
something valid that WSD will use to locate
the DocBroker in question, connect to it and
fetch the formats supported and generate unique
links for each. When the user clicks on a link,
the contents will be downloaded in the given
format and copied to the user's clipboard.

The clipboard.html template is based on loleaflet.html
as we're very likely to use the same customization,
branding, localization, and javascript bits.

We would probably want to add a brandable title
with logo etc. and possibly some more reasable
background (ideally, an image enlarged and blured
to give the page some semblance of having content).

Change-Id: If0550184d4423bef1e98fecbb072bdf8df07701b
2019-08-05 20:26:13 -04:00
Michael Meeks
c36da1cd97 Implement getClipboard and start of a unit test.
includes Change-Id: I47d38f9285c855dcc6fbeeb73d35f22a46a30c05

Change-Id: I60b84bef1cf832ec5c191d664afd90a080b7ffbc
2019-08-05 20:25:49 -04:00