In order to avoid duplicity. Use OUString::fromUtf8 as it's
already done in another part of the code
This also helps to backport
commit 41e35a2d40
Author: Dan Williams <dcbw@libreoffice.org>
Date: Thu Jul 30 12:36:44 2026 -0500
tdf#169919: add unit test for PDF link clickable rectangle transformation
to release branches
This reverts commit cb96c7a9a5.
Change-Id: Ib87768458ba30baa0b29d17cc05d0e032719cf70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209180
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
There's already one for OUString; copy that one and adjust for
OString and single-byte characters.
Change-Id: I2de901ead05284f9a73eadecf8628f30f8521b55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208865
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
The browse node factory had a wrapper using XAggregation that wraps
every XBrowseNode. As far as I can tell this was used to replace the
implementation of getChildNodes with one that checks for exceptions from
the underlying provider and then sorts all of the resulting nodes by
name. The trouble with this is that it prevents the script providers
from detecting when a node is one from the same script provider and thus
makes it difficult to implement the XCopyableBrowseNode interface. The
documentation for XAggregation mentions this problem and also states
that the interface is deprecated.
To avoid this overhead, this patch replaces the aggregation with a
helper function in comphelper that should be used to retrieve children
from a browse node. That takes care of catching exceptions and sorting
the results.
Change-Id: I319888fee1b84ddcef397317d2cf7e72bd2867cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208160
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
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