LibreOffice.git
2 years agosw HTML export: handle field shadings view optionprivate/mmeeks/cp-6.2-bits
Miklos Vajna [Tue, 12 Mar 2019 09:21:36 +0000 (12 10:21 +0100)]
sw HTML export: handle field shadings view option

Regardless of the value of the View -> Field Shadings option, shadings
were always lost when saving to HTML.

Implement handling of this in the HTML conditionally, so in case that
UI option is on, then shadings are preserved in the HTML result;
disabling that option results in the old behavior, though.

Change-Id: I1bd19f4c6e22aff2f84fac25f0a506ad0127cc3c
Reviewed-on: https://gerrit.libreoffice.org/69081
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2 years agoFix certificate test mis-merging.
Michael Meeks [Sat, 3 Aug 2019 22:53:15 +0000 (3 18:53 -0400)]
Fix certificate test mis-merging.

Change-Id: Iea997c8eab371f278d181de0cc61323a25f0d1ae

2 years agoLOK: Enable embedding images in text/html format output
Ashod Nakashian [Sat, 20 Jul 2019 10:01:38 +0000 (20 11:01 +0100)]
LOK: Enable embedding images in text/html format output

Change-Id: Ibd8bed796678ee26de2ceb6e434dce24da4eab05

2 years agosw HTML export, field shadings: give text portion background priority
Miklos Vajna [Tue, 12 Mar 2019 17:43:43 +0000 (12 18:43 +0100)]
sw HTML export, field shadings: give text portion background priority

If the user explicitly gives a background color to the field portion,
then respect that, don't overwrite with the field shading (the UI does
the same).

Change-Id: I7c35618f82a37ef1dd16c03b82651268767813af
Reviewed-on: https://gerrit.libreoffice.org/69127
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2 years agolok: add signDocument to "Office" iface - to sign not opened docs.
Tomaž Vajngerl [Mon, 31 Dec 2018 11:27:39 +0000 (31 12:27 +0100)]
lok: add signDocument to "Office" iface - to sign not opened docs.

LOKit function "signDocument" can sign document without the need
to open them. This is useful to sign PDF documents after they are
created from a currently opened (ODF, DOCX) document.

This adds DocumentDigner to sfx2, which could also be used in
desktop LibreOffice without opening them and in further tests.

Change-Id: Id6f242e817f594aa672f94f9c6f9b34e4035d46a
Reviewed-on: https://gerrit.libreoffice.org/65767
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2 years agolok: add test signing DOCX -> testInsertCertificate_PEM_DOCX
Tomaž Vajngerl [Wed, 26 Dec 2018 19:46:16 +0000 (26 20:46 +0100)]
lok: add test signing DOCX -> testInsertCertificate_PEM_DOCX

Change-Id: I1918041793935b012e60fe64073480ed4b9581d5
Reviewed-on: https://gerrit.libreoffice.org/65630
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2 years agolok: simplify and cleanup testInsertCertificate_{PEM,DER}_ODT
Tomaž Vajngerl [Wed, 26 Dec 2018 19:44:57 +0000 (26 20:44 +0100)]
lok: simplify and cleanup testInsertCertificate_{PEM,DER}_ODT

Change-Id: I61891d1295a342e546cab56ef80315c9f5018f90
Reviewed-on: https://gerrit.libreoffice.org/65629
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2 years agoFix signing empty Configurations2/accelerator/current.xml
Tomaž Vajngerl [Mon, 24 Dec 2018 14:11:30 +0000 (24 15:11 +0100)]
Fix signing empty Configurations2/accelerator/current.xml

When determining if a file is an XML file for siging, we need to
read the manifest file to get an accurate detection. In case when
we were signing in the GUI the manifest file was read when the
storage was set. When we didn't sign over the GUI, the manifest
was never read: the code was only present in the GUI code -
"documentsignaturesdialog.cxx" so the detection was wrong and
isXML returned "true" for current.xml.
With this we move the manifest reading to DigitalSignatureManager,
where the manifest is read when needed.

Change-Id: If45a32af6410bc5f7c5afdb976b182bd69ab7d6b
Reviewed-on: https://gerrit.libreoffice.org/65600
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2 years agotest signing with certificate chain and private key in PEM format
Tomaž Vajngerl [Thu, 29 Nov 2018 21:09:07 +0000 (29 22:09 +0100)]
test signing with certificate chain and private key in PEM format

Change-Id: If3b121e44ceec8be668820a7e8a9e35c15d547ff
Reviewed-on: https://gerrit.libreoffice.org/64295
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2 years agolok: vital to quote nested JSON inserted into a json property.
Michael Meeks [Fri, 28 Jun 2019 11:30:40 +0000 (28 12:30 +0100)]
lok: vital to quote nested JSON inserted into a json property.

Somehow this managed to work fine in most browsers, but when
the Kit/Poco tried to parse JSON to extract viewID it could explode.

Change-Id: I39d2ecc9ee95b7e6f67a23c8b15f9a1d01769ddc

2 years agoXTransferable2 - add missing 'since' tag on isComplex.
Michael Meeks [Fri, 2 Aug 2019 17:13:51 +0000 (2 13:13 -0400)]
XTransferable2 - add missing 'since' tag on isComplex.

Change-Id: Ib8165edb4d87fb5bbb115fe26b8dbbe5a70bd59a

2 years agolok: minimal implementation of isComplex for calc for now.
Michael Meeks [Sat, 20 Jul 2019 10:15:05 +0000 (20 11:15 +0100)]
lok: minimal implementation of isComplex for calc for now.

Change-Id: Ic4141d30a0ff48a9ec5ecc8e6119d9d779c4a0fc

2 years agoadd parameter TransformRotationDeltaAngle to .uno:TransformDialog
Henry Castro [Wed, 14 Nov 2018 02:31:25 +0000 (13 22:31 -0400)]
add parameter TransformRotationDeltaAngle to .uno:TransformDialog

Change-Id: Ib22ba6956afedf1eea055e0ac3a78c53b4ee5861

2 years agoLOK: Improved selection complexity detection
Ashod Nakashian [Wed, 26 Jun 2019 03:45:37 +0000 (25 23:45 -0400)]
LOK: Improved selection complexity detection

