Commit Graph

120 Commits (master)

Author SHA1 Message Date
Michael Meeks 90f387cdc5 bgsave: change statusindicator protocol message to 'progress' + JSON.
We need to get more helpful structure into this message, and add a
type=bg flag to handle background progress messages.

Add unit test for merging progress: setvalue commands.

Simplify ProtocolHandler sendTextMessage with a std::string wrapper.

Android code needs manual testing.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I54ce807e2fc5de80118905e68557a95e637fbd18
2024-05-06 20:28:08 +01:00
Michael Meeks 14e3a20e18 DocumentManagerInterface - remove un-helpful abstract base.
This added 200+ lines of code, made things harder to
understand, and was used only in a single test that can be
covered in another way.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I4ed8d1d52d533f8b24be7dd5e12dbb7702ef1a80
2024-04-29 10:56:54 +02:00
Michael Meeks e27a095775 bgsave: initial implementation (gated on COOL_BGSAVE=1)
Initial background save implementation from the Kit perspective.

To do a background save we:

   1. join known threads - we can't fork with >1 thread.
   2. check all is well: one thread, nothing unusual...
   3. create a socketpair to communicate with the child
   4. fork
   5. child: cleanup duplicated sockets
   6. child: setup LOK to not damage our shared file-system
   7. child: save
   8. child: report status back to parent & _Exit

There is still a substantial TODO, but this can be built on.

Change-Id: Ibf2c492372e2b5133932773e230ad05e18521794
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-04-05 17:34:43 +01:00
Michael Meeks c117d87bb4 nearly pure re-factor: split out code into its own modules.
StateRecorder.hpp split from ChildSession.cpp
KitWebSocketHandler.[ch]pp split from Kit.cpp.
ThreadPool.hpp split from RenderTiles.hpp

Expose headers for KitSocketPoll and Document
at the same time.

Not clear we need the DocumentManagerInterface anymore.

Conditionally compile out Document::createSession for unittest
dependency breaking, and avoid Rlimit::handleSetrlimitCommand
likewise.

Make makePropertyValue a private method of Kit.cpp.

clang-format new files.

Change-Id: I47a1d6afe20165f156b477a931b94c916cff4b9d
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-03-06 20:56:55 -05:00
Gökay Şatır 1354d23a2f Revert "Changes for handling readonly mode click events:"
This reverts commit 924f13f106.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2024-03-06 14:03:02 +01:00
Michael Meeks 29fa4a40a1 signal activity dumping: enrich with session details and state.
Cue up some basic state for being signal safe dumped on crash/abort.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ibc6713aef2a0e7b878b178b05f0e13c8d40b47fc
2024-02-06 19:29:28 +00:00
Michael Meeks f477e17d5e ChildSession - dump much more internal state.
Change-Id: I1441d88968040b6852bf6338e8a4dfcdf8e308f5
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-01-18 20:18:56 +00:00
Gökay Şatır 924f13f106 Changes for handling readonly mode click events:
* These changes are made primarily for reading the hyperlink data from the document in readonly mode.
* Added readonlyclick event.
* Added readonlyhyperlinkclicked event.
* And the handlers for these.

When user clicks on document in readonly mode, a readonlyclick event is sent to the server.
Childsession checks if there is a hyperlink at the clicked location.
If so, the information of the hyperlink is sent to the client.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I9c104a1ec770491725337b9bbb1e2d1c2851321b
2023-12-27 09:24:28 +03:00
Michael Meeks 7183a3d3de spdx: improve machine and human readability of headers.
Change-Id: Ice934380029bf27054e830fffc07a5d037d1430f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-14 19:36:31 +00:00
Caolán McNamara cceebfed94 cid#323636 Uninitialized pointer field
and use online standard member prefix

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ia7681870128185ecba27da0e344912e393e9114b
2023-10-04 09:57:39 +02:00
Caolán McNamara 672f3cee2c rework URP to use a dedicated channel
Instead of fighting the SolarMutex to get the messages
processed by the main loop. Simple and no additional
threading, mutexes etc.

messages from the external uno client are just
written to URPtoLoFD and the core reads from that

