send status after performing any comment operation,
updating status send page dimensions,
which help in canvas layer to resize actual page size
without updating page size comments may go out of view
and will also not be scrollable into view
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I489648bb5ccd7223746fea42050088e078046a1a
By defining NoCapsForKit and NoSeccomp
as const values for the KIT_IN_PROCESS
case, we have a more consistent and
simpler call-site.
Change-Id: Ife553eab9eaffd96560d4cfb4b8fdcdf26a1b9db
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
"Specifies whether the macro execution is enabled in
general. This will disable Basic, Beanshell, Javascript
and Python scripts. If it is set to false, the
macro_security_level is ignored. If it is set to true,
the mentioned entry specified the level of macro security".
Change-Id: I4bc5b690268a93994d17e2b02b7b60b6398646b7
Signed-off-by: Henry Castro <hcastro@collabora.com>
The commit in question breaks two unit-tests: wopi-template
and copy-paste. Temporarily reverting until the regressions
it introduces are resolved.
This reverts commit be68f06f70.
Change-Id: I1fafd73fdea57077eea05a146b7df0b013e6e8ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Otherwise the LOK_CALLBACK_STATUS_INDICATOR_FINISH
message is lost, and client side does not receive
it when Macro Security dialog popup.
Change-Id: Ife52c77078160b8cc1075eff9137de2d26b87b55
Signed-off-by: Henry Castro <hcastro@collabora.com>
Otherwise this will break badly in the collaborative editing (multiple
views) case.
Change-Id: I63d391cb5a7d118c34564c4e1a4df7710b13e90e
Signed-off-by: Tor Lillqvist <tml@collabora.com>
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>
This resolves a dependency on userName
(a.k.a. UserFriendlyName) that was a source
of issues when missing.
It turns out that when it's missing but
spellOnline is set, an edge-case caused
an exception that failed loading.
The spellOnline value, in its turn, was
incorrectly set to "null" when in fact
it was missing. This resulted in online
spell-checking being active by default.
Perhaps this was intentional, but here
we don't change this behavior at all.
Instead, we avoid sending "null" when
it's missing, and by default we always
enable online spell-checking, unless
it is explicitly set to "false".
This way, the exception is not thrown
and spellOnline doesn't have invalid
values, while preserving the current
behavior.
Change-Id: I4a09ac44ff5d6147c715afa0fb34af9650da4afd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is needed to show help in macro security warning
dialog which is showed before the document is loaded.
Change-Id: Ic50bac0c860c5673ce3ec854e54d658157d2a9dd
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
e.g. in case of CODE AppImage, that is built from packages,
/etc/loolwsd/loolkitconfig.xcu will not be good, the good
location is within the AppImage's file system.
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ie2bf56cd95781c193a0e7185bd96d40c4849d920
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>
The other code in this function carefully checks before indexing the
tokens vexctor. We have already stored the integer from tokens[1] (if
it exists) in winId. So use that in one more place instead of
tokens[1] for consistency.
Change-Id: I2bc09b3e44e0549a94469d7569f724df17a113b3
Signed-off-by: Tor Lillqvist <tml@collabora.com>
This method needs to be called with having the correct view activated.
It caused a crash in writer/simultaneous_typing multi-user cypress test.
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: I57dd58a635ce7ea127200a6a3f0cadc8c0861aaf
I don't recall if simply ifdeffing is the proper way to bypass UnitKit
stuff (that I don't understand) for the mobile apps, but at least it
helps.
Signed-off-by: Tor Lillqvist <tml@iki.fi>
Change-Id: I85d477e4ee7d11c597d95a9b0b42af7e5f7ad122
* and fix error reporting: we do not abort every time when loolforkit
is invoked with incorrect user name
* and better readability of the conditions
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Idc9db40c00d41c95160db130eb324c487f14de17
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>
In some cases we cannot do a fast bind-mount of the files we want
in our jail since we don't have cap_sys_admin for loolmount inside
eg. docker.
Thus we need to fallback to hard-linking, however various security
systems namespace parts of our tree, such that link() fails with
EXDEV even across the (apparently) same file-system.
As such we need to assemble a copy of what we want to hard-link
close to our jails. However, this needs to be owned by root / the
system to avoid having writable files shared between jails. Hence
we need cap_chown in addition to cap_fowner, to get ownership right
and then hard-link.
Change-Id: Iba0ef46ddbc1c03f3dc7177bc1ec1755624135db
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Before loading the document and if it has an embedded
macros, it will show the "Macro Security Warning"
message dialog.
If the input process is not enabled, the result will be
a virtual deadlock, so it should filter some messages at least.
Change-Id: I565569a0227ac0e7ce2feae2cf3ccdf21ce4b1d4
Signed-off-by: Henry Castro <hcastro@collabora.com>
Most C and Posix API clobber errno. By failing to save
it immediately after invoking an API we risk simply
reporting the result of an arbitrary subsequent API call.
This adds LOG_SYS_ERRNO to take errno explicitly.
This is necessary because sometimes logging is not done
immediately after calling the function for which we
want to report errno. Similarly, log macros that log
errno need to save errno before calling any functions.
This is necessary as the argements might contain calls
that clobber errno.
This also converts some LOG_SYS entries to LOG_ERR
because there can be no relevant errno in that context
(f.e. in a catch clause).
A couple of LOG_ macros have been folded into others,
reducing redundancy.
Finally, both of these log macros append errno to the
log message, so there is little point in ending the
messages with a period.
Change-Id: Iecc656f67115fec78b65cad4e7c17a17623ecf43
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Although we already save it for 256x256 regular
tiles, we use smaller tiles for preview requests
everytime there is a preview request the pixmap has to
recreated. Used unordered_map instead to keep different
resolutions saved for re-use
Change-Id: I3ced6b08b6e5f8096195b253abba8bb5afdffa3c
Signed-off-by: mert <mert.tumer@collabora.com>
Cleans up some of the conversions and implicity
unit in integral types.
Change-Id: I79f35b92f8f631894e55bdb39851b050870fce96
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Also, makes the logging of units much less error prone.
The overloaded streaming operators are temporary as
they are provided in C++20. The ones here (though
incomplete) are fashioned after the C++20 specs.
Change-Id: Ieb499282ccb6e63fa939ba07bed3e5a4fbef1bd0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>