Only Graphics and OLE now unconditionally
trigger 'complex' case, and for all others,
we actually tally the number of text characters.

Currently anything above 512KB is flagged as 'complex'.

Change-Id: I19fbef72f2eb725648b2a18c1ee41b1612d2bac0

2 years agolok: update graphic selection callback description
Marco Cecchetti [Tue, 26 Mar 2019 14:11:33 +0000 (26 15:11 +0100)]
lok: update graphic selection callback description

Change-Id: I1ae073cc8e307b5c42aed9b17d405ef36ce4dc43
Reviewed-on: https://gerrit.libreoffice.org/70569
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2 years agolok: chart: informing the client about selection handling properties
Marco Cecchetti [Wed, 10 Apr 2019 19:04:51 +0000 (10 21:04 +0200)]
lok: chart: informing the client about selection handling properties

We hijack the chart CID protocol (CID:/classification/ObjectID) by
inserting information about selection handling properties (draggable,
resizable, rotatable) btw the classification section and the ObjectID
section.
This new section has the form: /Draggable=?:Resizable=?:Rotatable=?
where in place of '?' there is 0 or 1.
The hijacking occurs at the ChartController.getSelection method which
is available through the XSelectionSupplier interface.

Change-Id: Iaf920fe68e59c2595000e43d3fc1f976632cef18
Reviewed-on: https://gerrit.libreoffice.org/70567
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2 years agolok: dragging and resizing chart elements
Marco Cecchetti [Wed, 10 Apr 2019 13:49:12 +0000 (10 15:49 +0200)]
lok: dragging and resizing chart elements

This patch make possible to set the new position or size of a chart
object through setting directly the property value instead of sending
mouse events to the core.

An ~empty commit - an unfortunate artifact of cherry-picking / fixups.

Change-Id: Ifc06dac6bdad78081d63e0ea0db55563a1ae57bc
Reviewed-on: https://gerrit.libreoffice.org/70566
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2 years agolok: writer: svg export transformed images
Marco Cecchetti [Wed, 10 Apr 2019 13:13:53 +0000 (10 15:13 +0200)]
lok: writer: svg export transformed images

Change-Id: I908a6e01573c35c0641519f4995730af0b033c33
Reviewed-on: https://gerrit.libreoffice.org/70565
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2 years agolok: sw: dragging image through SID_ATTR_TRANSFORM uno messages
Marco Cecchetti [Wed, 12 Dec 2018 09:39:39 +0000 (12 10:39 +0100)]
lok: sw: dragging image through SID_ATTR_TRANSFORM uno messages

In writer the new solution for dragging images through a uno message
to the transformation dialog didn't work.

Change-Id: Ie2c5fa7c3b724b6a8cba9970ee070c9998730a29
(cherry picked from commit c52d94454c46fa6a0e64081127b511bcde4f7a3e)
Reviewed-on: https://gerrit.libreoffice.org/70564
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2 years agosvg.js: the SVG Path polyfill doesn't work with Firefox 59 and later
Marco Cecchetti [Wed, 12 Dec 2018 16:04:21 +0000 (12 17:04 +0100)]
svg.js: the SVG Path polyfill doesn't work with Firefox 59 and later

We use a drop-in replacement for the SVGPathSeg and SVGPathSegList
APIs that were removed from SVG2. Unfortunately the embedded version
of this polyfill doesn't work anymore with Firefox 59 and later.