messages to the external uno client are written
to URPfromLoFD by core, that fd is in poll, and
activity there triggers a read by the DocBroker
to send it to the external uno client.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ib1f0a0d5fb5ab22eee476d5d740b290c51de59dc
2023-10-03 10:15:55 +01:00
Skyler Grey e6d9c1f87c Add support for URP messages in COOLWSD
- Allow COOLWSD client sessions to forward messages with the prefix
  'urp' to the child, and return messages with 'urp:' to the client,
  communicating with binary
- Make COOLWSD child sessions use the FunctionBasedURPConnection from
  https://gerrit.libreoffice.org/c/core/+/155100
  (core change ID I2bda3d0b988bef7883f9b6829eeb5b7ae8075f27) to start a
  new URP session
- Make COOLWSD child sessions submit messages to this URP session,
  stripping and adding the 'urp' and 'urp:' prefixes so the Java client
  from https://gerrit.libreoffice.org/c/core/+/154680
  (core change ID I91ee52922a24688a6b94512cb7e7bc760bf25ec9) can
  use the connection (and to avoid interference with any other websocket
  messages)
- Add a COOLWSD option for enabling/disabling URP given the security
  implications around allowing anyone to write URP (e.g. URP lets you
  run shell commands so a mallicious actor can take over the child
  session)

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Idadfe288a78cfd72b01253dfdade150d506e3f05
2023-10-03 10:15:55 +01:00
Caolán McNamara 205f6d3119 Related: #7079 handle tile requests inside viewport first
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie25c7711485f37ab4d038a1c1d1dc1e4d4a8dd4f
2023-08-21 20:48:31 +01:00
Jaume Pujantell 63473360b1 save-as preserves document password
Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: Ibaa00fbe4e83c8e4edfe2a70ede861f9adbd20bf
2023-08-03 11:09:35 +01:00
Ashod Nakashian 5b52f7d8eb wsd: smart pointer cleanup
std::make_shared and std::make_unique
are superior to explict smart pointer
construction. Where we have private
constructors, we can't use them.

Change-Id: I492122f58e958113c6e6d31445c6614ad98c89aa
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-08-03 08:40:20 +02:00
Marco Cecchetti abca8e5dd3 Adding support for enabling/disabling a11y support from the ui
Added toggle button/menu entry for enable/disable accessibility support.
This ui feature is available for Online Writer only.
The button/menu entry is added only when accessibility is enabled at
server level.
That allows to enable/disable accessibility per view.
By default, the accessibility support is disabled.
Anyway the accessibility support state is saved to local storage
if available.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: If5968a47f17922038b9da3d320cbed84ebb7688b
2023-07-10 16:02:18 +02:00
Paris Oplopoios baaecac852 Add debug option that allows tile dumping
Added a debug option (triggerable using the about debug menu) that
allows you to dump tiles as they come in

Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: If5939b816c1e3598e50c2db4971710524f855909
2023-06-05 08:59:39 +01:00
Marco Cecchetti b9f9cef60a a11y: populating editable area with focused paragraph
We handle notification from core about currently focused paragraph:
content, caret position, text selection start/end.
Notifications are sent on any text changes, even when the text has
been modified in another view.
Moreover we can request such info to core at any time.
That allows AT software to read focused paragraph and selected text.
All that keeping editing still working.
A set of new cypress tests for checking clipboard content has been
developed.

failing cpp unit test:
- HTTPWSTest::testInactiveClient
'unexpected message' assertion was failing since an idle client can
receive an a11yfocuschanged message when the same paragraph has focus
in both view and the active view is editing the paragraph.

failing cypress tests:
desktop
- calc/autofilter_spec.js
  - added more wait time before performing clickOnFirstCell
- impress/undo_redo_spec.js
  - Repair Document was broken
    - we need to select 'Hello world' in order to overwrite it

