Commit graph

22359 commits

Author SHA1 Message Date
Ashod Nakashian
20508cf5a3 wasm: wsd: switch modes handlers
Change-Id: Ic56186baf54a51630f3d902175bee23b118a31f3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
d9b020237b wasm: browser: add UI button to switch modes
Change-Id: I8e1f7e40a04b5b9eb5be935ecfa6f37ad0e96c9a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
6a42339640 wasm: log to stdout instead of stderr
Change-Id: I747945635c749127d2851cab1f738f4fa58d99f7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
4879049d9e wasm: disable file and color logging
Change-Id: Id9d13552af7e963739e6c30e5faa97519ddec76a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
8d49d33da4 wasm: truncate string only if will log
Change-Id: I7bcc420633563abb858354a7cdb6c4a74c79b548
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
87fdb4a185 wasm: header include cleanup
Change-Id: Ia6396d9e10b9597602a88fced932c27c329b394b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
a96f8a0f92 configure: WASMAPP is now defined for WASM targets
This is in line with MOBILEAPP and GTKAPP and
is independent of __EMSCRIPTEN__.

Replace all application-specific cases, leaving
only toolchain-specific ones (such as include
protection).

Change-Id: Ic44288aa5ace51e0a8b54566170c19120f7bf0dd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
1954f9abcb wsd: reduce includes where possible
Change-Id: I99f489e57cb9391ea819d52b49b0d0034a289cf9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Ashod Nakashian
2255238711 configure: enable rtti with sanitizers on C++ TUs only
We now have at least one C TU and enabling rtti for
the sanitized build breaks things. So we don't enable
rtti for C sources, which was done in error.

Change-Id: If7624993ceb9e7af7aa8ffe3df69069ea4dd153a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-09 19:22:24 +00:00
Bayram Çiçek
a04b0c4201 Calc: make grouping responsive for each group level
Signed-off-by: Bayram Çiçek <bayram.cicek@collabora.com>
Change-Id: I68572eb126acf4a00ed96af870c1f908083aec8b
2023-12-08 16:23:24 +01:00
Caolán McNamara
1bd1e5a828 wasm is derived from the mobile, but doesn't have on-screen keyboard
There's a bit of a mobile/wasm munge with wasm considered a subset
of mobile in some places which should be unwound a bit, but for the
purposes of usable wasm by default, don't assume that wasm has an
onscreen keyboard so we don't lose keystrokes on assuming that
there will be an onscreen keyboard appearing when we lose and regain
focus.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I0baae0d414ce9aafd1c27d74bcdad2276d104ee5
2023-12-08 14:17:27 +00:00
Caolán McNamara
cf33d0bdd0 update wasm.README for distro-config
the default suggestion uses --enable-qt5 which isn't needed for
LOKit and breaks finding custom notebookbar widgets so online
notebookbar doesn't work with it.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I644924a0f8cdb01d4ec20d70ff7aedb27a2c899f
2023-12-08 14:08:30 +00:00
Rash419
169567b3cc fix: persistent snackbar after the document get idle
- previously, when document was getting idle, it was
  showing a snackbar "The server is disconnected" which
  unnecessary plus the snackbar was persistent even
  after reconnection.
- There are two scenarios to be tested,
 1. It shouldn't show snackbar on idle
    - Set per_document / idle_timeout_secs to something small, eg. 30,
    - Open a document, and wait until it idles out.
    - make sure it doesn't show "The server is disconnected" snackbar
 2. It should show "The server is disconnected" snackbar when you shutdown
    the server, when you start the server again snackbar should disappear

Change-Id: I4ccc93dabb4dd260338d5a941b18ebaf8e42b1ad
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
2023-12-08 18:56:34 +05:30
Pranam Lashkari
009cb14c07 cypress: added multiuser annotation tests
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I9afae096d7a9e925e01e0c9faee57254ed1d074d
2023-12-07 22:38:59 +05:30
Pranam Lashkari
0c0fcd57db annotation: avoid wheel event handling for comments
it was previously required to handle comment scrolling separately but not anymore
it was introduced in a3e59d1

current problem:
when a comment is very long that it overflows and has a scroll bar,
it is only possible to scroll using the scroll bar and mouse wheel didn't work

