Commit graph

20681 commits

Author SHA1 Message Date
Gülşah Köse
19d50ddc1c Add date time fields under the insert menu
In compact view we have insert current date and time actions but in
tabbed view we don't have them. To be equality we need to add in tabbed
view too.

Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com>
Change-Id: I5498f47a8dc96a5403cdf17be52ef3a7ad66862c
2023-05-15 08:54:33 +01:00
Ashod Nakashian
dc1d0a2f3f wsd: quarantine: refactor the timestamp
Change-Id: I6abde4e8e179004decdb7e631fea4a45fdd2a592
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
87fcb6f692 wsd: quarantine: correctly sort files based on timestamp
Change-Id: I65b9dfcbb9d3969fd9b0b2374ded4851bef22b74
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
c82cf3cc45 wsd: quarantine: thread-safe quarantining
The QuarantineMap is shared between DocBroker
instances, which makes it subject to concurrent
access and modification. As such, it must be
protected via a lock.

Change-Id: Id62587b33123748f848110a5427da3e296725de9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
8f1354dc91 wsd: quarantine: size calculation
Change-Id: I97d87afd7b5769c76c0112faa4fa90449a1940d4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
a9562dc3f2 wsd: quarantine: better filename tokenization
Change-Id: I0ddac3ba63cc1aa1bd8dfffd7ccb3a50013f8bd4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
a883e357b2 wsd: minor improvement to Util::replace
Change-Id: I2b9e9b33d8e63a43b50beda432fc48f8b9d7a8c7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
eaf69c8b19 wsd: quarantine: simplify the filename
Change-Id: I83e0fb9da054063af822541805bfe92d460affbd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
203cc2f97f wsd: quarantine: delayed construction of the quarantine instance
Since we need both the PID of the kit process and
the document name, it's easier to construct the
quarantine instance only when we have downloaded
the document.

Change-Id: I8b537122c4b10ae6e822a82fa6a75456d0eaaaff
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
49ecd63837 wsd: quarantine: cleanup and logging of quarantine file removal
Change-Id: Idec703875448e30fdab99a6e96264a9b1a5cdc4e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
28eb354bd1 wsd: quarantine: better quarantined version cleanup
Faster algorithm and logging.

Change-Id: I96b2e9486ee1d988f4b4b038bf6ecdcb5a816647
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
5dc587f7fa wsd: quarantine: improved cleanup
We now use the timestamp in the quarantined
file, not the modified time on disk. Since
we have the timestamp, we should use it.

Change-Id: Iaf4a9cab2203da3e3842d7fe46b4578a031f0958
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
668bfbfb35 wsd: quarantine: docKey is already encoded
No need to encode/decode docKey,
since it is always encoded already.

Change-Id: Icd9c6d24ca57e9f0ffb06efc7052df175d5d383d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
10553c4a78 wsd: remove unused helper
Change-Id: Ib27e596d751c78e40a51a53ece5c523ab6e7eabf
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
3feb547bae killpoco: remove direct URI encode/decode usage in RequestDetails
Change-Id: I27e616300c8defd115be894ecf56fe72916748cc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
6ed935bf89 wsd: quarantine: encapsulate QuarantineMap
Change-Id: I8b4da2cb4c2291c70f6a0d513a72f47899428e3e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
81b452b225 wsd: quarantine: include correction
config.h should only be included in .cpp files,
never in headers. The reason is to avoid having
it accidentally included, which would also
allow for it being effective only in subsequent
code, not those included earlier.

To avoid these problems, each .cpp includes
config.h at the top, so the configuration
directives would be effective throughout
the translation unit.

Change-Id: Idae87e5ee51abe454cc2a53d6f60dc07f64d0c35
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
b81db549dd wsd: quarantine: capture the maximum quarantined file versions
Change-Id: Ie2756580954ed759e250340b786ae602d213b321
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
8fa978139f wsd: quarantine: capture the maximum age of quarantined files
Change-Id: I36f681ec5672d77e15ef6a9104d1b3ad874b189d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
99baf40e7e wsd: quarantine: capture the maximum quarantine size
Change-Id: If30f0b7349e6605708e2bd5821b6e25558fba104
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
799b704e32 wsd: quarantine: capture DocKey
Change-Id: Ic22ac58210bad27d9a02d589828151548c4a1bd0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
6ab3bbbd09 wsd: quarantine: capture the document name
Change-Id: Id308a80e2d504d82e021e7333b78488dabbac687
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
08967941a3 wsd: quarantine: capture const values
Change-Id: I67233c8d5bbd0cf63133e6643dd0106c4c3bcae6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
0c0d7071ab wsd: quarantine: minimize explicit arg passing
Change-Id: I7b18abc96ccf0a217a806cf2259c539964bad553
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
0ccc182509 wsd: quarantine: provide the filename to quarantine
Utility classes/functions should not re-implement
any logic external to their function. The
path to the file to be quarantined is controlled
by other bits and QuarantineUtil is simply told
to quarantine the given file.

Change-Id: Iab351ccbf78953bb63f18c451321d34fe61f59b5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
6f0a5dce5b wsd: refactor FileUtil::Stat::isUpToDate
Historically, isUpToDate was created and used
in jail setup. But since in other cases we
might also need to compare files, we break
it into two functions. A new member called
isIdenticalTo, which simply does the comparison
and returns the result, and isUpToDate, which
calls isIdenticalTo and logs the result, as
expected by the jail management.

Change-Id: I6581970ad3e97e3fc0728055e6b57647baedf968
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
3825205042 wsd: quarantine: more encapsulation
Change-Id: Ifed497ad246fa9fb4a3d349aa579ce6e88793066
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
7ea3495f22 wsd: quarantine: convert Quarantine to a class
Change-Id: I9478f35e6c7c3f156aa15072e31c38bc84dc2b64
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
d81f2d71ed wsd: quarantine: smarter quarantine enabling
There is no good reason to check the config
repeatedly, especially that once we initialize
we should have the state.

