Commit Graph
1100 Commits
Author SHA1 Message Date
Tor Lillqvist d552b4a549 Enable opening of downloaded fonts only in ForKit in Online
We want that only the ForKit process needs to have access to new font
files added to a Collabora Online instance dynamically by downloading
from a server. There are however many locations in the Kit process, in
core and in external libraries like harfbuzz, where the code wants to
open a font file.

Handle this so that the ForKit process opens such a downloaded font
file and doesn't close it. The file descriptor is thus inherited by
Kit processes.  The font file pathname passed on to other code is a
fake on in the format "/:FD:/%d" where the %d is the file descriptor
of the opened font file. Add checks in all places where font files are
opened, look for this special pathname format, and modify the code to
just dup() the already open file descriptor in that case.

All this is relevant for Linux only, as Collabora Online runs on
Linux.

Do the above for harfbuzz, cairo, fontconfig, and freetype.

In addition make sure that these libraries (except harfbuzz which
needs to be a static library and freetype) when bundled, on Linux, are
built as shared libraries, and won't be confused with the
corresponding system libraries by making sure their sonames are
different.

Change-Id: Ib059cb27e1637d07bb709249abd0d984f948caa9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140714
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146341
Tested-by: Jenkins
2023-02-09 13:47:02 +00:00
Caolán McNamara 58732c0760 cid#1520802 Dereference null return value
Change-Id: Iba193386d1ee82c8f47ece2445cfb2ecaeeed998
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146636
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-07 19:55:00 +00:00
Noel Grandin 00659bcdbb improve readability of VirtualDevice constructor
(a) It is not obvious what DeviceFormat::DEFAULT means
(b) There are two parameters (each with two states), but only really 2
possible overall states

So
(1) use more useful names
(2) combine the two parameters into one enum

Change-Id: Ic0595b39e032cc9e019b88326389d055b977da00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146589
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-07 10:19:32 +00:00
Szymon Kłos 52eba79371 Make LOKClipboard available to other modules
LOKClipboard has higher level dependencies (sfx2) so it cannot be
moved to the vcl where SystemClibpoard instance is created.

- introduce new interface LokClipboard to differentiate
  from SystemClipboard so we can have vcl's and lok's implementations
  at the same time
- publish LOKClipboard using new interface for other modules by adding
  component file in desktop module

Thanks to that when code calls GetClipboard and we cannot get clipboard
assigned to the vcl::Window* (for welded widgets) in GetSystemClipboard
correct instance is returned (shared clipboard for current view) so we
can access content which was copied before. Previously always a new
instance was created (with empty content).

test ScTiledRenderingTest::testPasteIntoWrapTextCell was broken
add some content to clipboard to simulate more real case
and test the content copied

Change-Id: I23c0298960a710c498646493f33122b908864cba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126310
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131644
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135198
Tested-by: Jenkins
2023-02-06 17:02:54 +00:00
Henry Castro 967c56f7d4 lok: fix query language status
The Calc and Impress return language status
as a SfxStringItem, but Writer is a SfxListStringItem.

Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I88f77288e422a8f80473f0e33257078cfaa704b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145675
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146479
Tested-by: Jenkins
2023-02-03 12:32:50 +00:00
Henry Castro f74031d4ea lok: add function getDocLanguages
If the spell checker is disabled to use a remote
spelling feature, the getLanguages function is obsolete.

