Commit graph

22967 commits

Author SHA1 Message Date
Ashod Nakashian
5a82c36680 wsd: move ClientRequestDispatcher to own file
This moves ClientRequestDispatcher and all
its direct exclusive dependencies to its
own file and adjusts formatting.

No functional changes were performed,
although namespaces were restored and
other minor changes were done for
consistency.

The resulting file is still rather large
at around 2000 lines, but that makes
COOLWSD.cpp smaller by about 30% now.

Change-Id: I59bcd997ad08702ce7029c6791095e75ad9b23b0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-21 20:13:39 -05:00
Marco Cecchetti
5208c93e9b calc: on tab switching document view can be restored to a wrong position
In calc when a tab is moved to a new position or a sheet is inserted
or deleted, saved positions in SheetSwitchViewRestore which are used
to restore the correct document.
position when user switches back to a tab are no more valid.
In fact the internal map: sheet index -> sheet position becomes wrong.
This patch takes care to update such internal map when one of the
listed event occurs.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: Ia4587b14179a35ff369d1f030657c4e5c64f5715
2024-02-21 19:47:10 +01:00
Marco Cecchetti
b14dfa20bb calc: on tab swithing do not replay print twips messages
From CanvasTileLayer._saveMessageForReplay description:
"We will not get some messages (with coordinates) from core when zoom
changes because print-twips coordinates are zoom-invariant. So we need
to remember the last version of them and replay, when zoom is changed.
In calc we need to replay the messages when sheet-geometry changes
too. This is because it is possible for the updated print-twips
messages to arrive before the sheet-geometry update message arrives."

The problem is that after switching to a new tab it could occur that
some of these stored messages are replayed on the new sheet even if
they were related to the previous one.
So for instance if in the old tab there is a cell selection we could
end up try to select such cells in the new sheet too, and even if such
selection is successively cleared by further message specific for the
new sheet, such message replaya was causing an unexpected document
scroll.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I63995aaa51c25216abd246551fbd2ec437a3f6de
2024-02-21 19:47:10 +01:00
Aron Budea
c0b65318f2 Bump baseline to C++20
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I8201175e83eba549f22aaeb935cda46a712ec492
2024-02-21 18:28:47 +01:00
Szymon Kłos
ee43390e71 jsdialog: send less messages for scrolled window
- send new scroll position only on change
- this reduces a lot network traffic and makes
  it more quick

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ifd4f3ecca2e826c3350d19e377cc265dbde563fe
2024-02-21 15:16:14 +00:00
Méven Car
5dcfea4ad7 Fix function wizard dialog
Signed-off-by: Méven Car <meven.car@collabora.com>
Change-Id: If92f27e54c5da3b09145d019c86076d6fa9373b3
2024-02-21 15:16:14 +00:00
Méven Car
dbfe0e880a Adjust size of custome properties dialog
Signed-off-by: Méven Car <meven.car@collabora.com>
Change-Id: I5a7020db5b9dbb2f8bccfbe9da491111459a6f65
2024-02-21 15:16:14 +00:00
Méven Car
f17328de63 custom properties: adjust spacing between fields
Signed-off-by: Méven Car <meven.car@collabora.com>
Change-Id: I0a8cdd565d725e5668adce427d89fbf74e935f70
2024-02-21 15:16:14 +00:00
Méven Car
5b03c12b93 Widget.ScrolledWindow: allow to resize based on content
Add a smoother scroll taking into account the row height of the data to
adapt the scroll height accordingly.

Signed-off-by: Méven Car <meven.car@collabora.com>
Change-Id: I96cf56367b80ca22f75b074e32ebff97eedeb0ab
2024-02-21 15:16:14 +00:00
Méven Car
e849af2666 Add Css rules for custom properties fields
Signed-off-by: Méven Car <meven.car@collabora.com>
Change-Id: I4b57a1c04dc67620f4ee010e17fff4f9e677d0de
2024-02-21 15:16:14 +00:00
Andras Timar
cbc32dc38e fix unconditional install-data-hook
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I3236d8ebb323b7d682e58c01da4ad8ec01ee943d
2024-02-22 00:26:23 +10:30
Hubert Figuière
bc5c2d56c5 calc: Don't use es6 let and () =>
This was introduced by backport #8271 of the sheet protection

Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I07a9fd428b11042ce191a5c7a48d53400253c445
2024-02-21 13:44:32 +00:00
Michael Meeks
2be1f8c345 UnitBadDocLoad - adapt to new jsdialog behavior.
Parse jsdialog responses, and send the right dialog id
to click items on.