It has been needed to adapt a new version of the same polyfill.
(See https://github.com/progers/pathseg)

Change-Id: Ib5208d67022e585b7a5fb24e37cc446f50e57ee3
(cherry picked from commit 1b2aedb7b9f81bb6b43b64559cab00956c189f82)
Reviewed-on: https://gerrit.libreoffice.org/65548
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2 years agolok: shape scaling rework
Marco Cecchetti [Thu, 29 Nov 2018 21:37:45 +0000 (29 22:37 +0100)]
lok: shape scaling rework

Now shape scaling is handled through the transform dialog instead of
simulating a drag and drop event in core.

For Impress the unit used for length is '100th mm' instead of twips,
so we need to transform positions and size from twips to '100th mm'.
Anyway since we don't know in SetGeoAttrToMarked if the new data is
due to a mouse event or by entering a new value in the transormation
dialog or in the side pane, for Impress we need to convert the new
values sent by the dialogs from '100th mm' to twips which are
converted back in SetGeoAttrToMarked.

For performing a uniform scaling when the shape/image is rotated we
need to inform the client about the rotation angle for the selected
graphic object that has been achieved but appending an angle argument
to the graphic selection callback.

Now it is also possible to reverse shapes/images through negative
scaling.

Change-Id: I8a32f3e4b28f36e884a59c59b7e1351e85ef4489
Reviewed-on: https://gerrit.libreoffice.org/64696
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2 years agolok: get correct handlers for a single rotated shape
Marco Cecchetti [Thu, 22 Nov 2018 18:40:35 +0000 (22 19:40 +0100)]
lok: get correct handlers for a single rotated shape

Change-Id: I74668ca8079d8d56b8c3f2c4513e2a2ec95872c6

2 years agoLOK: re-factor async key & mouse event re-posting.
Michael Meeks [Wed, 13 Mar 2019 16:18:11 +0000 (13 17:18 +0100)]
LOK: re-factor async key & mouse event re-posting.

A fairly pure re-factor, although adding disposed window
checking to a number of sites with a warning.

Moves the event emission helpers from VCL into SfxLokHelper: we're
going to need more view / integration here next anyway.

Removes lots of copy/paste horror.

Change-Id: I279c11a1d8093b4feeeb6b7850f500806fff80dd
Reviewed-on: https://gerrit.libreoffice.org/69218
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2 years agocid#1399432 Uncaught exception
Caolán McNamara [Tue, 16 Jul 2019 13:04:42 +0000 (16 14:04 +0100)]
cid#1399432 Uncaught exception

Change-Id: I6dd5ce2e3b5b9d30d4e7e56c837fd8ccff6c99a3
Reviewed-on: https://gerrit.libreoffice.org/75733
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2 years agofix copy/paste mistake in TOOLS_INFO_EXCEPTION
Noel Grandin [Fri, 14 Jun 2019 12:23:19 +0000 (14 14:23 +0200)]
fix copy/paste mistake in TOOLS_INFO_EXCEPTION

Change-Id: I209efe41639eeff215b876cb1da5c9a8252f4b55
Reviewed-on: https://gerrit.libreoffice.org/74042
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2 years agoadd TOOLS_WARN_EXCEPTION,etc macros
Noel Grandin [Thu, 13 Jun 2019 09:56:46 +0000 (13 11:56 +0200)]
add TOOLS_WARN_EXCEPTION,etc macros

to be used for nicer logging of exceptions, along with upcoming clang
plugin

Change-Id: I028c31ec329652e4842136528605b4cceaae946d
Reviewed-on: https://gerrit.libreoffice.org/73949
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoclipboard: elide string constructor.
Michael Meeks [Fri, 2 Aug 2019 19:26:32 +0000 (2 15:26 -0400)]
clipboard: elide string constructor.

Change-Id: I1f476d981989296138ab9b9b58075919da4c09b8

2 years agoclipboard: elide string constructor.
Michael Meeks [Fri, 2 Aug 2019 17:58:48 +0000 (2 13:58 -0400)]
clipboard: elide string constructor.

Change-Id: I18c01e77e0ddf4b86f2f5ba610509555160f96c3

2 years agoRemoved duplicated include
Andrea Gelmini [Fri, 2 Aug 2019 16:37:43 +0000 (2 18:37 +0200)]
Removed duplicated include

Change-Id: Ic54fab581f34f385f5a6395bb39020299fbf2bde
Reviewed-on: https://gerrit.libreoffice.org/76882
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2 years agoUse implicit OString constructor and cleanup casts.
Michael Meeks [Sat, 27 Jul 2019 20:56:46 +0000 (27 16:56 -0400)]
Use implicit OString constructor and cleanup casts.

Change-Id: I686c32d3666bceb23dd86a4220428fa319ffdf45

2 years agoclipboard: repair unit test so that it runs in the lok mode.
Michael Meeks [Thu, 25 Jul 2019 18:02:47 +0000 (25 19:02 +0100)]
clipboard: repair unit test so that it runs in the lok mode.

SwTransferable::AddSupportedFormats needs the kit to be active.

Change-Id: Id84210eb2e526785f35dfae609d861c310885314

2 years agoclipboard: log before erasing
Ashod Nakashian [Mon, 22 Jul 2019 23:00:23 +0000 (22 19:00 -0400)]
clipboard: log before erasing

Change-Id: I6d59cdd31c62bbc7db81ccb8985745f68d19cd28

2 years agoclipboard: check for null.
Michael Meeks [Tue, 23 Jul 2019 08:49:11 +0000 (23 09:49 +0100)]
clipboard: check for null.

Change-Id: I07060035a9744642c98d4a0946695408dc0f6b42

2 years agolok: share more of the clipboard mime-type handling code.
Michael Meeks [Mon, 22 Jul 2019 08:48:46 +0000 (22 09:48 +0100)]
lok: share more of the clipboard mime-type handling code.

Change-Id: I98fc9fa0fd1b5afa00c33b642d2d504eab0b62ba

2 years agoclipboard: encourage paste to show up by having some dummy content.
Michael Meeks [Sat, 20 Jul 2019 10:22:09 +0000 (20 11:22 +0100)]
clipboard: encourage paste to show up by having some dummy content.

Having an empty system clipboard is a hyper-unusual state, but
this is quite common for new lok instances. If we populate some dummy
state we can hide that.

Allows context-menu paste into new documents.

Change-Id: Ia180dd370c180d2d666cc57330db6c1385578a36

2 years agoTry harder to generate HTML from text.
Michael Meeks [Fri, 28 Jun 2019 17:36:15 +0000 (28 18:36 +0100)]
Try harder to generate HTML from text.

Change-Id: I5b4778cceefc652274a72b779cd6c060a50bf06c

2 years agoSet clipboard for a window when created
Szymon Kłos [Sat, 20 Jul 2019 10:07:56 +0000 (20 11:07 +0100)]
Set clipboard for a window when created

This allows to paste in dialogs input using tunneled context menu.

Change-Id: Ie6cc6f1a6cd453734c8f6084b0bd50d1d7ab6c09

2 years agoLOK: Copy Graphics as embedded PNG in HTML
Ashod Nakashian [Sat, 20 Jul 2019 10:07:01 +0000 (20 11:07 +0100)]
LOK: Copy Graphics as embedded PNG in HTML

Change-Id: Id8c14d7304d30bfcd956b126dfe291ef044f62bf

2 years agolok: cleanup clipboards associated with a view on destruction.
Michael Meeks [Sat, 20 Jul 2019 10:05:49 +0000 (20 11:05 +0100)]
lok: cleanup clipboards associated with a view on destruction.

Also defer destruction potentially indefinitely for bad users who
quit without destroying views, documents, shutting down nicely etc.

Change-Id: Ieea6ad00b2983d372b745179bfe3b884c3c64eb0

2 years agoclipboard: get view setting correct before setClipboard.
Michael Meeks [Sat, 20 Jul 2019 09:55:35 +0000 (20 10:55 +0100)]
clipboard: get view setting correct before setClipboard.

Change-Id: If8e9b057b819074f035c598569e3bf6d3d2fff00

2 years agolok: clipboard: per view clipboard creation.
Michael Meeks [Sat, 20 Jul 2019 09:52:51 +0000 (20 10:52 +0100)]
lok: clipboard: per view clipboard creation.

A bit brutal, but the mess around clipboard instantiation is awful.

Change-Id: I62d6af8bf6813e6bab81123417ea8bfb28394e29

2 years agolok: clipboard: per view clipboard creation.
Michael Meeks [Sat, 20 Jul 2019 09:43:39 +0000 (20 10:43 +0100)]
lok: clipboard: per view clipboard creation.

A bit brutal, but the mess around clipboard instantiation is awful.

Change-Id: I62d6af8bf6813e6bab81123417ea8bfb28394e29

2 years agoLOK: Support detecting complex selections
Ashod Nakashian [Fri, 19 Jul 2019 22:51:16 +0000 (19 23:51 +0100)]
LOK: Support detecting complex selections

Includes unit-test, but is otherwise not complete
implementation.

Change-Id: I5fdcd543358caab1858f6351238c21312665839c

2 years agolok: use utf-8 for text/plain always.
Michael Meeks [Sat, 22 Jun 2019 11:48:49 +0000 (22 12:48 +0100)]
lok: use utf-8 for text/plain always.

Change-Id: Ie91f89b3dc6ba3eddcf8383948dddc7878eae4d8

2 years agoAdd more powerful selection fetch & clipboard set methods.
Michael Meeks [Fri, 19 Jul 2019 22:44:20 +0000 (19 23:44 +0100)]
Add more powerful selection fetch & clipboard set methods.

Change-Id: I6633356d13480377a83a006588ec69ebcb56a93f

2 years agoremove unnecessary code in doc_registerCallback
Noel Grandin [Thu, 1 Aug 2019 11:59:52 +0000 (1 13:59 +0200)]
remove unnecessary code in doc_registerCallback

after
    commit 98c0cefb18d8af7aa4732708ba0ae6be2e808d6f
    Date:   Wed Jul 31 12:40:29 2019 +0200
    desktop: fix UB in DesktopLOKTest::testCommentsCallbacksWriter()

Change-Id: I254d8413e707d4525efbfb2050e5b29f70c4bed7
Reviewed-on: https://gerrit.libreoffice.org/76796
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoImproved loplugin:stringconstant (now that GCC 7 supports it): desktop
Stephan Bergmann [Tue, 30 Jul 2019 15:56:23 +0000 (30 17:56 +0200)]
Improved loplugin:stringconstant (now that GCC 7 supports it): desktop

Change-Id: Ieefdb08d6b92a0d70ecd9188f318e1738d61d803
Reviewed-on: https://gerrit.libreoffice.org/76685
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2 years agoNotify the client when we close the sidebar
Ashod Nakashian [Sun, 5 May 2019 15:51:30 +0000 (5 11:51 -0400)]
Notify the client when we close the sidebar

Reviewed-on: https://gerrit.libreoffice.org/71844
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 60c048e665c7e8dc32c378f0364931b6e26a9ca2)

