Commit graph

8664 commits

Author SHA1 Message Date
Szymon Kłos
501229d939 Send uno:Paste after success of 'set clipboard'
Change-Id: I88636c87bb80fe0f2ed2f34eb3c84781821194a9
2019-08-05 21:28:09 -04:00
Szymon Kłos
610c2aaf23 Fix ParseError on valid data
Change-Id: I0706030d9933313e44ae89b92b62576dacbf7e9e
2019-08-05 21:28:09 -04:00
Szymon Kłos
7f6af05213 Sync request with clipboard parser
Allow to use multiple clipboard streams.

Change-Id: Ib98a7c1db8738145138fa3657e94c404260e4a28
2019-08-05 21:28:09 -04:00
Szymon Kłos
6533efaebd Send POST request to set clipboard
Change-Id: I1f700e142d40e266a461e573a0561518392a0555
2019-08-05 21:28:09 -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
Szymon Kłos
a2e3fdb3ae Use correct clipboard name to allow save the key
Change-Id: I47c2dfe6676ceb9ca6638c9de24bd72411ff88df
2019-08-05 21:28:09 -04:00
Szymon Kłos
dbca23ddac Fix Clipboard initialization
Change-Id: I65254de5a04a9683373edb23a4bbf7dec546ce21
2019-08-05 21:28:09 -04:00
Szymon Kłos
7ba9b09fd1 Send all available paste formats
Send as a string for now:

mimetype=xxx\n
length=xxx\n
[string content]
...

Change-Id: I648c01d86d25a88cab16294063764110bc05151f
2019-08-05 21:28:09 -04:00
Ashod Nakashian
26303bf340 Add complexselection message
Change-Id: Iecf5d96451e2548e6a44edac164096bca57139a8
2019-08-05 21:28:09 -04:00
Michael Meeks
fb2507bd3c Re-factor more of clipboard related bits into a single place.
Change-Id: Ie7392de9e63201e3c62e505c0b9292782a418fea
2019-08-05 21:23:44 -04:00
Michael Meeks
3c42f3525a Rename to clipboardkey.
Change-Id: Idba1d839e75a5525a8b0e71b9aecff17b8aa05e9
2019-08-05 21:21:45 -04:00
Michael Meeks
229ca09419 Start of separating clipboard code to Clipboard.js.
Change-Id: I59ba0c093002cb60b13d2f71a4801e76f6a94b2a
2019-08-05 21:20:21 -04:00
Ashod Nakashian
e7cec81846 Fix build - potential use before initialization
Change-Id: I5d9db13b0241af64fa8e9eb9528a6e460166f280
2019-08-05 21:18:57 -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
15af6cf042 clipboard: test for set-clipboard endpoint (disabled).
Change-Id: I3bc31dfb231aaacc01ddd717b39abdebd26a76bb
2019-08-05 21:18:36 -04:00
Michael Meeks
4347883c65 clipboard: add more unit tests.
Change-Id: Id1841935927e451e6aa15489c303dd9f01ac21b4
2019-08-05 21:18:31 -04:00
Michael Meeks
149b861975 clipboard: a more helpful calc test.
Change-Id: Ibe0e583a2019e7bc5968dd8f73cf4e4a07d363b2
2019-08-05 21:18:27 -04:00
Michael Meeks
ba4907b791 clipboard: factor out parsing, and add checks in unit test.
Change-Id: I8c23b10769293b07cc94fdc0d6110e9d540a16b9
2019-08-05 21:18:20 -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
Michael Meeks
7f4a7404cc Add hard random/hex key generation utility.
Change-Id: I8bb95153a5bd63a6b41edf65a0fdf0ebd52ad070
2019-08-05 21:08:07 -04:00
Michael Meeks
4a9de331ed Unit testing - add more hooks and helpers.
Change-Id: Ieb12699e3b012606eaa0be3cc94d6f9b58adc441
2019-08-05 21:08:01 -04:00
Michael Meeks
f25d9eb10e fixup d3887f7a94
Change-Id: I26cbe5cfa226465114608d6960c6ffaec96dddbf
2019-08-05 20:48:50 -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
Michael Meeks
d3887f7a94 handle web clipboard request. 2019-08-05 20:06:54 -04:00
Iván Sánchez Ortega
8440e286cb Calc: Update clipboard container only on 'celladdress', not 'cellformula'
Change-Id: I5e3f4eb56447060a54751172bd9d891c88a593fe
2019-08-05 19:23:07 -04:00
Michael Meeks
8c80c08729 Add clipboard debugging to our options.
Change-Id: If0e0ced9d9a6e44cc7ba5f390604cc10fd869a52
2019-08-05 19:21:13 -04:00
Marco Cecchetti
3c3a3ee204 loleaflet: copy/paste: upload widget and cross copy/paste widged
Change-Id: I9042b8263d9af51897ed7ba7488fe6399561b965
2019-08-05 19:15:36 -04:00
Marco Cecchetti
fdc5d259ea loleaflet: download widget skeleton for larger copy/paste data operation
Change-Id: I64d8edc014241e94c45677185a935714b8eeb192
2019-08-05 19:15:28 -04:00
Szymon Kłos
94b80a5f13 Add copy paste warning also in mobile
Change-Id: I00357d432ad6d4a05be6494a8bb058dd1793a5ff
2019-08-05 17:06:45 -04:00
Jan Holesovsky
14fa2dd346 Make the (JS) context menus work again.
This was removed by mistake, and caused that no .uno: command was ever
sent to the core.