Adapt to unexpected multiple updates for the corrupted document
warning dialog on load.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I0f934cdc60b2204afc493cf367f98a9cfa0aa6c0
2024-02-21 12:57:11 +00:00
Michael Meeks
c090b4fd21 notasync warning improvement.
Kit's GlobalCallback has an alarming habit of enabling
inputprocessing during a jsdialog popup occuring during
load, so use a stronger heuristic to avoid sending errors.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I4a57685dcf63b4a3607c894e80a13e27bffaece5
2024-02-21 12:57:11 +00:00
Michael Meeks
57de384bb2 dumpState should summarize MessageQueue and TileQueue messages.
Change-Id: I86bff39dd26491dc1cdc781f7e2ce3bbcd9859bd
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-02-21 12:57:11 +00:00
Michael Meeks
01e47f08a8 torture testing: drastically simplify, and add odg test.
Removing the prior apparently fragile approach of summing
view-ids.

Instead check for lack of duplicate view-ids, and still
load & close lots of views in random orders.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ibcefc54597cc4e37a9728dab2f32002620b01c4c
2024-02-21 12:57:11 +00:00
Caolán McNamara
7154ac5d07 init document theme during load
like we do for the spelling setting, so we have the document in the
desired state early before any rendering, dropping the early full
document invalidations during initial setup

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I6b762c95fd4c00c7da04cf89f7bbeef4bc57375d
2024-02-21 10:23:15 +00:00
Caolán McNamara
15e385bb2d split the handling of the optional keyframe to before the delta loop
topic: https://github.com/CollaboraOnline/online/issues/8316

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ifa97015b57539ded26a4b865d146b4084e3e7d6c
2024-02-21 10:10:19 +00:00
Caolán McNamara
2a971343f4 a keyframe, if it exists, will only appear at the start
topic: https://github.com/CollaboraOnline/online/issues/8316

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I4e26a2a9c20d506bf2f88637135bfe3681d941b2
2024-02-21 10:10:19 +00:00
Caolán McNamara
8f170ad2f3 avoid a subarray usage
topic: https://github.com/CollaboraOnline/online/issues/8316

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ib330cc87804b3d35071aa17a268f2436a02ff32b
2024-02-21 10:10:19 +00:00
Caolán McNamara
3f102f996d skip using subarray for offset 0
topic: https://github.com/CollaboraOnline/online/issues/8316

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I179605ae0b1f4af6d2d22e42859b34d81a4c8b19
2024-02-21 10:10:19 +00:00
Michael Meeks
eda61d1bb9 WOPI timestamp test fixes.
Adapt checks for empty or non-empty timestamps so that we can
match previous failures, and ensure coolwsd is sending us the
right override state.

Change-Id: I604e3aa0315753ae02e5a6e4173d6b3b3ffa3b3e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-02-21 09:38:49 +00:00
Michael Meeks
f1f198b197 wsd: Blank stored timestamp if an up-load times out.
Quite possibly we did successfully up-load, or at least our timestamp
may not match, but we cannot be sure enough to warn the user in this
case. We cannot reliably get notified of remote alteration on the
server of files, so wait until a more succesful save or new user
join to get an improved timestamp.

Change-Id: I5c8124ed74ba5c26371768ac778b9670282c87a3
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-02-21 09:38:49 +00:00
Michael Meeks
7031c3b0ce cool#8328 - config header fixup.
config.h should be included as the 1st line in each source file.
It should not be included in headers.

config_version.h which changes on every commit should not be
included widely - so remove it from the HttpRequest heeader to
save tinderbox's ccache.

Fetch version info from helper methods rather than in-lining via
defines, to better encapsulate.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: If449a36f1ac61940f04d70d5f4180db389d9b4c4
2024-02-21 09:35:25 +00:00
Marco Cecchetti
d93fe44882 calc: cut/paste for a cell content doesn't work in Firefox >= 121
Limit the workaround for "no copy event is emitted by hitting CTRL+C/X
with no selection" to Firefox version from 117 to 120.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I00d3addc0330862bf07eebb8d030d1156fc6e321
2024-02-21 10:29:32 +01:00
codewithvk
277237911f Fix: Multiple Encoding During Document Renaming
On the client side, when setting up the socket, we encode  beforehand, so there's no need to encode it again.