mobile
- impress/spellchecking_spec.js
  - Apply suggestion
    - better use selectTextOfShape instead of Ctrl-A

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I070d390543fa66fe786c4a0661fa09f891b9883e
2023-05-31 22:43:51 +02:00
Gökay Şatır 9d6296e4b3 Remove unused document signing code.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I30cf381d1fa282cf222ab5abc676374ab7eefb6c
2023-05-08 21:51:47 +03:00
Michael Meeks 7444decf9f trim memory when user is inactive.
Builds on a new LOK API to do the same in the core.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I4443cd2ffbb6c7af0726162aec2ba78fc354d901
2023-03-23 11:31:24 +00:00
Paris Oplopoios 8ade29f112 Handle LOK_CALLBACK_VIEW_RENDER_STATE in the Kit
Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: Ie4d03a3600cb9ebdf9b76ee4779d62da30ad3eb6
2023-03-17 17:34:05 +00:00
Paris Oplopoios d26c425dae Move _canonicalViewId out of Session
Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: I9c06440ed47eb217e973d2f530f2c3646d55d85b
2023-03-17 17:34:05 +00:00
Szymon Kłos b0dd943089 Add export as pdf
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I61853fb2213e57acd02d7a3eee53e86f43cb36b5
2023-01-26 13:06:57 +00:00
Szymon Kłos 85ada3b6f8 Add UserPrivateInfo
it will be used to store user data which shouldn't
be shared between views

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I58b7f22e4364ce9e07bb6cc74e8431363912a872
2023-01-06 10:36:43 +01:00
Pranam Lashkari 2cfae369af initial zotero skeleton
add zotero UI only if user is logged in
when zotero citation edit button is clicked,
fetch the library with zotero API.
Let user select what to insert

at this stage its not a complete solution but just first stage

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Id67d8409bcd6416994713acd9ace495b24823fb0
2022-11-30 20:37:48 +01:00
Aron Budea d30b423c07 Replace #ifdef-s with #if-s, and enable -Wundef
...for variables coming from configure.ac.

Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I39ebd21c4cb56d2a3bd38fdc35dc59b5f1fd4b49
2022-08-03 11:07:38 +02:00
Rash419 cb080f561e writer: fix: cannot add picture using picture contentcontrol
use sendContentControlEvent to set picture instead of InsertGraphic uno command
since InsertGraphic is not allowed for a protected content control (like picture),
only sendContentControlEvent();

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I5f70919d995c51456056a8be2aa1e596df7bedc2
2022-07-06 14:57:30 +05:30
Michael Meeks bef4b1ec5a delta: have own delta cache mutex, and size cache for session count.
Change-Id: I1f970a5f9045df11444f6fec8ce7e8eeb0a71bf5
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-06-16 10:48:55 +01: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
Kristopher Maxwell cb6a5fd4ad Remove unused parameters in ChildSession
The buffer and length parameters were unused in methods in ChildSession.

Signed-off-by: Kristopher Maxwell <kristophermaxwellc@gmail.com>
Change-Id: I6aff3c92a5d787db84bbe64aa13f2f0160340f7f
2022-02-28 07:13:11 -05:00
Pranam Lashkari 7e22a01d4d refactored feature disabling bits
now it is known as feature locking

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I2935edbfe1eb8dcc194641afa2461cf77b2b29d3
2022-02-11 17:00:11 +00:00
Michael Meeks 9354fc829d signal activity dumping; overdue cleanup / re-factor.
Change-Id: I7cb3047488f6daffbb5de285dfc5631c4dd89c8e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-01-10 13:03:37 +00:00
Pranam Lashkari f88a38a4e7 LOK: unifying the Freemium and uno command hiding APIs part 2
* replace vector with unordered_set
* avoid sending multiple blocking messages

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I2f714e4f2797ade4ac9d5b4f824855bba31031c4
2021-10-21 12:28:13 +03:00
Pranam Lashkari 0afaefc85c LOK: unifying the Freemium and uno command hiding APIs
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I39637abef246ffdc02ef653a0de9001cc03cdaa0
2021-10-21 12:28:13 +03:00
Pranam Lashkari 88601440d0 introduce way to hide/restrict uno commands
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I1225190a67f726832e5b38a7c3f690b51c1385f3
2021-10-21 12:28:13 +03:00
Tomaž Vajngerl b31eb2ab92 New POST service to render a search result + unit and integ. tests
This adds a new service render-search-result, which renders an
image of the position where, the search fund a hit. The search
result contains the information in which object or paragraph,
which is just the node id and node type from the document model.

The service takes the document and the search result (xml file)
as the input and returns a PNG image as the output.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>

Change-Id: Iffc158c5b0a3c9a63f8d05830314c9bc1616b3b1
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
2021-09-13 10:36:15 +02:00
Tor Lillqvist d9fc146605 Bypass updateFreemiumStatus unless ENABLE_FREEMIUM
Fixes build of iOS app.