Change-Id: Iecf050f09bc2a22b936abf49315d4a9d0fbb364a
2019-08-05 17:06:37 -04:00
Michael Meeks
75925bb53d Don't disable Paste based on incorrect server side data.
Leave it always enabled.
2019-08-05 17:04:34 -04:00
Michael Meeks
f2478adb44 Restore Copy/Paste context menus and use execCommand to do it.
Move the warning dialog to the Clipboard helper for now, and show on
failure.

Change-Id: I073248e8959d20b12bc6d3dafd5e81287f759862
2019-08-05 17:04:09 -04:00
Jan Holesovsky
a636f4e91c The Internal Copy / Internal Cut / Internal Paste is just confusing.
Every user so far is confused of the existence of two clipboards - the
system one, and the Online internal one.

We are able to detect that the copy / paste is happening inside the
document and perform the "internal copy / paste" accordingly, so let's
do what the other online office suites do, and just warn when the user
tries to access copy / paste from the menu.

Change-Id: I904fc120fcf65b8ad4ba8fb5178803f976d707f4
2019-08-05 17:01:57 -04:00
Michael Meeks
8c1f97a92d Work around Safari behavioral difference with contenteditable. 2019-08-05 16:57:39 -04:00
Michael Meeks
52e477e57e Switch to text/html for paste where we can.
Build special URLs to detect the same host being in-use, and much more.

Change-Id: I0ca639ea416cb78bf5e5274eac4400542b6b2cda
2019-08-05 15:47:47 -04:00
Miklos Vajna
003c98ff93 fakesockettest: respect CPPUNIT_TEST_NAME
This was running unconditionally.

Change-Id: I3de4241230d0f06f7836756e2d9b7fdf84d3477f
2019-08-02 09:57:20 +02:00
Miklos Vajna
773080eb74 Fix failing HTTPWSTest::testInactiveClient()
It seems to me that in this case the test was poor, if other
invalidation types are expected, then this one should be fine, too.

Change-Id: Iae7597eef081acdfb5d6f9152747204a71bd2b66
2019-08-02 09:35:20 +02:00
Samuel Mehrbrodt
119eb7b86f Remove space below ruler
This breaks cursor positioning with the mouse.

Was introduced with 0576a3cced