Signed-off-by: codewithvk <vivek.javiya@collabora.com>
Change-Id: I09e59c6fdda4c93de5dd36fca5023ac88926c4d4
2024-02-21 09:38:23 +01:00
Szymon Kłos
599896176d Avoid exception on view list update
Fixes and gives more details for debugging in case of:

INCOMING: viewinfo: [{"id":3,"userid":"admin","username":"admin","userextrainfo":{"avatar":"http://.../avatar/admin/64","is_admin":true},"readonly":"0","color":0}] cool.html:323:37
Exception TypeError: this.map._viewInfo[this.map._docLayer._viewId] is undefined emitting event [object Object] onUpdateViews@http://.....:9980/browser/08e0fd2e1b/src/control/Control.UIManager.js:823:31

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I915f4d6e235426d1ae1d12c64629a6e250c16766
2024-02-21 09:21:36 +01:00
Darshan-upadhyay1110
804f299b81 Handle sperator case for tree Widget
- separator should treated as UI not any object value
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: Ie6182dda40b7fd3c0d1ea87c5df78a46239677ed
2024-02-20 09:30:52 +01:00
Rashesh Padia
824988663f js: couldn't pass json when saving fails when migration
- when saving the json sent to client was wrong

Signed-off-by: Rashesh Padia <rashesh.padia@collabora.com>
Change-Id: Ib5735dcf81db4257256a909fa7dface184f1c53d
2024-02-20 00:50:50 +05:30
Rashesh Padia
edeea651a8 indirection: fix: 'Cluster is scaling..' popup when reconnecting
Signed-off-by: Rashesh Padia <rashesh.padia@collabora.com>
Change-Id: I5fc4017e647403822fbb0ceefd00b8aa7cfde531
2024-02-20 00:50:50 +05:30
codewithvk
0431c58465 disable file renaming in readonly mode
Signed-off-by: codewithvk <vivek.javiya@collabora.com>
Change-Id: I11b07d8352a0e29a4756db489f570cee55c9d03e
2024-02-19 17:02:48 +01:00
Pranam Lashkari
ee7715353f zotero: fix long title taking all the space in dialog
problem:
when titles are long they go beyond dialog area and are not scrollable,
this hides the date and author details which can not be scrolled either

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Iae8a5affb870faff0639ac9083e118cec40debd0
2024-02-19 19:56:42 +05:30
Miklos Vajna
8d931d8ea4 cool#8292 browser, clipboard: fix navigator.clipboard error handling
If the notebookbar's paste or paste special button is pressed and
Chrome's clipboard permisson popup is rejected, then nothing happened,
while Firefox case was showing a more helpful popup, explaining the
problem.

This has two sides: error handling should be better and also the error
should not happen in the first place. The error can also happen when the
<iframe> is not set up correctly, but that's to be handled on the
nextcloud side.

When there *is* an error, improve error handling by restoring the
codepath that matches Firefox:

- extract the rest of the code after invoking the async clipboard read
  in _execCopyCutPaste() to a new _afterCopyCutPaste()

- paste case: invoke _afterCopyCutPaste() when the paste fails

- paste special case: only pretend we're in paste special mode if the
  success fallback is called

  - if the failure callback is called, then invoke
    _openPasteSpecialPopup()

With this, the "has async clipboard, but the permission request
rejected" and the "don't have async clipboard" codepath matches.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I727f00a1cf94dd1837e15e60410e1798de5daecc
2024-02-19 12:18:20 +00:00
Szymon Kłos
2085009757 calc: calculate correct position when scrolling to comment
In calc all comments are hidden and only shown when
mouse hovers the cell to which the comment is attached.
Anchor was always a wrong value so when we were at
some more distant position - it always jumped to random
place on hover.

This is regression from:
commit 6550e713c4
annotation: calc scroll vertical to make selected comment visible
which was followup for:
commit 2bf93e34c3
annotation: writer scroll to make selected comment visible