In order to not break stable functions, introduce the
getDocLanguages for the remote spelling feature.

Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: Ic210f31eddd3208b29d073ff35ba4fa2d98ea772
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145363
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit bb0c63cc73998a0f67ae4c3e59acea3827a6e11c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146399
Tested-by: Jenkins
2023-02-03 12:32:24 +00:00
Henry Castro 56cb2b78db lok: disable spell if remote language tool enabled
.

Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I73158c3feaa84af4d713d3f1b1fc9a60dcf95463
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144785
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145601
Tested-by: Jenkins
2023-02-01 20:06:09 +00:00
Henry Castro 5cd9ca5d42 lok: add Rest Protocol property
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I7353e16dbf835684e5ce5963387359924352937b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143124
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145599
Tested-by: Jenkins
2023-01-31 16:04:39 +00:00
Mert Tumer 1fb964276c Added option to disable ssl verification for languagetool
This will allow to use self-signed certificates with local run
languagetool APIs

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I2bda575fa6174dfc0f6c24da45267ee732643db6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136811
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145594
Tested-by: Jenkins
Reviewed-by: Henry Castro <hcastro@collabora.com>
2023-01-30 22:12:03 +00:00
Mert Tumer 080d39e683 lok: set LanguageTool config parameters from environment
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ic7343439536abee626c269d2a824bb36f9abc40f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135583
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145573
Tested-by: Jenkins
Reviewed-by: Henry Castro <hcastro@collabora.com>
2023-01-30 17:23:24 +00:00
Ashod Nakashian e2d646665c lok: support per-user timezone
This adds support for user-specific timezone.

When none is provided during loading, the
system default is used.

Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Change-Id: Ie863450687eb82bc475268a09c9112e9fd50020f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144816
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit abaf8c0af1c6c7fe01276fdf2ae62419c7b0f654)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146211
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-01-29 13:22:28 +00:00
Tor Lillqvist d514097753 Surround recently added code that breaks on COWASM with ifdef
After 7a6324ea0d I started getting UNO
exceptions with the message "component context fails to supply service
com.sun.star.xml.crypto.SEInitializer of type
com.sun.star.xml.crypto.XSEInitializer".

It is likely that it breaks in the iOS and Android apps, too, so
bypass for those, too.

Change-Id: Id08afbf6bea071c8b0b6564342716e0b064cb712
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146071
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2023-01-24 15:17:30 +00:00
Henry Castro 7a6324ea0d lok: ensure to initialize the security context
if the backend NSS is used, before load the document
ensure the NSS is initialized otherwise NSS next functions
calls will fail.

Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I7ac1d7eeee681995e6c284e2dd4595a33d044af4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142213
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142289
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-01-23 21:47:29 +00:00
Noel Grandin cfb2a587bc rename BitmapEx::GetAlpha to GetAlphaMask
to ease the reading of code related to an upcoming patch to convert
transparency to alpha, since there is already a GetAlpha in Color.

Change-Id: I1af0f8f6dd94acfe4673c8556c7aff6c20da3f7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145209
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-11 08:57:13 +00:00
Miklos Vajna 913b399a73 vcl ITiledRenderable: rename supportsCommandValues() to supportsCommand()
It gets a single command (to determine if using it with
getCommandValues() is OK or not), so the plural was confusing, as
mentioned at
<https://gerrit.libreoffice.org/c/core/+/145082/5#message-802b1be9194440a3dcee0cad5e54795cbbdea584>.

Change-Id: Idf3c81aadeaeb3d42a50aba2ac58d5ed4278651f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145212
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-01-10 07:06:30 +00:00
offtkp c010b5d2b2 tdf#86630 sw: Add one-step page number insertion wizard
Add a one-step wizard for easy insertion of the page number to the
header/footer.

Change-Id: Idb33c92d594e04d9256460fe414e4b10e5166af5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144683
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-01-06 07:42:32 +00:00
Miklos Vajna bb20dee2ef sw lok: expose field type & command of fieldmark under cursor
It was possible to get the properties of all fieldmarks, but you could
not get the properties of the fieldmark under the current cursor.

Getting the properties of the current fieldmark is useful for Zotero: if
we already have a citation and want to insert one more, then we should
turn the current citation into a citation cluster.

Fix the problem by adding API similar to what commit
24219cc1e9 (sw lok, .uno:TextFormFields:
expose field code of fieldmarks, 2022-11-25), did: but here we return
properties of the innermost fieldmark, not all fieldmarks.

Also introduce a ITiledRenderable::supportsCommandValues(), this way
next time a command value getter is added in sw/sc/sd, no need to touch
desktop/ anymore.

Change-Id: I7f1a7064307034a18527ab5e985d2eac56807cb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145062
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2023-01-05 08:33:16 +00:00
Miklos Vajna 3585d0414f sw, lok: implement a getCommandValues(Fields)
There was no LOK API to get a list of all fields of a given type where
the name matches a certain prefix.

