Commit graph

18300 commits

Author SHA1 Message Date
Miklos Vajna
a17894dbd7 fuzzers: avoid setcap
fuzzers use the code as a library, so we don't produce binaries like
coolwsd in such a config, leading to:

	Failed to set capabilities on file `coolforkit' (No such file or directory)

when building from scratch.

Just disable setcap in the fuzzers case, it's fine to not have these
binaries.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I178ec7d8fa4d582e5d7289764a6ce2227c049205
2022-06-01 16:27:46 +02:00
Rash419
08969b843e browser: contentcontrol: added picture type
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8ba68253954c9b2052a864c61923d376220861f0
2022-06-01 15:33:47 +03:00
Rash419
0e12c85fc9 browser: contentcontrol: added dropdown type
- added a new menu button 'form' in classic and tab button in notebookbar for content control

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ibe06667de39199fd2541fa70ced3ff879274366d
2022-06-01 15:33:47 +03:00
Szymon Kłos
1761e703f9 jsdialog: use correct codes for shortcuts CTRL + char
we should do the same for other modifiers: shift, alt

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I75933194aee82589c787c8c31cc47b66e96e2066
2022-06-01 14:14:32 +03:00
Michael Meeks
3e32d3d4d2 perf: better identical run copying while un-pre-multiplying.
Change-Id: I8958e9a072026e8c06c820dc1ab74b44bf12d87b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-31 19:06:28 +01:00
Michael Meeks
ec6431b088 deltas: 64bit copy & CRC for twice the construction speed.
Change-Id: I568abed80c1e571e7a65370b7b4b1049f52ab0b4
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-31 19:06:28 +01:00
Michael Meeks
647d2fd708 deltas: allocate a single chunk of pixels, instead of lots of rows.
Avoid std::vector and its peculiarities, also store the crc so
that we get the perf. win from it.

Change-Id: If39ab01b5b987d707d1712076ae9a5beb32b36c2
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-31 19:06:28 +01:00
Michael Meeks
f2df5d5ff0 deltas: re-factor deltaToDataDelta into DeltaData constructor.
cleanup accessor too.

Change-Id: I7db28780cc3394bc74f9967a1e2c2bbe0e01089c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-31 19:06:28 +01:00
Pranam Lashkari
e5651d0e1c annotation: unselect comment when cell cursor moves
problem solved:
some times when cell cursor is moved using keyboard,
comments were not unselected,
which caused problems when copying cell which contains comment.
i.e: comments were pasted inside the cell as plain text

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I318c850c25956d210ef9acfa631a689a4d1a71c6
2022-05-31 16:04:59 +02:00
Miklos Vajna
4433e03492 client session fuzzer: try harder to empty SocketPoll::_newCallbacks on shutdown
The DocumentBroker dtor adds a callback:

	#0  SocketPoll::addCallback(std::function<void ()> const&) (this=0x377dce0 <Admin::instance()::admin>, fn=...) at ./net/Socket.hpp:773
	#1  0x0000000000947db5 in Admin::rmDoc (this=<optimized out>, docKey=...) at wsd/Admin.cpp:544
	#2  0x0000000000bb8192 in DocumentBroker::~DocumentBroker (this=0x61900000e690) at wsd/DocumentBroker.cpp:579

So even if the fuzzer called Admin::instance().poll() on shutdown, there
was one more callback inserted to the list later, leading to OOM in the
long run.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I0832d839b098407fa9e8aadb6f84388a85d62323
2022-05-31 15:10:51 +02:00
Michael Meeks
9ebffaa172 fuzz: cleanup constructors.
Change-Id: Ib70ad1ea7a8badd479cf3a254d5561b54088efaa
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-31 15:10:51 +02:00
Pedro Pinto da Silva
278d9cd8ec Form tab: Add missing icons for control actions
copied from core

Signed-off-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
Change-Id: Ic22f4dd885094a268c755e1ebb60c157d775bf06
2022-05-31 10:49:27 +01:00
Michael Meeks
e71e78a479 perf: deflate optimize for speed not size for full tiles.
We have many fewer full tiles to compress - so we can
trade a bit of space for some speed. Really should use zstd.

Change-Id: I7c310608173c924f175154bf6f7abb43d5e6f08d
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-30 12:32:14 +01:00
Michael Meeks
39de4fcc8a perf: collect unusual logging code-paths somewhere else.
Change-Id: Ifa121bdcd054544a53934e41d7ea42a67bbc8a66
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-30 12:32:14 +01:00
Szymon Kłos
7ddd308a50 jsdialog: treeview keyboard support
- handle tab key
- handle enter key for entry selection
- change jquery into plain JS

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ia2f8d2d9c8c2dc52c75339c4f72734a5a3e770b7
2022-05-30 12:46:46 +02:00
Szymon Kłos
8174860cfa jsdialog: handle tab key in jsdialog popup fixes #4716
This added begin and end mark to the popup so we can detect
we are leaving the popup and we should close.

This prevents us from blocking the whole UI by focusing
map and typing before popup was closed.

Also close popup when server confirmed it should be closed.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I1a290e27dd7a14eca2cd3bb8368fee27255f51a8
2022-05-30 12:46:46 +02:00
Michael Meeks
7eb357544d Proxy: send explicit charset=utf-8
https: //github.com/nextcloud/richdocuments/issues/2196
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I4fce74290e8bf8a6681922a2165772933443703e
2022-05-30 11:32:27 +02:00
Pedro Pinto da Silva
85522f65e0 Formulabar: Make expander look like it's attached to input
Before the expander button was detached from input this in turn was:
- Making it hard to understand what that button will do
- Affecting the overall look and feel of the formulabar (different border-radius etc)

Signed-off-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
Change-Id: Id17742aae8b09acd3bdcbffd05fe17181492322d
2022-05-30 10:27:35 +01:00
Pedro Pinto da Silva
4a62ae6e06 Formulabar: Fix unotoolbutton juggling
Add expand toggle class to parent and use it to align unotoolbuttons

Before, there was no way to know if the input was expanded or not by just looking at container
or any parent. thus, no way to fix alignments per MultiLine status

Signed-off-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
Change-Id: Idddefc32812a3aab29ddb72c4d09bacd43b03287
2022-05-30 10:27:35 +01:00
Pedro Pinto da Silva
a892412d42 Formulabar: don't force img parent to be a certain size
some unotoolbutton was being set with the same same size as it's img child
 - There is not need to do this only for :not(.has-dropdown)
 - Make sure img has correct size, let parent element to adapt, no need to
 single out this case

Signed-off-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
Change-Id: I1c3734a81cb01a0d15604a2b88148a0f883a59d1
2022-05-30 10:27:35 +01:00
Dekota Nelson
ac587371af Removed unused CSS related to old formulabar. Signed-off-by: Dekota Nelson nelson.dekota@gmail.com
Signed-off-by: Dekota Nelson <nelson.dekota@gmail.com>
Change-Id: I8de68b8c09410026716860ba7a097ce76dc6ae3d
2022-05-30 09:47:28 +01:00
Pedro Pinto da Silva
c3130ecc96 Formulabar: fix sc_input_window height (when collapsed)
Formula input window (textarea) had different height from address input
- Set it at the same height as seen in toolbar.css:211

Signed-off-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
Change-Id: Id0fc3dfb0335183050eedc00036b85dbafe2d0b4
2022-05-30 08:21:53 +01:00
Pedro Pinto da Silva
d2f28a03be Fix formulabar width, use flex property
Avoid using percentages when we can already use the grow property
(it avoids different results across browsers)

Signed-off-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
Change-Id: I262cfdf5d72313296620e3e522bfa97ab2b00ca5
2022-05-30 08:21:53 +01:00
Michael Meeks
30e6f08147 perf: merge deltas and keyframes into the same storage.
Simplifies and accelerates the code.

Change-Id: I56b661e566efd75e3ed46918a481c26ddd5ca4c4
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-27 22:01:24 +01:00
Michael Meeks
2f2b8fb2b1 TileData: write unit tests.
Change-Id: I6ce29952800cf43d95c5572201269839b5426eac
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-27 22:01:24 +01:00
Henry Castro
e91168fc9c welcome: modify to listen view list changes
In order to get the list users and identify if it
is a guest user to not show the welcome dialog.

Change-Id: I439f46dcfd3ea5b307059952f98f49a387158e24
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-05-27 15:36:48 +03:00
Pranam Lashkari
f196b45046 fix: typing after idle
Reset document info on idle

resetting document info will force to use new status of the document

problem:
reconnecting after idle, user could not type anything in document,
this was due to some properties were to set assuming they existed from last session (i.e: clientzoom)
resetting document info will force to use new status message and set all the properties again correctly

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ibcf395eee3a4e0b99413de0178331d42a1354253
2022-05-27 13:25:53 +03:00
Szymon Kłos
cada83a778 Fixes exception introduced in:
commit 04187501c1
Unify ui switcher naming

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ic1ed669b270297fe200c3c92e38ea8f081bb1b4c
2022-05-27 13:25:53 +03:00
Michael Meeks
b830ca266e perf: don't send endless stream of updates/callbacks to Admin.
Change-Id: Ic4ac1f189706f5a9b409c91e2497e5a37692c333
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-26 19:53:11 -04:00
Michael Meeks
6de4eb865e socket: only wakeup the mainloop on addCallback for the 1st callback.
Change-Id: I96d9f0d46a5557ba464664456ec82605780f7de1
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-26 19:53:11 -04:00
Michael Meeks
92d3435dd1 Admin: improve smaps parsing performance.
We have around ~8k smaps lines for each process, polled regularly.

Change-Id: I7e78b17e52aeaec55fa17c5192a940aa9e44b045
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-26 19:53:11 -04:00
Pedro Pinto da Silva
74f39eb1b2 Fix Insertcontentcontrols strings on tabbed view
Don't use strings coming from uno commands as they include
"Insert":
1. There is no need to say that these actions will "Insert", they
are already in the Insert tab
2. All other actions do not have Insert so it would be not consistent
3. On top of that with Insert in each icon the labels look quite long

Signed-off-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
Change-Id: I286e95187d5df08cdf2d71bd99f3b77a17ef12ad
2022-05-26 11:38:05 +01:00
andreas kainz
6810f57dab btns var color name fixes
btns use var names that didn't exist

Signed-off-by: andreas kainz <kainz.a@gmail.com>
Change-Id: I13f2acbdd91cf05391da81adc721156d125f3de7
2022-05-26 11:20:38 +01:00
Michael Meeks
d3f5ba64c1 deltas: avoid interpreting a keyframe as a delta.
Just apply it and move on.

Change-Id: Ib15d4438f3c3e5c0d6996784a6cd64b061b20e1c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-25 21:24:20 +01:00
Michael Meeks
6483e1500a Enable deltas by default.
Cleanup some debugging, distinguish wsd/viewport delta fetches from
client-side tilecombines.

Update tests for deltas where they are expected.

Change-Id: I3dca09e4ceb094abf03db2aed2618f19351f3e28
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-25 20:31:06 +01:00
Michael Meeks
ae3ac0e4cd De-compress back-to-back streams using pako.
We concatenate several deflated streams back to back, and need to
decompress and apply each one by one.

Change-Id: Ic31f0eae27906f7817a877c98f4cd1e5ca4ee7f3
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-25 20:31:06 +01:00
Michael Meeks
c130231379 deltas: track, transmit and cache deltas (disabled for now)
Squashed from feature/deltas-expanded.

TileCache changes:
    + add montonic sequence (wid) numbers to TileData
    + account for sizes of TileData with multiple blobs
    + simplify saving and notifying of tiles

Sends updates (via appendChanges) based on the sequence the
right mix of keyframes and/or deltas required as a single
message, and parse and apply those on the JS side.

We continue to use PNG for slide previews and dialogs,
but remove PngCache - used by document tiles only.

Annotates delta: properly as a binary package for the websocket.

Distinguishes between deltas and keyframes we get from
the Kit based on an initial un-compressed prefix
character which we then discard.

kit can be forced to render a keyframe by oldWid=0

Track invalidity on tiles themselves - to keep the keyframe around.

    We need to be able to track that a tile is invalid, and so subscribe
    to the updated version as/when it is ready - but we also want to
    store the keyframe underneath any deltas.

force rendering of a keyframe for an empty slot in the TileCache.

force tile sequence to be zero for combinedtiles - so the client can
always request standalone tiles with explicit combinedtiles, or tile
requests.

move Blob to Common.hpp

use zero size for un-changed tiles.

remove obsolete render-id, and color deltas in debug mode.

cleanup unit tests for non-png tile results.

Change-Id: I987f84ac4e58004758a243c233b19a6f0d60f8c2
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-24 22:16:58 +01:00
Ashod Nakashian
c11fab5b78 wsd: browser: handle 413 Entity Too Large from storage
It seems at least some storage hosts report disk-full
errors via 413. This logic of handling 413 error as
disk-full was introduced in
f8e0b8c11e.

Here we handle 413 as it is defined, as Entity Too Large.

Change-Id: I61297c2fab9de663643336a6eba47949f82d1737
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-05-24 22:48:37 +03:00
Szymon Kłos
50f2dec7bc formulabar: added expand/collapse button
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I41625adc4d421a4ef0fa9c8ac88cf7f44a0f4787
2022-05-24 12:01:05 +01:00
Ashod Nakashian
dccdf9fafa wds: enable experimental blocks unconditionally
This enables code that was protected with
EnableExperimental in the socket logic (and one
case in DocBroker). These changes are now deemed
safe to enable permanently.

Change-Id: Ie62f5d7bd281ade90f38d654b51b104b8d1f14bc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-05-23 17:00:31 +01:00
andreas kainz
0b494b6db9 add icons lc_insertcontentcontrol and lc_insertcheckboxcontentcontrol
Signed-off-by: andreas kainz <kainz.a@gmail.com>
Change-Id: I3b9ffedcbd393c612d4763433736ef6b038e3b97
2022-05-23 11:44:02 +01:00
Gökay Şatır
c009faa205 Remove unused functions.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ifc5a4a5899e3e4ff26530e9b2f1794824e70f660
2022-05-23 11:37:14 +03:00
Andras Timar
7522caa888 typo: Hiddent->Hidden
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I08cae2b79de9c4c7d429e722dc5dbea6d3a9dc70
2022-05-22 17:55:20 +02:00
Gökay Şatır
835b6b10a3 Remove _moved function.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ica771fb38ea6523906d28b10fdc4842ac1d0e33e
2022-05-20 14:49:04 +03:00
Gökay Şatır
c56f73a915 Remove unused ObjectFocusDarkOverlay.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I430d0c4600ee74518e9442099530c754017fe3bb
2022-05-20 14:49:04 +03:00
Dennis Francis
a9b904c2f6 printranges: indicate them with dashed lines in grid
Read the print ranges for the current sheet from
LOK_CALLBACK_PRINT_RANGES message and draw dashed grid lines for the
rows/columns bordering the range.

Caveats:

* Desktop calc does not draw print ranges on document load if there are
print ranges set previously on save. Cool also has the same behaviour.

* If there are multiple print ranges in the same sheet desktop calc does
not show any dashed lines indicating the ranges. Cool also adopts this
behaviour for now.

* Styling of the dashed lines was not investigated much for writing this
patch hence it uses the same drawing style as normal grids.

Signed-off-by: Dennis Francis <dennisfrancis.in@gmail.com>
Change-Id: I318b679a232f2a6834d6e23278b24a9a96b70194
(cherry picked from commit eb94d9a864a37499e21dbd064e78e40fc20b2415)
2022-05-20 13:00:39 +03:00
Dennis Francis
ebf970fc4f calc: new callback LOK_CALLBACK_PRINT_RANGES
Signed-off-by: Dennis Francis <dennisfrancis.in@gmail.com>
Change-Id: Ia136c0675dbba51a53424916910219e8330764ac
(cherry picked from commit 817a4cd3f1f219a0d9caba129cbb3eca4fe31514)
2022-05-20 13:00:39 +03:00
Rash419
82eacd26bc cypress: skipping columns test in impress/table_operation_spec.js
cannot reproduce locally temporarily skipping the test

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I2007a2dc643306551be859b1bdcf48982fe4a33d
2022-05-19 13:33:20 +05:30
Rash419
f90fbe23bb cypress: added new function selectCellsInRange
after the jumbo sheet patch selecting entire row and merging all the cells becomes costly and cypress timeouts
therefore select first 100 cells and test the merging functionality

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8568bbdbabdccc55c2938f886619a1d178ae7d22
2022-05-18 19:14:07 +05:30
Miklos Vajna
feb19b588b unit-test: fix crash-on-shutdown
A problem since c6561a99d8 (wsd: test:
correctly stop SocketPoll in UnitTimeout, 2022-04-21), the trouble was
that calling UnitWSD::returnValue() from UnitTimeout::returnValue()
deletes the 'this' pointer, so we need to copy the interesting data
members to the stack before calling the base.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I86583ae516e2b2f367fbf5cb2a9401cc21f1b1cf
2022-05-18 15:41:30 +02:00