We need to compare the same type of positions. Now all the
values will be in core pixels and methods have comment which
indicates that.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8e86a31087ff491ace92f407b166788cea73b25a
2024-02-19 12:02:11 +01:00
Hubert Figuière
203f7b462c globals: Make sure coolParams.get() return an empty string instead of null
This fixes a regression where `framed.doc.html` wouldn't load.

Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I57b4a617755be4615ec6ec734f6e084d57eaebce
2024-02-19 10:29:36 +01:00
Pranam Lashkari
de85b2dada zotero: fix missing field data in the dialog
problem:
in some types of items fields may be named differently,
leading to fields not being found and empty dialog entries.

currently only itemType 'case' was culprit but in future there maybe some other types too

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I24b58dc474a555b3f26c34bb4ae0b144c06abc57
2024-02-19 09:58:58 +01:00
Pranam Lashkari
ed62a19701 cypress: add tests for tracked comments operation
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: If1a2bbe7d9d3ec7fa821db91aea1f7b3ed6f2c1e
2024-02-18 09:45:46 +05:30
Caolán McNamara
f2c07343c5 getComputedStyle is very slow, but we don't need it for LTR comments
but it gets computed anyway, move it so its only called if actually
needed

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I187540df6def6b4f92199e273665e04ed493035a
2024-02-16 20:55:10 +00:00
Michael Meeks
e7e909bf3d Don't complain about non-async dialogs on load & save.
Change-Id: I2e846ea99e8d062088c80be166c4fc73bb3f004d
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-02-16 20:31:53 +00:00
Hubert Figuière
65a33fde17 calc: Added protect sheet command in the notebook bar
Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I845bd0dd4d8da4955c88e932c2701931b46e155f
2024-02-16 19:55:32 +00:00
Gökay Şatır
c69e14a5dd Remove unused file.
This was added for IE11 compatibility.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I4be5d3199c1354e2e36ac31734c3ed4ffb46cd54
2024-02-16 15:13:33 +01:00
Gökay Şatır
852fba249a add a comment for a potential unused file.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Iee185c006f158b49d43834e756b40f236cc94b16
2024-02-15 11:58:53 +03:00
Hubert Figuière
8b9c241347 calc: Hide rename and delete in the menu if the sheet is protected
This is consistent with LibreOffice: you can't delete nor rename
a protected sheet. It did nothing already.

Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I81e91f0cddf8b0cf6004f1668cb996b7cd0ba8e4
2024-02-14 14:05:56 +00:00
Hubert Figuière
cbf452b03d calc: Receive the sheet protected status
This set the CSS class 'spreadsheet-tab-protected' on the sheet tab.

Requires LOKit change https://gerrit.libreoffice.org/c/core/+/163325

Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: If199b36ba593c5e603d017346969360b6191fe5b
2024-02-14 14:05:56 +00:00
Szymon Kłos
b4c0556a15 jsdialog: add JSDialog.SynchronizeDisabledState helper
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I32bd297d961561e3de8d01e43c2c994b70eabd99
2024-02-14 13:16:58 +01:00
Szymon Kłos
2bd25b15df cypress: test disabled state updates
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ib0c123e82360edcdf6c4bad533b40b3d5cc04bc2
2024-02-14 13:16:58 +01:00
Szymon Kłos
8f3b620a44 jsdialog: css: improve disabled widgets
Don't show grey border for labels and similar widgets...
Now we have "disabled" property on the root container of
every widget. We should style disabled state based on that.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I9e49783e8905a4c36b0010fa19d5feb869151e77
2024-02-14 13:16:58 +01:00
Szymon Kłos
21a469d215 jsdialog: checkbox disabled state
Update checkbox state on jsdialog action.
To allow click handler use it's current state not
initial data.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I95796771a1347c78a9c5e1983e3b0af61a236bb2
2024-02-14 13:16:58 +01:00
Szymon Kłos
e05881b15d jsdialog: added Util.StateChange
- move listener watching disabled state to separate file
- use also for listboxes, comboboxes, spinfields
- handle state in menubutton

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I841413f17abd6398a7e82496c3f20bdc52ab9514
2024-02-14 13:16:58 +01:00
Henry Castro
6c32bd6276 browser: impress: override invalidate preview tiles
Invalidate tile preview when canonical view id
changes.

Change-Id: I62d2e20946ec863ceb71014bb0216675316a658b
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-02-14 11:48:17 +00:00