Change-Id: I85abca224d2bc9d365443bd87c6793db1900e2a4
Reviewed-on: https://gerrit.libreoffice.org/76578
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-07-30 09:27:45 +02:00
Tomaž Vajngerl
42c4c864fe tdf#125425 add cell selection markers and cell auto fill marker
This replaces the standard text selection marker with a cell
selection markers to resize the cell selection. This looks and
behaves better for cells in Calc and it is also easier to deal
with.

Additionally add auto fill marker to perform the auto fill action
on the cells. This was not possible to do previously unless you
hit an invisible part of the cell selection, which is not
convenient when using touch.

Change-Id: Ia02d03b7b8e8d98412ea98eb92fb47d1505ef979
Reviewed-on: https://gerrit.libreoffice.org/76494
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-07-29 08:51:55 +02:00
Michael Meeks
f2c6facb29 Don't combine tiles a long way from each other.
We currently combine only horizontally, but ctrl-right arrow in
calc can throw us to the other side of the sheet, creating a very
large area to re-render.

Change-Id: I7125ab815e3de1296b3af32632626005eeee0ec9
2019-07-26 10:12:00 +01:00
Jan Holesovsky
82bcd8db73 Add a comment where the HULLO response is handled.
Useful for git grep HULLO :-)

Change-Id: Ia7696f91f6452aaab6df95b640ac361b4904d4b5
Reviewed-on: https://gerrit.libreoffice.org/76300
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-07-25 13:03:09 +02:00
Henry Castro
393db38ce2 kit: take ownership when saving a document template
Otherwise, it causes error log:
ERR  Cannot save docKey [/filename], the .uno:Save has failed in LOK.

Change-Id: Ic99807848def72f76471c4f999ebeed9a7c0a2c8
2019-07-25 07:59:24 +02:00
Jan Holesovsky
635f0627f2 Fix build.
Change-Id: I3e7dc00a8acdaf0ad1a07c0cd55ff7bff7b64295
2019-07-25 07:58:19 +02:00
Henry Castro
760864870f wsd: introduce "TemplateSource" WOPI property
Change-Id: I9df1d5d0d4be7fe10ee15c40c36195c86ccf857e
Reviewed-on: https://gerrit.libreoffice.org/76190
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-07-24 12:10:15 +02:00
Tor Lillqvist
f7a70ba9d3 tdf#125681: Get rid of ChildSession::getDocumentMutex() and associated code
Now with the "Unipoll" concept all this locking is unnecessary as the
kit process is single-threaded, and actually it is harmful as the bug
shows.

Michael explains in chat:

But in fact - we should be a single threaded kit process there now. We
are protected by the solar-mutex (which is recursive) while our
locking is not. This was the whole point of the Unipoll refactor: to
remove the extra threads, complex queues, etc. etc. I just left the
mutexes. Even a recursive mutex won't work there; since it needs to be
drop-able and transferable to another (LOK internal thread) in Yield,
so - we should remove them.

Change-Id: I7d1e1dfb0e20f14134be5f81da057539b0f86ab9
Reviewed-on: https://gerrit.libreoffice.org/75849
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-07-24 12:09:24 +02:00
Samuel Mehrbrodt
3dd8364056 Font list empty in some cases
The list of font sizes was taken from the font info. This causes
problems when the document uses a font which is not available on the system.

As there is no obvious reason, why the list of font sizes should depend on the font
(and update with every font change), remove this dependency and just populate
the list of fonts once.
If the document uses a font size which is not in the list, it still will be added to
the font size list.

Change-Id: I4d434244b341c8e782138e5a6df85a50ddad3df5
Reviewed-on: https://gerrit.libreoffice.org/75959
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-07-24 07:43:17 +02:00
Jan Holesovsky
68b33ba7f2 android: Load the document only after we've got the permission.
Without this, the first start was failing, there was only a black screen
and the request for permission.

Change-Id: I7929048ca51b044dcb574f48bd2b7bc9a27e0ec8
2019-07-23 14:20:25 +02:00