This is useful in case the API cilent wants to know what previously
inserted refmarks were deleted by the user as part of deleting text
content.

Add a new getCommandValues(".uno:Fields") that returns the names of
matching refmarks. Do not return the refmark text, assuming that would
be updated by the API client anyway.

In practice this is needed by Zotero in case it wants to model its
citations with refmarks.

Change-Id: Ie469253891896aa8ab00d434c9ab116adbe3864b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144985
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2023-01-03 11:58:27 +00:00
Tor Lillqvist de3b4b0200 Introduce lo_get_app_data_dir() for Emscripten, too
And not just Android. Hardcoded to return "/instdir" to match what is
in the emscripten_fs_image.

Change-Id: I26d4ec5e02ec9900e35ca47f1565a13ad2b723b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144849
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-12-28 13:08:56 +00:00
Caolán McNamara 1726c27e0d check SfxObjectShell::Current()
SfxObjectShell::Current() can return null, it's based on the equally
vile SfxViewFrame::Current()

Change-Id: Ia5c7783680e9d8e5d3075078f16a2c15cb6f7a47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144339
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-16 21:17:15 +00:00
Caolán McNamara 70e2383eaa misc: check SfxViewFrame::Current()
these ones look potentially worth backporting

Change-Id: Ie01c0b598c3408f4766318267de8438e997dd1a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144278
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-16 10:23:09 +00:00
Tor Lillqvist 1e421b30e2 Attempt to add ifdefs for WASM (Emscripten) for LOKit-based code
Change-Id: I5b2556d1be61fa3a1d7996ce8d61958fbe7984c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144002
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-12-13 08:19:40 +00:00
Miklos Vajna e0bf2712aa sw, lok: implement a getCommandValues(Bookmarks)
There was no LOK API to get a list of all bookmarks where the name
matches a certain prefix.

This is useful in case the API client wants to know what previously
inserted bookmarks were deleted by the user as part of deleting text
content.

Add a new getCommandValues(".uno:Bookmarks") that returns the names of
matching bookmarks. Do not return the bookmark text, assuming that would
be updated by the API client anyway.

In practice this is needed by Zotero in case it wants to model its
citations with bookmarks.

Change-Id: I42a544c3c64496519eec6826b58a310ec86dee74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143764
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-12-07 12:30:52 +00:00
Miklos Vajna 5e8f6dcb8c sw lok, .uno:SetDocumentProperties: expose value of custom document properties
LOK API clients currently have no knowledge about document properties.

Clients like Zotero that want to store custom properties on documents
need a way to read and write such properties. This commit focuses on the
reading side.

Add a getter for .uno:SetDocumentProperties that allows filtering for a
certain prefix, this way the returned value can contain only the
relevant information.

Rework doc_getCommandValues() and SwXTextDocument::getCommandValues() a
bit, so adding new getters require less duplication.

Change-Id: I0c52cd2efcc8b1ea7307763c8252dd1e8ffdea2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143468
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-30 08:13:28 +01:00
Miklos Vajna 24219cc1e9 sw lok, .uno:TextFormFields: expose field code of fieldmarks
The fieldmarks in a document were kind of invisible for LOK clients
previously.

The Zotero use-case requires a way to fetch certain types of fieldmarks
from a document, to be able to update them and then write back those
updated versions to the document later.

Fix this by introducing a new .uno:TextFormFields, you can get its value
using the getCommandValues() LOK API. This allows filtering for a
certain field command prefix, which is generic, but e.g. in the Zotero
case allows getting the citations or the bibliography. The returned JSON
is an array of matching fieldmarks, containing their type and field
command. It seems there is no way to return the field result, till the
motivation is to just update that field result. (If there will be need,
the field result can be added.)

Do this in a way that next time we add a Writer-specific command (to be
able to return its values), there will be no need to touch
include/vcl/ITiledRenderable.hxx, causing a large rebuild.

Change-Id: I2ef1159bec4034bbdd6b4ba00715a69423106edd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143275
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-25 16:16:39 +01:00
Szymon Kłos 931e3d204e lok: masterpage: Introduce mode property to tile rendering
This is needed for Impress which can have slides in
two Edit Modes: Master Page and Page.