Change-Id: I4879d65285e01cf2fd99233d226f4201997b4dd7
Reviewed-on: https://gerrit.libreoffice.org/76784
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: support sidebars in writer and calc
Ashod Nakashian [Mon, 6 May 2019 03:33:34 +0000 (5 23:33 -0400)]
LOK: support sidebars in writer and calc

[ Miklos: added code to release LOK notifiers in
SfxWorkWindow::DeleteControllers_Impl() during shutdown. ]

Reviewed-on: https://gerrit.libreoffice.org/71843
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 5ddf630222241bec4deda56d10992c35ae4efe06)

Change-Id: I3a3bd1fb6922e435599f604328f558be60594729
Reviewed-on: https://gerrit.libreoffice.org/76556
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx2: Enable sidebar on calc and writer, but not in impress
Ashod Nakashian [Fri, 3 May 2019 03:16:30 +0000 (2 23:16 -0400)]
sfx2: Enable sidebar on calc and writer, but not in impress

Added by Noel to this commit:
And add a special deregister mode to doc_registerCallback
so we can unregister stack-based callback objects in the
presence of multiple views.

Reviewed-on: https://gerrit.libreoffice.org/71715
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit fba6d4267b3f827269d6550dcb003cc56b31e493)

Change-Id: I8d846bc1f794cf16fd45486fd83ef87f43fd52c7
Reviewed-on: https://gerrit.libreoffice.org/76555
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx2: LOK: better fit of sidebar decks
Ashod Nakashian [Sun, 3 Feb 2019 15:53:21 +0000 (3 10:53 -0500)]
sfx2: LOK: better fit of sidebar decks

As the patch comment explains, the properties
deck needs to be rendered with height long
enough to avoid scrolling, but others would
be greedy in using up all the available height,
so we render them in more restricted space.

Change-Id: I361e653239e22a7be0e5d75505cdcde18f2367d3
Reviewed-on: https://gerrit.libreoffice.org/73524
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx2: LOK: resize the sidebar after layouting to avoid scrollbars
Ashod Nakashian [Fri, 1 Feb 2019 15:56:46 +0000 (1 10:56 -0500)]
sfx2: LOK: resize the sidebar after layouting to avoid scrollbars

By resizing the deck we ensure that if the contents do not fit
in the existing height, they will after we expand to the minimum
height. Also, the minimum height is now the correct one.

This prevents seeing vertical scrollbar in LOK, which is very
slow and unfriendly, instead renders the full sidebar and lets
the client scroll, if necessary.

Change-Id: Idc2a622a65074b7afb26263624f2df0b5968f40d
Reviewed-on: https://gerrit.libreoffice.org/73523
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx2: avoid unnecessary dynamic_cast
Ashod Nakashian [Fri, 1 Feb 2019 15:55:05 +0000 (1 10:55 -0500)]
sfx2: avoid unnecessary dynamic_cast

And reformat.

Change-Id: If8a3dd4d16dfd51f8006d2d5d47951db30390fd8
Reviewed-on: https://gerrit.libreoffice.org/73522
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx: LOK: fix the minimum height of sidebars
Ashod Nakashian [Sun, 16 Dec 2018 17:25:18 +0000 (16 12:25 -0500)]
sfx: LOK: fix the minimum height of sidebars

Change-Id: I29d4eb38c72db50061266f0cf0ace31bab690315
Reviewed-on: https://gerrit.libreoffice.org/73521
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx: LOK: notify clients of the sidebar state
Ashod Nakashian [Wed, 12 Dec 2018 08:01:31 +0000 (12 03:01 -0500)]
sfx: LOK: notify clients of the sidebar state