Also, we should be able to disable quarantining
when we hit an error during initialization.
(As an aside, reading the config is slow and
throws exceptions that are caught internally,
which makes debugging for exceptions frustrating
when we repeatedly read config entries.)

Change-Id: I44a7800df96a370ef4d4cc1d6bb171f60f1499a0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
3c5a6963fe wsd: quarantine: encapsulate the quarantine path
Change-Id: I738a06b3a272a049ef8772fa0502a7f2de03c881
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
bd4589d142 wsd: quarantine: cleanup quarantined files when unloading cleanly
Change-Id: I1934bca783f94847c73e9c47d0e8c703dbe75a99
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
c42e74ec2f wsd: add fixme for safer jail removal
Change-Id: Id9dee5feae58f5394e2777941963ec949e59a194
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
0337ec5d81 wsd: FileUtil to link or copy files
Change-Id: I774a594440ee1b22e0e1ec7e4ab7d38e78f9ed5d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
c6dd263ab1 make: silence clang complaining of -pthread
The clang linker doesn't need -pthread and
warns of unknown command-line option.

This detects clang and forgoes the -pthread
flag to the linker.

Change-Id: I658cd887c567a5beeeae0e6e1b6d596231894c1b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
fd87ab6b32 wsd: clang tidy fixes
Change-Id: I7b3b08c8040ba4397ce660c5eaa1d0413c3ec611
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
d40aaec1e4 wsd: test: add quarantine test
Change-Id: Ic08f7ed0f177fc5e3a08b47e16ba8131c6dff788
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian
c658d0fb90 wsd: more accurate comment
Change-Id: I553c9b302e243cee15ab66e041a6fafe4adf41b8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Andras Timar
7e88b1160b rpm: fix path of setcap
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I737a3d298d457d608e5ccb377afa847ddadf2c4c
2023-05-15 09:09:37 +02:00
Szymon Kłos
8e81725635 jsdialog: make expanders work correctly
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I37a679fac92073172b7960a8d9a4eb116dd441d6
2023-05-15 07:55:22 +02:00
Szymon Kłos
7311927c15 jsdialog: fix snackbar css rule
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ie7442eb5f9b15556989e478718e07d34e65d0eab
2023-05-15 07:55:22 +02:00
Szymon Kłos
afbf052bb5 jsdialog: use minial size of a dialog needed
Use 'position: absolute' in jsdialog-window and jsdialog-container
so we don't stretch the dialog. It will use minimal needed size.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7b38b9200e190cfc184bf4bfe8b7bd814c60d5a6
2023-05-15 07:55:22 +02:00
Szymon Kłos
fd71e664b6 jsdialog: fix jumping ans dragging Page Style dialog
when html document has <form> and inside <button> with
id=style, instead of having map with properties in
style attribute, the form has reference to the button!

that caused not working dragging and updating the position
in writer format -> page style dialog

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ic3e35c096f537e6f3cdd4bd7b1a06af1302e7c9e
2023-05-15 07:55:22 +02:00
Szymon Kłos
e8e1e261dd jsdialog: dialog adjusted to size of biggest tab
this uses css grid to position all the tabs stacked
on each other at row 1 col 1. then when tab is hidden
we use 'visibility: hidden' instead of 'display: none'
so we hide content but leave white space needed for it.
this way we don't change dialog's size on tab switch when
tab has different size requirement, but we match dialog
to the size of biggest content

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I634e9f610c4e6dda4df38b85ee15cd58b3b18432
2023-05-15 07:55:22 +02:00
Andras Timar
fc19d7cb00 rpm: compatibility with older systemd versions
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I5674b74e7b2ac06ade0b34b33513d2100105b10d
2023-05-14 23:31:38 +02:00
Andras Timar
39e83470a8 Remove distro-specific code from rpm spec file
We'd like to build distro independent rpm packages.
Distro specific macros and other code were removed.
The empty environment file for systemd was removed, it can be
easily created by the user, if necessary.
The obsolete trigger for rebuilding the systemplate was removed,
because we no longer copy system libs to systemplate.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I0ac9be8f72a7089e38349abc1dff0d39b0410e44
2023-05-14 21:29:00 +02:00
Jaume Pujantell
cfe1fd955f enable export to pdf for readonly documents
Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: Ibcd149d51b20df552a0961c58b7c9159fbf0af9e
2023-05-14 14:43:07 +02:00
Henry Castro
107509260b browser: fix bundle exceptions
builddir != srcdir

Change-Id: I0c129d2bc9ea11fc0d46b37a72faa6a32a69b002
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-05-14 14:40:24 +02:00
Gülşah Köse
da19d1b39f Impress Draw: Fix insert field buttons
Draw: We should use uno:InsertPage* commands instead of uno:InsertSlide same
like compact view. We should use "Page Count, Page Number" instead of
Slide count Slide Number as button text. "Slide" word should be used for
only impress.

Impress: We should use InsertPage* commands instead of InsertSlide* same
like compact view.

Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com>
Change-Id: I91989d4d61b65bd3b719753300a14a5177ca9e95
2023-05-14 14:22:56 +02:00
Gülşah Köse
4220305fb6 Fix the layout of page number diaog #6285
Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com>
Change-Id: I00bd8d75a2e0ae509f78eda3ae1af687da088419
2023-05-13 22:32:09 +02:00
Gökay Şatır
9018e3f174 Enable one writer desktop test in track changes spec.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I3d465f331bda1f2619939e8d6d9ca89ef95a0026
2023-05-13 15:10:08 +03:00