Change-Id: I3eca0f51ba7970e793026d1ac6aa09b19b7a904b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137869
Reviewed-by: Ashod Nakashian <ash@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142969
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-11-19 18:16:16 +01:00
Szymon Kłos bac26f91ae lok: masterpage: disable callbacks on painting
We did that only for original view, but we need to disable
callbacks for used view - so when we switch mode or part it
will not send the notification to the client.

Bug fixed by this patch:
1. open impress in two LOK sessions
2. A enters MasterPage mode
3. B switched slide
4. A exits MasterPage mode

result: A was switched to the slide selected by B

Change-Id: I7dde8bb4c73862813d064319922aba4c4b727db9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142716
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ash@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142966
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-11-19 17:44:34 +01:00
Mike Kaganski dbc307ef7c gtktiledviewer: Fix getting tiles on Windows
The "CanvasSize + 1" hack was implemented by myself in commit
ebb3a72ba0 (Paint tiles on Windows;
Oct 24 09:01:32 2022 +0200) to workaround a rounding error, where
converting pixels to logic and back resulted in 1 pixel smaller
size (when I worked in Writer). This hack breaks in Calc, because
the size then is 1 pixel larger than expected, failing the assert
below.

This fixes the problem by disabling the map mode, as everywhere
else in such cases.

Change-Id: I37f0f03ae4cb19f2de0e7995064843d17b0c7189
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142714
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-11-14 19:22:04 +01:00
Szymon Kłos ff9b994440 lok: Introudce getDataArea for Calc
It will share information about real size of a data inside
spreadsheet so we can easily check where data ends in online
side.

Change-Id: I376187a33c5c82d409f559d5cc826a4f36d4252e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139472
Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142503
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-11-10 10:16:52 +01:00
Szymon Kłos 3f4e11bd40 lok: masterpage: use EditMode as parameter in invalidation callback
Change-Id: I3905fc9e6376ca1cef3e438e7a5f229d3720b1f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138961
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142501
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-11-10 10:15:46 +01:00
Andras Timar cbfac11330 Send build config (configure options) in LOKit version info JSON
Change-Id: I29a6cca467e5f1e9ba59528edefbb397ceb81780
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141197
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141494
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-11-07 20:35:46 +01:00
Mike Kaganski 14ed342dd3 lok: show Math cursor
Change-Id: I17a449f0a0662f0433de9cad1522a090434c1e30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142178
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-11-05 09:19:07 +01:00
Henry Castro f43a5ec28d lok: fix convert-to batch mode, quiet interaction
If it is a batch mode to convert *.csv to *.ods,
use the quiet interaction to avoid unwanted filter dialogs.

Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I4ef82c1079888ae099084072c146b5db4cc0f2a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141950
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ash@collabora.com>
2022-10-31 13:29:39 +01:00
Ashod Nakashian 038c4a4283 lok: support embedded media
Change-Id: Ie8f3ed188cec0050a10a5d49325756931b902ef1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141807
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-10-26 08:18:55 +02:00
Mike Kaganski ebb3a72ba0 Paint tiles on Windows
A step toward enabling gtktiledviewer on Windows
Not the nicest solution, but it does the job initially.

Change-Id: I9144c2b899eb122e918123a70279cd50a4a02df1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141710
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-24 14:08:42 +02:00
Mert Tumer e20d2de783 new uno command uno:Translate with deepl api
New Uno command added for translation
right now it is only using deepl translation api

There's a section in the options > language settings
for setting up the api url and auth key

uno:Translate is a menu button under Format tab
which will bring up Language Selection dialog for translation.

DeepL can accept html as the input for translation, this new
feature leverages that by exporting paragraphs/selections to
html and paste them back without losing the formatting (in theory)
This works good in general but we may lose formatting in very complex
styled sentences.

Translation works in two ways;
1) Whole document
when there is no selection, it assumes that we want to translate whole
document. Each paragraphs is sent one by one so that the output timeout
can be minimum for each paragraph.
2) Selection