Change-Id: I35b174c3a5e302ce52ee4063fa71d47feffab624
Reviewed-on: https://gerrit.libreoffice.org/73520
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx: LOK: don't shrink sidebar height below minimum
Ashod Nakashian [Mon, 10 Dec 2018 05:29:31 +0000 (10 00:29 -0500)]
sfx: LOK: don't shrink sidebar height below minimum

This avoids scrolling within the sidebar and makes
it possible to scroll the rendred sidebar image
in the client, which is more responsive and lighter.

Change-Id: I0713c699ba82bfc5fe503c9351402c67aef4494e
Reviewed-on: https://gerrit.libreoffice.org/73519
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx: LOK: toggle sidebar decks
Ashod Nakashian [Sun, 9 Dec 2018 22:27:48 +0000 (9 17:27 -0500)]
sfx: LOK: toggle sidebar decks

Change-Id: I0559a2a4ae041bc61cf3a2d5979656a7941f4b02
Reviewed-on: https://gerrit.libreoffice.org/73518
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx: LOK: no sidebar tabbar
Ashod Nakashian [Sat, 8 Dec 2018 16:50:28 +0000 (8 11:50 -0500)]
sfx: LOK: no sidebar tabbar

Change-Id: I210df42fec4404ed9629c9b1c24c78b680212214
Reviewed-on: https://gerrit.libreoffice.org/73517
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: sidebar: publish notifications to the correct view
Ashod Nakashian [Tue, 27 Nov 2018 14:26:27 +0000 (27 09:26 -0500)]
LOK: sidebar: publish notifications to the correct view

The ViewShell, which represents the view in question and therefore
which view gets the window notifications, is incorrect when
the sidebar is first created upon creating/attaching a new view.

This leads us to a workaround to make sure that we publish
notifications to the correct view.

We also have to hide the sidebar instead of closing because
the workaround wouldn't work when re-creating the sidebar
on an existing view. See comments in code.

Change-Id: I9d3be901688291b04d634b68e1e20c7add77381f
Reviewed-on: https://gerrit.libreoffice.org/73516
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: sidebar: hide gallery, navigation and styles decks
Ashod Nakashian [Thu, 22 Nov 2018 21:47:49 +0000 (22 16:47 -0500)]
LOK: sidebar: hide gallery, navigation and styles decks

These aren't fully functional, so not very useful in LOK.

Change-Id: If6330b1f7bf911bbb9edad00aaea7c4d37671746
Reviewed-on: https://gerrit.libreoffice.org/73514
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: sidebar: start collapsed
Ashod Nakashian [Tue, 20 Nov 2018 17:04:58 +0000 (20 12:04 -0500)]
LOK: sidebar: start collapsed

Change-Id: I589fce5ee207da0e0ac113b7ccc1ed1edd06c5da
Reviewed-on: https://gerrit.libreoffice.org/73513
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: sidebar: release LOKNotifier on destruction
Ashod Nakashian [Sun, 11 Nov 2018 21:51:05 +0000 (11 16:51 -0500)]
LOK: sidebar: release LOKNotifier on destruction

And enable sidebar routing only while we have a
valid SidebarController instance (i.e. not disposed).

Change-Id: I665f934f762c0ce9efdce5489ec9babe006376a8
Reviewed-on: https://gerrit.libreoffice.org/73512
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: sidebar: enable only for Impress in LOK
Ashod Nakashian [Thu, 25 Oct 2018 05:35:37 +0000 (25 01:35 -0400)]
LOK: sidebar: enable only for Impress in LOK

Change-Id: Idb361164db9ea8681b45fe99608d2cb5690db161
Reviewed-on: https://gerrit.libreoffice.org/73511
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: sidebar: send close notification on disposing sidebar
Ashod Nakashian [Sat, 27 Oct 2018 14:36:51 +0000 (27 10:36 -0400)]
LOK: sidebar: send close notification on disposing sidebar

Change-Id: Ia8f197d07ba4b6a089571e9ca23b4697d04e7734
Reviewed-on: https://gerrit.libreoffice.org/73510
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx2: LOK: route the parent sidebar window instead of the deck
Ashod Nakashian [Wed, 10 Oct 2018 10:44:27 +0000 (10 06:44 -0400)]
sfx2: LOK: route the parent sidebar window instead of the deck

Change-Id: I0269a67c637afbc63a81405918f620009e681ff6
Reviewed-on: https://gerrit.libreoffice.org/73508
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: sfx2: disble sidebar menu-button when deck is hidden
Ashod Nakashian [Sun, 7 Oct 2018 15:32:55 +0000 (7 11:32 -0400)]
LOK: sfx2: disble sidebar menu-button when deck is hidden

There is no render area on the sidebar virtual-device
to render the popup menu when the sidebar is collapsed
into the TabBar, so we disable it altogether as we
can't properly display it in LoKit.

Change-Id: I2edee9e734485bb685f0ddc0c30bfe584e42a550
Reviewed-on: https://gerrit.libreoffice.org/73507
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx2: customize the sidebar popup menu for Lokit
Ashod Nakashian [Sun, 7 Oct 2018 15:03:02 +0000 (7 11:03 -0400)]
sfx2: customize the sidebar popup menu for Lokit

Don't show customization or docking options.

Change-Id: I313868cb2b2d0444ee90cf9709a326a81d0e5ed8
Reviewed-on: https://gerrit.libreoffice.org/73506
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx2: collapse the sidebar instead of closing on toggle
Ashod Nakashian [Sun, 7 Oct 2018 12:33:41 +0000 (7 08:33 -0400)]
sfx2: collapse the sidebar instead of closing on toggle

When toggling a sidebar deck that is open, the default
behavior when floating is to close the sidebar altogether.
This is both inconsistent with the behaviour when docked
and unexpected.

Now we simply collapse the sidebar into the TabBar (toolbar)
as is done when docked. This is also the behavior desired
from LoKit since the sidebar is rendered floating (to allow
arbitrary resizing).

The collapsed sidebar into toolbar is shown in same-position.

Change-Id: I0519c5ad012cc9df31758927a4dbcd774d47fcd3
Reviewed-on: https://gerrit.libreoffice.org/73505
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx2: LOK: support resizing the sidebar
Ashod Nakashian [Wed, 3 Oct 2018 10:31:33 +0000 (3 06:31 -0400)]
sfx2: LOK: support resizing the sidebar