fixes #7735

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I6d9f85c61b837f86e021a795e8af43b375a318d1
2023-12-07 22:06:08 +05:30
Pranam Lashkari
6ccb1a8d98 annotation: only allow to edit one commit at a time
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Iaa021be2327294e5e34bf6b56de35894f36f263c
2023-12-07 15:38:13 +01:00
Pranam Lashkari
93bdcc349b Annotation: revamp comment autosaving
Original approach before comment autosave:
When we save a new comment, original DOM element which user was editing
is removed from the DOM and new comment DOM element is created from the data and message sent by core.

Previous comment autosave approach:
When we save a new comment, original DOM element which user was editing
is not removed but kept in editing mode. We register the comment message sent by the core
but react and create new comment DOM element only after user clicks on save or cancel.
This lazy initialization caused many regression due to juggling of the new and old comment DOM element.
All these problems were in JS side only, reloading doc would bring comment in correct state.
This approach gave smoother transition between different comment states without any flickers.

New comment autosave approach:
Simple as the original approach, when comment loses focus we save it as normal comment.
When new DOM element created via core comment message, we immidietly set it to edit mode.
This approach may have a little flicker when we replace old comment DOM element with new comment DOM element.
Overall this approach requires less condition checking which makes it easy to maintain and hopefully reduces any regression from previous method.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I4098085825ede65cdbf2e2243fc4d2bb1f63c716
2023-12-07 15:38:13 +01:00
Pranam Lashkari
3916a443fc Revert "annotation: avoid saving comments on losing focus"
This reverts commit 51d19dd60e.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I60ecf1cc7f9b61c41b95ddd5ceb6caaf72036e3e
2023-12-07 15:38:13 +01:00
Pranam Lashkari
ca64805e23 Revert "annotation: autosave comments when lose focus without exiting editing"
This reverts commit a022212381.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I6431fc2500fe44a8d97364aa89412206179c7aba
2023-12-07 15:38:13 +01:00
Pranam Lashkari
630a2e74d2 Revert "annotation: fixed autosaved comment cannot be closed"
This reverts commit dda49b0af6.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I0be7ff41777eece8a0bbe5a52219c076d78ac3be
2023-12-07 15:38:13 +01:00
Pranam Lashkari
05f4fa9564 Revert "annotation: make sure comment list is fetched correctly"
This reverts commit a373b6e121.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Iaae5932eeb29f90a0d22439dba53897ef7b4fafa
2023-12-07 15:38:13 +01:00
Pranam Lashkari
70ad32d885 Revert "annotation: avoid trying autosave empty comments"
This reverts commit 6a4cd7eea5.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Icc20b9e055ccb8d7a1d78635f0c659696110d0a6
2023-12-07 15:38:13 +01:00
Pranam Lashkari
a92342c86e Revert "annotation: avoid marking comment autosave if its not saved"
This reverts commit 2c720a6a87.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I99869bfa017e704053589264242a17add727ce74
2023-12-07 15:38:13 +01:00
Pranam Lashkari
ae523fc611 Revert "annotation: forcefully reselect comment before modifying"
This reverts commit 4d7df8ae9c.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ia3770347cec0d3949e6459b4c412c52c5e0f1116
2023-12-07 15:38:13 +01:00
Pranam Lashkari
3fc486a131 Revert "annotation: fix parent comment being deleted if reply cancelled"
This reverts commit 91cbc8c404.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I0e995f1b2eb1451943d56f86829e4f09860a43e6
2023-12-07 15:38:13 +01:00
Pranam Lashkari
108987e3e5 Revert "annotation: fix cancelled modification of autosaved comment"
This reverts commit 30f6c14b9f.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I87e3e3a6732c3d182f0724ece52fca2cbbd8dc99
2023-12-07 15:38:13 +01:00
Pranam Lashkari
c0a0160644 Revert "annotation: fix parent comment being deleted if reply cancelled"
This reverts commit 5c965044ec.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I4157cffe38beccd675b33f2417617025b226eafe
2023-12-07 15:38:13 +01:00
Pranam Lashkari
e079ac34cc Revert "annotation: fixed impress disappearing comments on autosave"
This reverts commit d7e07b773f.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ifafef55b97871aa01c851abb6a1c87edb84b9862
2023-12-07 15:38:13 +01:00
Pranam Lashkari
f0e68b7590 Revert "browser: fix duplicate comment reply on autosave"
This reverts commit 4ba4c61aad.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I39bee7e5b2033e7fed1ab8a3066ebf43aa1be4da
2023-12-07 15:38:13 +01:00
Pranam Lashkari
8a592db923 Revert "annotation: reset comment id if autosave is cancelled"
This reverts commit 3c1ac04b0e.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I842f8fc7feac01685785af72929974fc4fa397af
2023-12-07 15:38:13 +01:00
Pranam Lashkari
bdbe2dfa51 Revert "annotation: make sure parent-child relation is established"
This reverts commit ab064bacc7.

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I073bc9045e68ed78424681a3c9c70696cbfece3f
2023-12-07 15:38:13 +01:00
Szymon Kłos
b9e5a51315 Update network access error strings
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: If44683da69ce05b8271117338f2e059bad15182d
2023-12-07 14:58:42 +01:00
Szymon Kłos
675afcf60b jsdialog: introduce JSDialog.showInfoModalWithOptions
Helper that is easier to use as has "options" parameter
not a long list of possibly optional ones...
It is first step to refactor old UIManager.showInfoModal
helper, which is less flexible.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I34eae39cab583985ad3d940aa025aee0a374e25e
2023-12-07 14:58:42 +01:00
Szymon Kłos
bbcf9053b9 Show info modal on network access error
If administrator doesn't allow some URLs in the coolwsd.xml
under net.lok_allow then when pasting webpage with images
- it might result in missing pictures. We should show the
user what happened.