Change-Id: Ia2d3ab2f6757faf565b939e1d670a7dedac33390
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140624
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-10-12 16:52:03 +02:00
Mike Kaganski 3d236177be Deduplicate O(U)StringConcatenation
And use an overloaded helper function with a better (?) unified name
to show that the result is not an O(U)String.

Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-11 12:46:01 +02:00
Noel Grandin 4b95451f85 split utl::TempFile into fast and named variants
which makes it easier to know what each variant requires
to stay on it's happy path

Change-Id: I3275a2543573367714bc78092e882f6535507285
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-29 09:11:18 +02:00
Szymon Kłos cd0e3d61f2 lok: create sidebar on demand
Change-Id: I5393bba647aa4667643262e77acc6b6873afb571
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139729
Reviewed-by: Ashod Nakashian <ash@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140580
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-09-26 10:23:48 +02:00
Ashod Nakashian ddc5a7bb10 lok: initialize the load-language
We need to use the load-language for
saving the document. This is to avoid
using the language of the view that is
issuing the save, which causes all sorts
of issues (language-translation related).
This logic was implemented in 4b7b449bbdc5
but for some reason the load-language
wasn't set.

This patch sets the load-language.

Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Change-Id: I0cd1574d48a99e6ee84bacf75fc0d9ebe26e526b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137391
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit a0b2739b2354b622538304c0846606247bcf09c0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140362
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-09-22 08:30:12 +02:00
Tor Lillqvist b20a64ce05 Ignore also when a font has been substituted by itself with an empty style
Change-Id: I40fbce716a11b010323ac07e0dacdc114f7d2320
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140135
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-09-19 10:44:36 +02:00
Noel Grandin fd3888c69a move ErrCode to comphelper and improve debug output string
need to move it, because modules "below" vcl want
to use the debug output method

Change-Id: Ibcaf4089a1e0b3fcc0b5189c7ebf1aae90f50b48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139791
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-14 08:34:38 +02:00
Povilas Kanapickas 99b85a2eda vcl: Rename Gesture event to GesturePan
We have 5 gesture types: GestureZoom, GestureRotate, Gesture (for
panning), Swipe and LongPress. For consistency all of these will use
Gesture as a prefix to reduce confusion and for easier grepping
throughout the codebase.

Change-Id: I8b9e245d011203a19c1172f9833c172f65382ca9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139241
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-05 16:20:03 +02:00
Tor Lillqvist 63f7765c1d Use more idiomatic C++
Change-Id: I0e9460f2500b76bec049c12413fbbee5dcb239c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139149
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-09-01 13:41:43 +02:00
Tor Lillqvist ebb73e9e22 More handwaving: Assume that it's OK to substitute OpenSymbol for Symbol
And that when that happens, there is no reason for a LibreOfficeKit
client to optionally warn the user that the Symbol font is
missing. (Which it always will be, in that case, on Linux.)

Change-Id: I2d60721c826cb3053197a19be8a69b71cbd98e5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139108
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-09-01 11:10:00 +02:00
Andrea Gelmini 9ba1e1486b Fix typos
Change-Id: I4ed7373afbb4102bbfaf0565c248a5cc84bd3ab4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139068
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-08-31 07:19:56 +02:00
Tor Lillqvist 238c06f070 Filter out well-known metric-compatible font substitutions
Change-Id: I9da63c173dcc926f577052b704284065b384f960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139038
Tested-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-08-30 17:28:20 +02:00
Tor Lillqvist be7d650195 Add SAL_INFOs for the recorded and pruned font substitutions
Change-Id: Ice7b64c87bff6dbc0eead7bda36f3b0a678986e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139037
Tested-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-08-30 16:10:42 +02:00
Tor Lillqvist d9ef862368 Fix typo
Change-Id: I857bdb7831bd1e4158f80f09ec232d76d4db794e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139029
Tested-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-08-30 13:14:32 +02:00
Andrea Gelmini d9ed7e3e33 Fix typos
Change-Id: I28943475fe35aadab44b8bd2a87f1ea84c49dff2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138857
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-08-26 07:08:03 +02:00