Change-Id: I852c522f176a8d11d3a19709ab1cd75023645c66
Reviewed-on: https://gerrit.libreoffice.org/73504
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosidebar: support closing the sidebar through the X button
Ashod Nakashian [Sun, 2 Sep 2018 15:38:31 +0000 (2 11:38 -0400)]
sidebar: support closing the sidebar through the X button

Change-Id: I078c27d22bbee3d02ad4a3fb97ba01a394f171e1
Reviewed-on: https://gerrit.libreoffice.org/73503
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosidebar: Add .uno:MasterSlidesPanel
Ashod Nakashian [Mon, 27 Aug 2018 02:11:43 +0000 (26 22:11 -0400)]
sidebar: Add .uno:MasterSlidesPanel

Change-Id: I578dc8b1f9c8df7f7cc9108c70d6fad8006871c6
Reviewed-on: https://gerrit.libreoffice.org/73502
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosd: sidebars are now visible in LOOL
Ashod Nakashian [Fri, 14 Sep 2018 12:43:22 +0000 (14 08:43 -0400)]
sd: sidebars are now visible in LOOL

Change-Id: I7ceae056e3d6ce1c991fe1194faa8bebfd6aae1e
Reviewed-on: https://gerrit.libreoffice.org/73500
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosfx2: warn when invoking LOK callback before setup
Ashod Nakashian [Sun, 21 Oct 2018 16:56:52 +0000 (21 12:56 -0400)]
sfx2: warn when invoking LOK callback before setup

Change-Id: I2c845c357f73dbce71b1e420979aecf2cff38827
Reviewed-on: https://gerrit.libreoffice.org/68255
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/73482
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2 years agosfx2: Re-enable the sidebars for LOK
Ashod Nakashian [Fri, 10 Aug 2018 03:14:34 +0000 (9 23:14 -0400)]
sfx2: Re-enable the sidebars for LOK

This re-enables the sidebars for LOK, which were
disabled to avoid overheads.

Also, fixes a regression where editing stopped
when loading a new view because the sidebar window
creation killed the edit view.

Revert "Avoid various desktop GUI elements when used from LibreOfficeKit"
This reverts commit c0b70ec34d5e056bb92a66cbf83838923cb41fee.

Also (added by Noel to the above commit)

(1) Comment out parts DesktopLOKTest::testPaintPartTile test that
trigger a crash. We are installing a callback that points to something
on the stack, and then not removing that callback, resulting in calls
to random stack memory. There is a further problem in the LOK code in
that we cannot uninstall a callback when we have multiple views
because the uninstall code in doc_registerCallback can only remove a
callback for the __current__ view, which I do not fix here.

(2) prevent code from accidentally creating empty entries in the
mpCallbackFlushHandlers map, which is what happens when you use
the index operator on map, which results in a crash in
doc_registerCallback because the std::shared_ptr is empty.

(3) In SdTiledRenderingTest, only turn off LOK via
LibreOfficeKit::setActive(false) once the document has been torn down.
Otherwise, we don't remove entries from the statically allocated
s_pLOKWindowsMap map in vcl/source/window/window.cxx, which
means that at process exit, we have dangling Window objects.

Reviewed-on: https://gerrit.libreoffice.org/71165
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 88565c3662c6fde240c98a9b4f2ce6dfbcf4094e)

Change-Id: I06b06a990f05c06b1889fa89b698dff6f494e09c
Reviewed-on: https://gerrit.libreoffice.org/76466
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: support resizing windows
Ashod Nakashian [Sun, 21 Oct 2018 23:29:38 +0000 (21 19:29 -0400)]
LOK: support resizing windows

And delegate resizing of floating windows.

Currently used for resizing sidebars in LOK.

Change-Id: Iadc1b71c15a7d16a8c9dd7246490ae6bd645644c
Reviewed-on: https://gerrit.libreoffice.org/73509
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: Do not offset window coordinates in LOK
Ashod Nakashian [Fri, 10 May 2019 02:49:37 +0000 (9 22:49 -0400)]
LOK: Do not offset window coordinates in LOK

This fixes the issue with selecting the incorrect
color when clicking on the color presets in the
color picker window in LOK. Because the window
coordinates are shifted in Core, and LOK client
sends in absolute coordinates, the shift causes
a different color to be selected.

(cherry picked from commit 171a2300d37d73065e5e3bd4b77678e35f678adf)

Change-Id: Ib818b83c0f0c727944068cb244f8d10666e5bc1d
Reviewed-on: https://gerrit.libreoffice.org/76323
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: Reduce and improve logging of event compression
Ashod Nakashian [Thu, 9 May 2019 01:33:55 +0000 (8 21:33 -0400)]
LOK: Reduce and improve logging of event compression

Change-Id: I84e0e8806eb6f4fbda063ebc29fafa791d472bb8
(cherry picked from commit d5b900630caefc4d3b62a31906117cf4acd623b1)
Reviewed-on: https://gerrit.libreoffice.org/76322
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: Minor window event processing cleanup
Ashod Nakashian [Thu, 9 May 2019 01:17:00 +0000 (8 21:17 -0400)]
LOK: Minor window event processing cleanup

This reduces the number of json reads we do
when compressing window events, which happens quite
often.

(cherry picked from commit 0bb310d7ce39421ecc4ff90518ffdf6aa01d1b02)

Change-Id: I1c85f28867b52cad85445fff8a031b990dad8b56
Reviewed-on: https://gerrit.libreoffice.org/76321
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: Refactor large event queueing cases
Ashod Nakashian [Wed, 8 May 2019 15:45:49 +0000 (8 11:45 -0400)]
LOK: Refactor large event queueing cases

This makes it more readable and reduces indentations.

No functional change intended.

(cherry picked from commit 570a3c5361d58635e4d0ac8baf6df787bd2290ad)

Change-Id: I129ecff9083c459d633c0965eab6e06ba3dcf499
Reviewed-on: https://gerrit.libreoffice.org/76320
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: Remove window invalidations prior to size_changed
Ashod Nakashian [Wed, 8 May 2019 15:20:09 +0000 (8 11:20 -0400)]
LOK: Remove window invalidations prior to size_changed

A window size change is a full invalidation anyway,
so remove any prior invalidations as they are redundant.

Change-Id: I439a1bc38989df17b671e064beb26eb88c402be3
(cherry picked from commit 1a5af070d876b1ec4b69fe3be732426dba59b9af)
Reviewed-on: https://gerrit.libreoffice.org/76319
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: Window creation supersedes any events on same window
Ashod Nakashian [Mon, 6 May 2019 00:26:42 +0000 (5 20:26 -0400)]
LOK: Window creation supersedes any events on same window

This happens when we get multiple created events on
same window, interspersed with invalidations.

Change-Id: I2dbaa0f84306d770f1de047a23996209c28304fe
Reviewed-on: https://gerrit.libreoffice.org/76312
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: Reduce logging while processing events
Ashod Nakashian [Sun, 5 May 2019 16:57:43 +0000 (5 12:57 -0400)]
LOK: Reduce logging while processing events

Change-Id: I8ca457387715fcd085bcbf3107839d2629580f7b
Reviewed-on: https://gerrit.libreoffice.org/76296
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: remove duplicate cursor invalidations for same view only
Ashod Nakashian [Sun, 5 May 2019 16:36:09 +0000 (5 12:36 -0400)]
LOK: remove duplicate cursor invalidations for same view only

This limits duplicate cursor invalidation removal to same
view only, which seems to have been left in error.

We should now remove any old cursor invalidations (for
the same view) and only keep the latest (current) one.

Change-Id: Ie2323d0c5fcf3977576a1bdc098c95351a5753e0
Reviewed-on: https://gerrit.libreoffice.org/71846
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 8e9c36dfc346387abfbbaefbc15a518cbe3e257c)
Reviewed-on: https://gerrit.libreoffice.org/76286
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoLOK: trace queue only when it is changed
Ashod Nakashian [Sun, 5 May 2019 16:35:42 +0000 (5 12:35 -0400)]
LOK: trace queue only when it is changed

Change-Id: I9b8e060c2c7655565b95004d82bf50ada2ed0d08
Reviewed-on: https://gerrit.libreoffice.org/71845
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/76267
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agosd lok: Remove the .uno:LeftPaneImpress call from sd lok initialization.
Noel Grandin [Wed, 24 Jul 2019 08:32:25 +0000 (24 10:32 +0200)]
sd lok: Remove the .uno:LeftPaneImpress call from sd lok initialization.

this is combination of

commit dd15e149326f5270ab9ceb5f21e32b25b96c0a44
Author: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Date:   Sun Nov 11 23:37:24 2018 -0500
LOK: sd: initialize slide-sorter in sd
(Change-Id: I4cb6ce6d961b4ba4d542c14cb37370788cf75e45)

and

commit 7e291eedbad335bf8bbc8a17cc3d633bf66d0e90
Author: Jan Holesovsky <kendy@collabora.com>
Date:   Thu Apr 25 05:54:15 2019 +0200
(Change-Id: I86b23b484674ad4c6a75246ee6186ad9b828931f)

sd lok: Remove the .uno:LeftPaneImpress call from sd lok initialization.

According to my testing, this makes no difference and the moving of
slides and multiple selection behaves the same way with or without this.

So let's return to not activating the SlideSorterBar, because otherwise
we are doing a lot of pixel bashing behind the scenes unnecessarily.

Having said that, if we want to activate it at some stage, it is better
to do something like the following (+ remove the explicit LOK-only if's
from svtools/source/config/slidesorterbaropt.cxx):

  SvtSlideSorterBarOptions().SetVisibleImpressView(true);

instead (and potentially we can also make it floating not to occupy the
space in the main view by

  GetWindow()->SetFloatingMode(true);

in the LOK case in sd/source/ui/dlg/PaneChildWindows.cxxi).

Change-Id: I719bc4ca5e43fce9949d494149b65ffd8587c601
Reviewed-on: https://gerrit.libreoffice.org/76220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agoRedundant condition
Mike Kaganski [Wed, 24 Jul 2019 02:21:42 +0000 (24 04:21 +0200)]
Redundant condition

Change-Id: I1c67cde8401106a7e9d7ecd5fd3e0b4925ab47d4
Reviewed-on: https://gerrit.libreoffice.org/76212
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2 years agoDrop unneeded initialization
Mike Kaganski [Wed, 24 Jul 2019 02:10:04 +0000 (24 04:10 +0200)]
Drop unneeded initialization

Change-Id: Ieac1a0acb97664f3b86e2524cab79fd278f42e0e
Reviewed-on: https://gerrit.libreoffice.org/76210
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2 years agoDon't draw gridlines and document background in Online server process
Mike Kaganski [Fri, 12 Jul 2019 10:01:57 +0000 (12 20:01 +1000)]
Don't draw gridlines and document background in Online server process

... see https://gerrit.libreoffice.org/72417
They will be drawn client-side. Borders and explicit cell background are
still drawn in core. This mode is activated using "sc_no_grid_bg" option
in SAL_LOK_OPTIONS environment variable.

Change-Id: Ie10e7770b8168ec648d44ae5af0a0a0602d89ee6
Reviewed-on: https://gerrit.libreoffice.org/75484
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2 years agotdf#125655 disbale quick edit mode for iOS and Android
Tomaž Vajngerl [Tue, 2 Jul 2019 05:48:31 +0000 (2 14:48 +0900)]
tdf#125655 disbale quick edit mode for iOS and Android

When clicking (tapping) on text in text based objects (shape with
text or a text frame), it automatically enters editing mode,
which is not a desired behaviour in a touch based environment.
This behaviour comes from a quick edit mode, which is enabled by
default on the desktop. For Andorid and iOS this is now disabled
when LOK is initialized.
For online this change might also make sense (if the user would
use a mobile device), however this is not implemented now as this
would require more than just changing the global configuration,
as it needs to behave differently depending on the view/user.