User can click "don't show this again" to avoid annoying
dialog on every paste.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iec9035860b1c6a332420defd539000e8854447c9
2023-12-07 14:58:42 +01:00
Andras Timar
af36021b6f Do not refresh notebookbar when we start in read-only mode for txt and csv
This is a workaround for the bug, when a txt or a csv file was opened,
and there were both the classic menu and the menu of the notebookbar
at the same time at the top of the window. This bug occurred because
regardless of the user's UI mode setting, the read-only mode has the
classic menu. The fix also have a side effect, that is better than
the original symptom. Now when a txt file is opened, and user starts
editing it, the Zotero buttons won't be on the References tab. I
think it's a good trade-off, but FIXME.
Eventually, when we won't have the classic UI mode any more, this
problem would be solved better, for all corner cased (txt. csv, pdf,
read-only shares etc.)

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ic3f95c02a0b75136a0b8069fa8297ed129b63865
2023-12-07 14:34:23 +01:00
Caolán McNamara
facd87b866 enable window.logging before dumping delayed log
otherwise the carefully retained startup log message don't appear
in a non-debugging online version

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie4caf3462539e07f14f6c84bccab47fcbe9d5203
2023-12-07 10:57:08 +00:00
Szymon Kłos
eaca5e32bd notebookbar: don't send events to core
switching tabs should not send events to the core
notebookbar is online-only widget

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I39c487d3c91f1fe858438e03fd9369f3dc571f52
2023-12-07 11:38:04 +01:00
Caolán McNamara
9daba64dc1 use of gseparate-dwarf can block some optimizations
with in in place the sizes are

-Os for core and online
  du -h online.wasm 155M

-Oz for core and online
  du -h online.wasm 145M

and a warning of:

em++: warning: running limited binaryen optimizations because DWARF info requested (or indirectly required) [-Wlimited-postlink-optimizations]

without gseparate-dwarf the sizes are:

-Os for core and online without -gseparate-dwarf
  du -h online.wasm 133M

-Oz for core and online without -gseparate-dwarf
  du -h online.wasm 119M

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I91586abe0e52f6de20d0f04636bb5a2be93d92be
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-06 12:39:46 +01:00
Darshan-upadhyay1110
e70b9d719f Change checkbox state by click on checkbox label
- Now we can check/uncheck by clicking on label
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: I03c5e866d89f61a93b07dbbd1f5bd7752f5c723f
2023-12-06 11:41:09 +01:00
Caolán McNamara
5f1c943a98 add hasWASMSupport to capabilities
so the launching site can query if wasm is enabled to see if it needs to
insert the required headers, so we can then in turn make it optional on
those being set to also require matching headers.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Icd73081809abb8098c21bc61a8357869db45ff6c
2023-12-06 09:58:57 +00:00
Hubert Figuière
fa268b8e0e framed.doc: if entering bad message data, recover
Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I6337029fe1eeffb7f20acaa100602ea44a0dbc63
2023-12-06 08:53:29 +00:00
Darshan-upadhyay1110
8b28c8cc12 A small typo in Class name which is cause for FontColor
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: Ifa40864a332718f9c58335e6d950149673d03f10