Change-Id: Icf4e49c7d4d8f77a37557e1990f37673e1b9c91d
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-07-20 14:41:18 +05:30
Pranam Lashkari e02e1df76d Introduce Freemium options
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ib6b68ff74839cf84f2d8c8cfb7d380be9209f923
2021-07-20 14:41:18 +05:30
Gopi Krishna Menon 9d86193972 Log Last Uno 4 Commands During a Fatal Crash
Records the uno commands from different instances of ChildSession and
dumps the last 4 uno commands into the crashlog during a fatal crash

Signed-off-by: Gopi Krishna Menon <krishnagopi487.github@outlook.com>
Change-Id: I838f71769dc08df7076c040f3d72c15f7607e9d3
2021-07-13 19:48:21 +03:00
Ashod Nakashian 81da7c7bff wsd: download templates by wsd
Templates were downloaded by Core
upon loading. This works fine, as
long as there is no special network
setup in loolwsd. However, when
loolwsd has a complex network setup,
such as when using reverse proxies,
Core wouldn't know about the details
and would likely fail to download
the template.

Luckily, there is no reason to rely
on Core for downloading templates.
Instead, we download it in loolwsd,
just like any other document, and
load it in Core as normal. The
remaining post-load saving of
templates remain unchanged.

Change-Id: Ib22ada4ae469863d5e5c8baeee27f667f7cd40ff
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-02-15 09:41:17 -05:00
Tor Lillqvist f1e074f6bc Add caching of tunnelled dialog images
The same cache size is used in server and client. The caches use the
invalidation algorithm. Pass the hash of the pixmap in the
windowpaint: message. The client stores dialog images in its cache.
The server stores hashes of the images. When the server knows that the
client already has an image cached, it sends just its hash and the
client will use the cached image.

Pass the size of the cache to the client so that we don't have to keep
the the cache size synchronised in two places in the code.

Change-Id: Ie6cbfca79a9ede48fcc115e3acc669b925bb624e
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-01-25 17:48:33 +02:00
Shubham Goyal 3a3867e1c6 Resolve #805 : Remove Mutex lock
Signed-off-by: Shubham Goyal <22shubh22@gmail.com>
Change-Id: I80da9d085590e67c0998ce971225a8c9903c0bb7
2021-01-13 16:55:35 +00:00
Henry Castro 9f43878891 kit: send early dialog event to server
When the "Macro Security Warning" send clicks events,
the is no instance of Model/View/Controller yet.
So adjust to send to global events.

Change-Id: Idc395cfb86548481bbadc22874293d7d6238db89
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-01-05 11:10:22 -04:00
Ashod Nakashian 4185c5fd03 wsd: encapsulate watermark details
The watermark handler member has been fully encapsulated
inside ChildSession, so there is no need to have public
members or circular dependencies (ChildSession owns Watermark
instance, and Watermark takes ChildSession instance to
construct and initialize).

Minor refactoring and const-correctness improvements.

This is a non-functional patch.

Change-Id: I32525c47e35e96fc5314e107639be93ebc49a60e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-11-11 08:14:42 +01:00
Ashod Nakashian 4ce0bd9e3a wsd: fix templates with no chroot jail
Change-Id: Id47211e9e20173886af35ae92833f026354b2586
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-10-25 12:20:58 +01:00
Andras Timar 0002fdfd6c fix license headers
Change-Id: I8623770b32d278a45357dc7f757fabfadd2b4af7
2020-10-01 11:56:43 +02:00
Miklos Vajna 07629f0d7c Mark getMobileAppDocId() as const
Change-Id: Ie02cf07ce12ad63bf5374d94bdbd1b55eaeec4da
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102897
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-17 09:24:44 +02:00
Michael Meeks ca5d5943e4 Kit: add initial state dumping on USR1.
Change-Id: I8225f686e8678c08e505490df056904fc813d2fe
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98927
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-07-18 18:21:14 +02:00
Tor Lillqvist 7f25109f72 tdf#128502: Chunk of work to enable "multi-tasking" in the iOS app
Seems to not cause any serious regressions in the iOS app or in "make
run", but of course I am not able to run a comprehensive check of all
functionality.

Change-Id: I44a0e8d60bdbc0a885db88475961575c5e95ce88
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93037
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-06-26 13:09:51 +02:00
Tamás Zolnai 75dc61da7e MSForms: send item selection event to core.
Change-Id: I10fceb66a4f8cd777c43411ddace3456a315b5a2
2020-05-09 09:54:08 +02:00