Change-Id: Ib4a71cba0aeb4238a5d5b708801a07b39fb5f316
Reviewed-on: https://gerrit.libreoffice.org/74986
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2 years agoloplugin:logexceptionnicely in desktop
Noel Grandin [Fri, 14 Jun 2019 13:29:26 +0000 (14 15:29 +0200)]
loplugin:logexceptionnicely in desktop

Change-Id: I19f70b0e9d1ca2bbcd2595af24f2e15766d14b33
Reviewed-on: https://gerrit.libreoffice.org/74046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 years agolok: re-factor getTextSelection.
Michael Meeks [Thu, 6 Jun 2019 16:45:24 +0000 (6 17:45 +0100)]
lok: re-factor getTextSelection.

Change-Id: I2c27c213ee980e19d6020e9599b2b72115e7f28e
Reviewed-on: https://gerrit.libreoffice.org/73626
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2 years agoCppunitTest_sc_tiledrendering: close the document while LOK is still active
Miklos Vajna [Fri, 10 May 2019 12:09:56 +0000 (10 14:09 +0200)]
CppunitTest_sc_tiledrendering: close the document while LOK is still active

This is the same type of problem that was fixed for
CppunitTest_desktop_lib in commit
da17ccaec39f50de68c3fdd431bc66a2bec04127 (CppunitTest_desktop_lib: close
the document while LOK is still active, 2019-05-09).

Change-Id: I2515e18713c9f20a4f70de478ab062bab5650608
Reviewed-on: https://gerrit.libreoffice.org/72101
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2 years agoCppunitTest_sw_tiledrendering: close the document while LOK is still active
Miklos Vajna [Fri, 10 May 2019 14:41:11 +0000 (10 16:41 +0200)]
CppunitTest_sw_tiledrendering: close the document while LOK is still active

This is the same type of problem that was fixed for
CppunitTest_desktop_lib in commit
da17ccaec39f50de68c3fdd431bc66a2bec04127 (CppunitTest_desktop_lib: close
the document while LOK is still active, 2019-05-09).

Change-Id: I2fe050bf40d68dafa0334f4149e54958c492122d
Reviewed-on: https://gerrit.libreoffice.org/72126
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2 years agoLOK: Factor out iOS painting code
Tomaž Vajngerl [Mon, 3 Jun 2019 03:50:47 +0000 (3 12:50 +0900)]
LOK: Factor out iOS painting code

Change-Id: Ica706842003fe60ba864e013614eb535580446bb
Reviewed-on: https://gerrit.libreoffice.org/73363
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2 years agotdf#123697 we need to create a bitmap context with alpha
Tomaž Vajngerl [Mon, 3 Jun 2019 04:15:35 +0000 (3 13:15 +0900)]
tdf#123697 we need to create a bitmap context with alpha

Change-Id: Ib934314e56163983e70a0b04eb667e6b8527c783
Reviewed-on: https://gerrit.libreoffice.org/73362
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2 years agotdf#125397: Fixes for threads and SolarMutex on iOS
Tor Lillqvist [Mon, 20 May 2019 20:53:12 +0000 (20 23:53 +0300)]
tdf#125397: Fixes for threads and SolarMutex on iOS

We need to call SfxApplication::GetOrCreate() in lo_initialize() now.
Otherwise we will crash in sfx2. No idea why it worked earlier.

I think we want to avoid the "VCLXToolkit VCL main thread" ever
running in the iOS app. I don't think we had it running earlier, but
now for some reason it got started when creating a document from a
template, and that seemed to cause a hang.

Also, when creating a document from a template, lo_initialize() is
called from the app's real main thread (the one that the process
starts in). In that case we do want to release the SolarMutex after
InitVCL() if this was the first time we called InitVCL(). Awful crack.

Not really sure I fully understand all that is going on, but this
change does seem to fix recent problems... All this thread and
SolarMutex stuff is so incredibly fragile.

Change-Id: Ib04498ad199b64f27701f89d2df7003bca316406

2 years agolok: chart: constrained dragging of pie segments
Marco Cecchetti [Tue, 26 Mar 2019 12:17:08 +0000 (26 13:17 +0100)]
lok: chart: constrained dragging of pie segments

The extra information for the graphic selection is now formatted
according to JSON syntax so that is easier to parse.

Information for allowing the client to performa constrained dragging
of a pie segment is appended when needed to the graphic selection
message.

A polygon approximation of the pie segment in svg format is attached
too to the graphic selection message.

Core now is able to handle a specific msg from the client with data
about the new pie segment offset computed by the client on drag end.
This information is dispatched by the chart controller to a specific
method: executeDispatch_LOKPieSegmentDragging.

Change-Id: I42e7742508fa3a453383bf7b95e47df169f24834
Reviewed-on: https://gerrit.libreoffice.org/70568
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2 years agolok: dragging and resizing chart elements
Marco Cecchetti [Wed, 10 Apr 2019 13:49:12 +0000 (10 15:49 +0200)]
lok: dragging and resizing chart elements

This patch make possible to set the new position or size of a chart
object through setting directly the property value instead of sending
mouse events to the core.

Change-Id: Ifc06dac6bdad78081d63e0ea0db55563a1ae57bc
Reviewed-on: https://gerrit.libreoffice.org/70566
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2 years agolok: shape selection: perform the needed unit conversion in a clever way
Marco Cecchetti [Fri, 30 Nov 2018 16:20:37 +0000 (30 17:20 +0100)]
lok: shape selection: perform the needed unit conversion in a clever way

Change-Id: I505bd41801b5fd1898a9eddc81b102f2f7ae20b5
Reviewed-on: https://gerrit.libreoffice.org/70563
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2 years agoWe apparently need to drop the Solar Mutex when exiting lo_runLoop() on iOS
Tor Lillqvist [Tue, 14 May 2019 07:20:50 +0000 (14 10:20 +0300)]
We apparently need to drop the Solar Mutex when exiting lo_runLoop() on iOS

It seems to be held after soffice_main() returns for the first
document opened, but not subsequent ones, for some reason. So acquire
it an extra time to be able to use Application::ReleaseSolarMutex()...

Without this, when opening a subsequent document, the loleaflet
loading progress bar just hangs.

Change-Id: I4e4e7b814f0dba836b790b6f68470aab54f8bbb9