A small typo in Class name which is cause for `FontColor` icon not working in dark mode. it is not fully related here but pushing that as a commit in this PR :)
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: I516220240d204302074f72e20d98df7591cb00cb
2023-12-06 09:26:13 +01:00
Darshan-upadhyay1110
f3948aa30b Fix icon wrong url caused by data.icon property
- there are 3 cases we need to consider
   - 1) data. Icon if present, then set Icon based on its value.

      - Here 2 child cases 1) data.Icon can be direct an image URl in that case we will not perform and operation directly use `buttonImage.src = data.icon `

      - if values is just an image identifier like lc_save.svg then will call setImage method as we do in many other case
  - 2) data.Image if present the we directly go with data.Image URl
         - `buttonImage.src =  data.image;`
         For ex:
      In ODP file => sidebar => Line (section) => width (property name)
      Here we are setting the icon based on `data.command`  instead of `data.image` that makes icon different

  - 3) If both above case is not valid then byDefault we will go with data.Command
        - `L.LOUtil.setImage(buttonImage, builder._createIconURL(data.command), builder.map);`

Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: Ia112202fdebec2f3529f3bbd19d46084d4e0dc1a
2023-12-06 09:26:13 +01:00
Caolán McNamara
7f2b8c0aef duplicate jsdialog messages seen in UnitBadDocLoad
debugging some intermittent failures in UnitBadDocLoad I see that there
are some duplicate jsdialog messages appearing which is easily
reproducible by just opening test/data/corrupted.odt in online.

probably has been like this since:

commit 7f70197723
Date:   Mon Dec 28 11:37:27 2020 -0400

    kit: enable input process when early dialog show

and possibly not the problem I was originally trying to chase

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I7aa342e86ad9ae73082cb71f1b2c9b2bf0f212b9
2023-12-05 11:38:24 +00:00
Rash419
f203a4d68f admin: indirection add new command for sanity check
- routetoken_sanity_check

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ieaabcd044b65ad0620089ae6413e3f626ff68c4c
2023-12-05 10:46:31 +05:30
Hubert Figuière
aa43f7e43b wopi: Added DisableInsertLocalImage
This allow being able to disable pick up of a local image. Handle the UI as well.
To be used with EnableInsertRemoteImage.

Return DisableInsertLocalImage: true as part of the WOPI CheckFileInfo reply
Default value is false (enabled)

Added an 'insertremotegraphic' button to the classic toolbar for use when
it's the only option.

Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I1925f804433a7bda6025cb65b0943d78927bea15
2023-12-04 20:36:13 +00:00
Michael Meeks
9de0b02e7b Refactor: move tile limit accounting into ClientSession.
Also add state dumping of tile on the fly statistics per session.

Change-Id: I8413cdfd489be3c238738f95d9d5c4aa177ff262
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-12-04 17:45:12 +00:00
Miklos Vajna
2659983faa wsd: fix missing session handling in DocumentBroker::forwardToChild()
To reproduce:

	./clientsession_fuzzer -max_len=16384 fuzzer/data/crash-32e5136d2291e6c5fa99aa5942acded42b66a528

Failed with:

    #7 0x7f1aeb9c9cf1 in __assert_fail (/lib64/libc.so.6+0x42cf1) (BuildId: f732026552f6adff988b338e92d466bc81a01c37)
    #8 0x55a9f13968a5 in DocumentBroker::forwardToChild(std::shared_ptr<ClientSession> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/DocumentBroker.cpp:3613:5
    #9 0x55a9f1676a9a in ClientSession::forwardToChild(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::shared_ptr<DocumentBroker> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/ClientSession.cpp:1414:23
    #10 0x55a9f166f96a in ClientSession::_handleInput(char const*, int) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/ClientSession.cpp:1100:20

The reproducer was originally added in commit
aefc65465b (wsd: fix crash when downloadas
has not enough parameters, 2020-02-21), but now it also triggered this
assertion failure problem as well.

The brave assert was added in commit
b2aff3e817 (wsd: pass ClientSession to
forwardToChild, 2022-11-26).

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I4a0adda49aa2d24925d448fa5753509917d2585a
2023-12-04 16:15:16 +00:00
Hubert Figuière
3fc8bdffe3 framed.doc: Allow switching app on the fly
Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: Idad883f566a02b1e777c8c7af6b9b52da3a62e69
2023-12-04 11:10:15 -05:00
Hubert Figuière
abf7b2bd70 postmessage: Add a show/hide command
New postmessage `Show_Command` and `Hide_Command`.
Pass a command name (uno or otherwise) in `Values.id`.

Will hide the corresponding toolbar, menu and notebookbar items.

Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: Idaa86f7a936a282c636fa0532ab165c6977db873
2023-12-04 10:45:19 -05:00