The new Collabora Office passes the installation path as UTF-8. On
Windows, turn that it into UTF-16 and use the wide character APIs, as
one should.
Add some comments to LibreOffiecKit mentioning this.
Also make lok_dlerror() use wide character APIs on Windows, and return
the message as UTF-8.
The wrappers used for this UTF-8/UTF-16 dance are copies of those in
<tools/UnixWrappers.h> (but with different names), because sadly
including that file in LibreOfficeKitInit.h caused other complicated
problems because LibreOfficeKit is apparently seen as part of the UNO
API when the ODK is constructed.
(It would be *wrong* and unhelpful to try to use system codepage for
pathnames instead of UTF-8. Codepages are obsolete. A proper Windows
program should use the wide character APIs. The Windows file system
has names in UTF-16. Using system codepage will not work for pathnames
that can't be expressed in the system codepage. Such user profile
directories might very well exist on some machines.)
The "normal" parts of core of course already use UTF-16 all over the
place on all platforms with OUString, so core on Windows hopefully
already accesses the file system only using wide character APIs.
Also remove extendUnoPath(). There is no URE/bin folder in a core
instdir any more. (Otherwise, the code in it would have had to be
changed to use wide character system APIs, too.)
Note that this commit by itself is not enough to fix problems when the
new Collabora Office is installed in a location with a non-ASCII
pathname. There are more problems in fontconfig, freetype, and cairo,
most likely. But for other LibreOfficeKit use cases on Windows, where
core is built in a normal manner without the "headless" backend, this
might be enough.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I2458ed98b89abcd18bf6ad658e285fcc55fd28b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196401
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197542
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Jenkins
Especially on Windows it is important to not call free() in your own
code on a pointer returned from some random other dynamic library
(like the one the desktop/source/lib/init.cxx code goes into). It
might have been allocated by calling malloc() (etc) in a C runtime
library that is different from the one used by your code. That will
lead to a crash.
One should alays call the free() in the same C runtime where the
malloc() that allocated the pointer is.
Add a wrapper called freeMemory() to the C++ API.
Change-Id: Ibf9cf6fad2c30c4416d2a1f6badbd161c7ba18a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194594
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197107
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Commit f4b9d6f024b27c4d8ddaabfe0eaa0b404137e3cf (Add horrible hack to
ask the filename when exporting PDF in CODA-W, 2025-12-02) added a
callback from core to the LOK client to trigger a file picker during PDF
export.
The problem is that in its current form, this callback is
Windows-specific so other platforms (Linux, macOS) can't provide their
implementation in a straightforward way.
Fix the problem by reworkig this, so it works similar to the anyInput
callback, which is cross-platform already.
The behavior for the case when the new callback is not registered is
meant to be unchanged.
Change-Id: I27934774889fc827772b2665799eca358dd62e55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195381
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
and don't destroy kit on closing all view of one document in
gtktiledviewer. Or maybe gtktiledviewer should keep track of
the count of current views itself.
Change-Id: I59d61d5c0a8dc2ddce42081e2fd6a52b85f9ae2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188350
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This changes the LOK API added in commit
e9e39e45f0daed52276377321088aa4d49b112b6 (cool#11064 vcl lok: expose
info about the scheduler, 2025-02-14) so that a LOK client doesn't have
to query the priority of the most urgent task: instead the anyInput
callback gets it as a parameter.
The scheduler is a hot path and it's not expected this priority
information would be needed in other places, so folding the new LOK API
into the anyInput callback simplifies things.
Change-Id: I1385055bfa27f47a243d40683b54cb2ddc9d33bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181878
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
While LibreOfficeKit can be built on macOS, the built library won't work
as intended since a headless vcl implementation is needed. Currently,
iOS is the only Apple OS that has a headless vcl implementation so
force a compiler error.
Change-Id: Ib9318851ff7e6c98531672ba7241c22a91f3ef7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180093
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Tested-by: Jenkins
Open the 300 pages bugdoc, paste a oneliner plain text content in a
paragraph which is part of a numbered list, observe a 274 ms hang till
layout is done for all pages, then we get an updated tile. This could be
better, there is no such hang in the desktop case.
What happens is that 1) vcl doesn't try to invoke the poll callback of
the LOK client when there was a processed timer and 2) Writer layout
doesn't try to split its work into pieces because the LOK client has no
way to inform vcl that it has pending input events.
Fix the first problem in this commit: add a new API that allows a LOK
client to inform vcl that it has pending input events and use that
SvpSalInstance::ImplYield(): if a LOK client has pending input events,
then invoke the poll callback after each processed timer. For example,
this allows the LOK client to process emitted callbacks between two idle
layout jobs, word counting, etc.
The second problem around Writer to use
comphelper::LibreOfficeKit::anyInput() is not yet fixed.
Change-Id: I2e39253bfc4d1b5546bc60eef9ff05ccdc0868b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171846
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
`SAL_DLLPUBLIC_EXPORT` is defined in `include/sal/types.h`,
so add a corresponding include in
`include/LibreOfficeKit/LibreOfficeKitGtk.h` before using it.
Without this, Qt Creator's Clang code model would'nt find it,
resulting in errors like
.../libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx:15: error: In included file: unknown type name 'SAL_DLLPUBLIC_EXPORT'
being shown when editing the file
`libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx`
in Qt Creator.
Change-Id: Iedd3490be9de72b931573b305d283d80b25a4645
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170749
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
inserting a ContentControl, now generate a unique ID for it...
search the lowest possible non used (non negative) number
added a GetType() function for SwXContentControl that get it from
SwContentControl, and used it for extract and transform.
Added some support for all other types.. some are not really usable
yet.
Fixed a problem when setting checkbox check, did not changed its
content.
If content is set to “”. It now set as placeholder,
and reset its content to the initial placeholder value, like:
“Choose an item” or “Click here to enter text”
(work for checkbox, and picture CntentControl.)
Change-Id: I0fc696f73734bdfb9ac5b8fdc6891168b8d4ed5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170600
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
It extract form controls, and write its data to JSON.
It is a basic 1. version, for now it only recognize:
-PlainText (and write its text)
-CheckBox (and write its state)
but it writes some common data for any type of controls:
ID, alias, Tag, TabIndex, and its index.
Change-Id: I9ff74cd013c6f1118942207059181678713504af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170381
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This exposes the (impress only) function to get the current
presentation info in JSON format and the slide rendering functions
that enable rendering of slide layers to a bitmap.
Change-Id: Id0591d5894f730eae48b3edc986ae5d804ce7c81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170263
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This allows to send status messages separately from statechanged;
this is needed in Impress to notify about any mode update, not only
masterview-related.
Also send SlideMasterPage updates automatically from core.
Change-Id: I0a50dbe61a5f2f28cd418eb4416819a6a76810b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169314
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
- We're adding a new LOK callback LOK_CALLBACK_VERTICAL_RULER_UPDATE.
- The reason is that we currently override the existing callback.
- Using the same callback for both vertical and horizontal rulers causes an issue.
- override will create problem like it will only send any one of the ruler orientation update.
- It results in online updates being limited to just one ruler orientation.
- By introducing a new callback, we ensure updates for both vertical and horizontal rulers both are captured correctly in online.
Change-Id: I02d0e3e7e4ac8a07a83644460aa0ba36e0f3c013
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167481
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 11b936629dd4ef9308d63b312900b8b7c8ff19b4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167464
Tested-by: Jenkins
Online side can set this property to allow comment editing. This is the infra.
Implementation will be in another commit.
Change-Id: I3a6f1ad6818c2c6587d98896c3d6d913d51a2295
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164988
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
instroduced new callback for LOK LOK_CALLBACK_SHAPE_INNER_TEXT
now if innert text is changed LOK is instantly updated about new textarea
Change-Id: I0a88e1dd77556e47f14359ce0a98701a327aceda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164497
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
We can have both readOnly and editor views at the same time while collaboratively editing a document.
Our current solution is to disable any command if the user's view is readonly.
We want to have a closer behaviour to desktop app with readonly views.
For this purpose, we are allowing more interactions from online server to core side.
We also need to filter out the events like the core side readonly view do (next commit).
This commit initiates the readonly view infrastructure.
The patches previous commit reverts were an example of how we disable things in readonly mode. We needed to open a window for getting hyperlink information.
With this patch, we try to separate the edit and readonly view modes on core side.
More notes:
We need "&& !comphelper::LibreOfficeKit::isActive()" or it falls into an endless loop with this patch.
When we disable editing on a browser, almost all user actions are disabled.
(cherry picked from commit 81dae2ca5187bd24aea0befb099a5b53535b5d03)
Change-Id: Ia25368dd8065206ec6b4b83eb2f685531110cc78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164527
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Revert "Implement hyperlinkInfoAtPosition for Impress."
This reverts commit 876543305c78cb596720da087454a5c54e5feb06.
Revert "Readonly Hyperlink Info - normalize the clicked coordinates."
This reverts commit 322669725b771f5fa2b3c10c5fb73238ca3713f6.
Revert "Implement hyperlinkInfoAtPosition function for Calc."
This reverts commit be01dd78c47b51b19603a6259504e29b11979b0b.
Revert "Implement hyperlinkInfoAtPosition for Writer."
This reverts commit 6773c8929690f557d29bc282dd8f5c4381da3484.
Revert "In readonly mode, we restrict many events like click."
This reverts commit a4f3b97e506f38e0c43d6fbf1192cc523750a9fd.
(cherry picked from commit c3f1d63178d6aaa0888085c7b641eb6d49a18276)
Conflicts:
sc/source/ui/unoobj/docuno.cxx
sd/source/ui/unoidl/unomodel.cxx
sw/source/uibase/uno/unotxdoc.cxx
Change-Id: Ie821a4bca6e6b4649cea17748c44af105cd45d30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164481
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Necessary to do this before forking on Unix systems; use a
dynamic_cast interface since this is all for internal use.
Change-Id: I8a911322acd4ec5654eb0d14804c09d513a0bd4b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163335
Tested-by: Jenkins
Call vcl::Window::RequestHelp from LOKPostAsyncEvent for
mouse movement. Introduce LOK_CALLBACK_TOOLTIP callback
type, and send it from SwEditWin::RequestHelp.
Intention is, that the tooltip is shown by client at the
current mouse pointer position, which is hopefully not
far away from the point that generated the mouse event.
On the next movement, the client starts a timer to hide
the tooltip. If the next tooltip message arrives, the
tooltip would be updated in the new place.
Alternatively, the payload could contain the coordinates
from the HelpEvent.
Change-Id: I8e96eb6e6983ad8d13b4c5d7be4d51ff3fd11893
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161302
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Refactored LOKDocumentFocusListener::notifyEvent.
Implemented 2 new callbacks:
- LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: it says the client if
editing in a shape or cell is active or it isn't.
- LOK_CALLBACK_A11Y_SELECTION_CHANGED: it says if a shape has been
selected/unselected, the name of the shape and text content are sent
too for being reported by a screen reader.
(cherry picked from commit 76899152ec3d1924cc72d2b869e197a1e34a0a1a)
Conflicts:
sfx2/source/view/viewsh.cxx
Change-Id: I644bcc7daeb8772805688a9bccdabd0631ce0a22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158562
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Implemented getListPrefixSize function which relies on
UNO_NAME_NUMBERING_LEVEL, UNO_NAME_NUMBERING character attributes.
The former provides the list item level, the latter is a boolean that
says if a prefix (bullet/number) is present or not for the list item.
It has been needed to modify
SwAccessibleParagraph::_getSupplementalAttributesImpl so that it
returns such properties for list item only and not for simple
paragraph too. In fact for a simple paragraph the default value for
the level property was returned which is 0 exactly the same value for
top list item.
Change-Id: Ia651af4d4b2372eed42c90b0752e16fd47a4fdec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156816
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com>
(cherry picked from commit 038903d2e066de9525a3baffdd232484ef44ff51)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157780
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
- FunctionBasedURPConnection is used to enable a client to open a URP
connection to a fresh Kit instance in COOL.
- This URP connector can be used with that and
https://github.com/CollaboraOnline/online/pull/6992 to use a Java Uno
Remote Protocol client over websockets
- For interoperability with existing Collabora Online websockets a
prefix (urp ) is added to each message sent and a similar prefix
(urp: ) is expected on each message recieved. This allows sending over
the same websocket as other data is being transmitted through. If you
are writing a bridge to work with this, you will need to add/strip the
prefixes accordingly
- This commit uses Java WebSocket
(https://github.com/TooTallNate/Java-WebSocket) to send data over
websockets.
Change-Id: I2bda3d0b988bef7883f9b6829eeb5b7ae8075f27
Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151171
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
When we get in one or more tables we notify row and column count.
When we get out one or more table we notify we are leaving a table.
When the fosused cell changes we notify the new row/col index.
The paragraph content is notified together with table info, so that
client has some opportunity for getting the screen reader to report
together content and table info.
Change-Id: Ic524259aa1879a70fc3de2467bdee27475352b7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155577
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>