Adds optional concrete interfaces that can be added to implementations
of XBrowseNode to create, delete, edit or rename nodes. The comphelper
abstraction now uses these if the interface is implemented otherwise it
will fall back to the old method using XPropertySet and XInvocation so
that existing script providers will continue to work.
The goal is to avoid using XInvocation for duck-typed methods because
that breaks pyuno. It is also easier to implement the optional
interfaces than to use the previous approach.
Change-Id: Id59136152941fd232673ec4b9082a0be0cb6ca8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207344
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
Implementations of XBrowseNode have a bunch of extra methods which are
accessed by using XPropertySet::getPropertyValue to determine if the
action is possible and then XInvocation::invoke to invoke it. This patch
adds wrappers around checking and invoking these methods. The idea is to
abstract away the actual implementation so that the approach can be
changed in a later patch.
Change-Id: I117ab848391dbb1277f9331d6a93f71c2cb556ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207343
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
comphelper::string::replaceAt contained pointer arithmetic errors. In
testing, this function only worked at all in the trivial append case.
Inserting a non-empty string anywhere else in the buffer would either
only insert part of the string, corrupt the string in the buffer, or
both.
In addition to replacing the implementation, this change adds unit tests
so we can be more confident that this function works in the future.
Change-Id: I97e109dc513b08528d6d20e7dbf6eedb3040670c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205222
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
...as emsdk 5.0.3 deprecated the predefined EMSCRIPTEN macro (see
<https://github.com/emscripten-core/emscripten/commit/506052bd8b4e23ded7f2351c62ca3b24d40c8cf3>
"Warn about usage of deprecated EMSCRIPTEN macro. NFC (#26381)"), causing
failures like
> In file included from static/source/unoembindhelpers/PrimaryBindings.cxx:29:
> In file included from include/sfx2/viewsh.hxx:35:
> In file included from include/editeng/outliner.hxx:32:
> In file included from include/tools/color.hxx:26:
> include/osl/endian.h:66:15: error: macro 'EMSCRIPTEN' has been marked as deprecated: use __EMSCRIPTEN__ instead [-Werror,-Wdeprecated-pragma]
> 66 | #elif defined EMSCRIPTEN
> | ^
> /home/sberg/emsdk/5.0.4/emsdk/emscripten/main/cache/sysroot/include/emscripten/emscripten.h:35:66: note: macro marked 'deprecated' here
> 35 | #pragma clang deprecated(EMSCRIPTEN, "use __EMSCRIPTEN__ instead")
> | ^
To avoid confusion, also suppress the -D$(OS) in
solenv/gbuild/platform/unxgcc.mk that would unnecessarily keep defining
EMSCRIPTEN.
Change-Id: Ic1f187cf1c6417cd95d4092e9cea01a665bd1b2f
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/34
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 50291c2ed83bdb49bb827a4a12905d94b8c42035)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205167
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Open a large document, the first page (inside the visible area) shows up
fast, then the idle layout starts calculating later pages. Now scroll
down to page 2, and tiles for that second page only arrive after the
full layout finished.
What happens is that idle layout unfortunately creates high priority
tasks as a side effect of completing its work, so the COOL any input
callback will not interrupt (assuming core has high priority tasks),
even when it should, so idle layout runs to completion and only then we
start rendering tiles.
An option would be to fix the priority of these tasks, but there are a
lot of them: 'vcl SystemDependentDataBuffer', 'svx::SdrPaintView
aComeBackIdle', 'svx::svdraw::SdrPageWindow mpObjectContact',
'sw::SwView m_aTimer', then I stopped looking further. At this point it
looks better to have a higher level mechanism. So introduce a flag in
comphelper/, and using that ignore reporting high priority tasks from
core to COOL till idle layout is in progress.
Note that recursive layouts are not supported, so no need to query the
current value before the first
comphelper::LibreOfficeKit::setIdleLayouting() call. With this, my 839
pages long document shows content on e.g. pages 2 & 3 just fine, even if
the full layout is not yet complete.
Change-Id: I3b7d422dd4a6c95e6fcedbdecb8a98bca6130002
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201102
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
In OAccessible, which is used as the base class for most a11y
implementations, introduce a new virtual
OAccessible::implGetExtendedAttributes that returns a
std::unordered_map for the key/value pairs for extended attributes
and use that in OAccessible::getExtendedAttributes to build the
string mandated by the XAccessibleAttributes UNO interface.
(The order of attributes in the resulting string shouldn't
matter.)
The default implementation still results in an empty map/string
being returned. But this will allow switching subclasses to
override the new helper method in upcoming commits instead of
having to implement the string concatenation logic in each of them.
Also let OAccessible::getExtendedAttributes use
OExternalLockGuard like other UNO API methods in the class do,
which locks the SolarMutex and checks that the object hasn't been
disposed yet. (Both are reasonable when a11y UNO API methods
are called.)
If the latter results in any issues when switching subclasses
to the new logic, those are probably preexisting issues that
are surfacing then.
Change-Id: Ie66f135fbf6cdc98c7cdca27fa3f5fe7db7f9a74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201035
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Let the OAccessible base class used by most a11y implementations
implement the XAccessibleExtendedAttributes interface and
add a default implementation for
XAccessibleExtendedAttributes::getExtendedAttributes
that simply returns an empty string.
Platform/Toolkit a11y bridges were prepared for this in
previous commit
Change-Id: I84252f8764d3385d71b9ada24125ca96762baf9d
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Mar 4 19:30:05 2026 +0100
a11y: Handle empty extended attributes string
This simplifies those subclasses that were already
implementing the XAccessibleExtendedAttributes interface
so far and will allow further refactoring.
Change-Id: I05f02b57f4c32be42232a52b24fe13c945090836
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200971
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
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
similar to what we do for viewID.
On attemting to load multiple documents StatusIndicator::start calls
Application::Reschedule during load of document #1.
That inner loop ends up loading document #2. The inner loop ends, and
load of document #1 completes in the outer loop.
Unfortunately the inner loop left the current DocumentId as that of the
inner document #2, so the document id set on the view of #1 is
incorrect.
Extend the similar fix for viewId switching during Reschedule to restore
the docId. If this Reschedule happens at any other time except load then
restoring the viewId is sufficient to identify the correct document, but
in the load case there is no viewId yet
Move the mnCurrentDocId out of sfx2 and ViewShell into comphelper so
it's available from vcl without needing to make any adjustments to
LibreOfficeKit.h[xx]
Change-Id: Ied70e0f9ff33f2587cfbcb02b0c9ca3cd4792cfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193814
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
No need to mention function name and line. In debug builds,
exceptions get this information automatically.
Change-Id: Ia09d72ff892c98cff9b33131dd44d1b821b54ff3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193719
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
After recent commit 851fb75779
recheck these directories in include/ again
to test drive the new --headersfwd mode of bin/find-unneeded-includes
Change-Id: I0ede437c4f9958cd98210ed1760a5b98ea8bd1ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192377
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
MS PowerPoint reports a corrupt presentation
if one of the ppt/media files contains non-ascii characters.
make CppunitTest_sd_export_tests-ooxml3 \
CPPUNIT_TEST_NAME=testTdf148478_transitionMusic
Change-Id: Ide5c5d38b4517e7a933fb8d414d901b49b15faca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193435
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Instead of calling GetLocalizedChar for every character in the string to
be localized, we now just call a replacement function that returns the
offset to apply for digits. That means that in the likely case that the
offset is zero we can skip scanning the string altogether and just
return the original one.
Change-Id: I8b1ffa3ba38d5a8ed491668c7c1a242327bce626
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193462
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
There already was UnoCommand support inside SlideCommands. This change
introduces it at top level.
The syntax of the command is:
{"UnoCommand": {
"name": ".uno:Foo",
"arguments": {
"Arg1": {
"type": "long",
"value": 0
},
"Arg2": {
"type": "long",
"value": 1
}
}
}}
Change-Id: I0015e937495ad1ae756c5366b555a3b0d5fb09ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191963
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Whatever that was intended to mean: if that meant that the constants
were encoded that way, these are UTF-16 already; is that meant that
they only contained characters in that range, that is unimportant.
Change-Id: I5463f1fca0d552a93d3c9d487ed9912c9e1a989e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191240
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
dont need the variant that passes extra params, we already take that param
but convert that extra parameter from a pointer to a std::optional,
because some of the call sites pass a temporary OUString, and taking
the address of a temporary is a no-no.
Change-Id: I4d55f01a14230f5c64a052a143666a08bfcbf704
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191021
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit adds a drop-down dialog that appears when the user pastes
plain text containing Markdown-formatted content, prompting the user
to choose between text and markdown.
Change-Id: I3b14b5a07f107de69825583f54023d2d98984288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188067
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
Tested-by: Jenkins
and
cid#1660297 Variable copied when it could be moved
cid#1660225 Variable copied when it could be moved
cid#1660221 Variable copied when it could be moved
Change-Id: I3b0d8a60b216339b0220ff80255e5d24882d8f1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188964
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
and
cid#1660283 Variable copied when it could be moved
cid#1660278 Variable copied when it could be moved
cid#1660277 Variable copied when it could be moved
cid#1660272 Variable copied when it could be moved
cid#1660271 Variable copied when it could be moved
cid#1660269 Variable copied when it could be moved
cid#1660257 Variable copied when it could be moved
cid#1660251 Variable copied when it could be moved
Change-Id: I6684eaf2162dd3550e2eab3f72cccbaa09448f43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188925
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
and
cid#1659624 Variable copied when it could be moved
cid#1659632 Variable copied when it could be moved
cid#1659637 Variable copied when it could be moved
cid#1659656 Variable copied when it could be moved
cid#1659662 Variable copied when it could be moved
Change-Id: I20179a4ff699af546694b8a4796ab2f0cfae1903
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188708
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins