90 Commits
Author SHA1 Message Date
Michael Stahl e45efbf8fb readlicense_oo: fix the XSLT to not partially match
So NSS is not matched by CRYPTO_NSS or OPENSSL.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I79baac705b6acf63a94b2bb760fedeff1fe68f6e
(cherry picked from commit 596b5b18dfef111979e2e7b1d678d7b250e6100f)
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10410
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit a5454c0655da42742c7a4620b62c8f04b10a0742)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210339
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-09-01 19:49:41 +02:00
Michael Stahl 6e12298c59 license.xml: fix various bad and missing class values
Several of these worked by accident, because the XSLT matches
substrings.

Conflicts:
        engine/readlicense_oo/license/license.xml

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Icda2329e0bc2d74c05de7a709d9cefaa816fedee
(cherry picked from commit b721492e260027cadfae132f65132c6f273a7fc4)
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10409
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 269d790fbfcb0555bc8f886dda5945fb016d6837)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210338
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-01 19:49:37 +02:00
Michael Stahl 0f3a469b25 vcl: PDF export: consistency in stream bracketing
Bracket streams consistently in `PDFWriterImpl::emitScreenAnnotations()`
and `PDFWriterImpl::emitType3Font()`.

This affects both legacy PDF 1.x and PDF 2.0 encryption.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I06c58c246a68c9b02a32c8cbe84f58390fa26ab4
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8630
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 534a57295dad5ddf82a503c4d0e27ead9dfde77f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209327
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-19 17:35:03 +02:00
Michael Stahl 91970e690b vcl: PDF export: fix encrypted /Length in PDFObjectCopier
`PDFObjectCopier::copyExternalResource` is a bit more complicated but
try to get the correct length; naively always using
`calculateStreamSize` breaks `testMultiPagePDF` and `testReexportPDF`
so do it only when it changes (i.e. encryption is enabled).

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Idb0c892f2da03a6e7dd5a2ba8d242c10c2e0d90a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8629
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 05d5a6e4b5b921e1e21c3c52e85dabd7c76a2024)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209325
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-19 16:15:35 +02:00
Michael Stahl d46d47657e vcl: PDF export: fix a bunch of bad /Length with encryption
Check every object for which `checkAndEnableStreamEncryption` is called
to take into account the additional IV and padding that is written to
every encrypted stream.

This affects both legacy PDF 1.x and PDF 2.0 encryption.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I1444bfe418e42db222425590ed83d47a95e2183a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8628
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 67d6ea72a0ce455cdeb832d189425f6f46775698)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209324
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-19 16:15:28 +02:00
Michael Stahl 679f88a775 vcl: PDFEncryptorR6: check result in decryptPerms
On the one hand, this should check 3 bytes have expected value. On the
other hand, it's only called by tests.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ia0c9c48835a7b603a545e4f186eef77ade857f0e
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8627
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit eaef8be7dbc00573860a24850df30433a3f59187)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209323
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-19 16:15:22 +02:00
Michael Stahl a3623692c3 vcl: fix PDFEncryptorR6 padding
RFC 8018 / PKCS #5 as referenced in ISO-32000-2:2020 "7.6.3.1 General"
always adds padding.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I2bd783a19a9aaf8276dc4e81cfa26239e1c11a0d
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8626
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit d998d34f568fabd2de918b761f30a1277942aeb4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209278
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-19 11:31:20 +02:00
Michael Stahl d109b21011 sw: remove fieldmark code from SwTextPortion::Paint()
This asserts on forum-mso-en-4208.docx because it creates a
`SwContentControlPortion` which calls its superclass `Paint()`.

Not sure how this should work; presumably the
`SwTextFormatter::WhichTextPor` should prioritize fieldmark chars higher
than it does; also, it would be helpful for the user to see something on
fieldmark chars, but what exactly?

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ifd16f6b38db10f17a9efd20e57fc4c49e39cf144
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7739
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit f42e76165741add8fcd2b6677443b6d2a935fe00)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209275
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-19 08:42:18 +02:00
Michael Stahl 01de4c0213 vcl: PDFEncryptorR6: fix subtle off-by-one in computeHashR6
The end condition `E.back() > (nRound - 32)` is using the wrong value of
`nRound` and so the loop can end too early.

This has caused a few CI builds to fail after pushing the padding fix,
as the input to `computeHashR6` includes a random IV it happened rarely.

Fix it by counting the iterations of the loop that have been done.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I8bbdc85439789db3753942b1292ba48d39b76541
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8625
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 082e5a49669e2d9058c2b3675c829a495b2044f3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209277
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-19 00:20:39 +02:00
Michael Stahl aac2961770 oox,svl,vcl: use more appropriate random numbers
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I9d6f200cc5a146f46dca64af270b77d0ce6abf6b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8174
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 52ba487c3d84a89a027c3130bc86afdcfe57a860)
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8261
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 63ab1f905bddbac4871a246d61aa59d09f122e5c)
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8277
(cherry picked from commit 396747a0e319943e7d411b0d6bc8d8abcc3e4f19)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209276
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-19 00:20:32 +02:00
Michael Stahl a52e9508c6 gbuild: fix bug in gb_LinkTarget__use_python
The problem is that `$(...)` is evaluated by make while parsing, while
the assignments `python_arch_subdir=amd64/` etc are evaluated by `$(eval
...)` in a separate/later phase, so the first time
`gb_LinkTarget__use_python` is used it will be missing the subdirectory.

How this has ever worked is a mystery.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I6a026a37f54eccaf65a4df71b30acd3389373b6b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2551
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit daf016a65c5f9d0ff7f9aaa55020c377a484b350)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208014
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-13 13:59:55 +02:00
Michael Stahl b76587cda0 oox: remove AgileEncryptionPreset::AES_128_SHA1
Should never be produced in practice.
SHA1 may still be used when loading existing document.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Id14c10186a8fae270e75b6cc1cda191dabd9392c
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5166
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit de8c258fac0c878cbb52b9bf819e16ea16e0b484)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207315
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-25 23:57:14 +02:00
Michael Stahl 25d359ed07 oox: OOXML export: use AgileEngine instead of Standard2007Engine
AgileEngine is supported since MS Office 2010 so not much point in using
older and weaker cryptography today.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Id6ea9ae14bdc84b2877edf45a8e2717cbf3e9af1
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5165
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 21c1cc0eb20964a5a3b9626cbf85f8485aa02c91)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207314
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-25 23:57:10 +02:00
Michael Stahl 6e9c3fb2be opencl,sc: convert callers of rtl_digest_MD5 to comphelper::Hash
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ib507b0e73fce064a7dbd2426849d9bf32bb95295
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4672
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit abd6c2a86dfc250ba9110afa48f10cb2d149bafb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207204
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-24 00:07:03 +02:00
Michael Stahl 592e67c4f2 desktop: convert oosplash to C++ and use comphelper::Hash
Also fix all `loplugin` warnings in start.cxx.

Not sure to what extent the "SingleOfficeIPC" pipe name is still
considered a stable API, likely not any more, using something other than
MD5 could be an option too ...

Also convert the other "SingleOfficeIPC" thing here.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I4561a880e8321d191144954687870aaa122fff75
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4671
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit f50ea835b44dca17405df004fb5b04a8478833d6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207203
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-24 00:06:59 +02:00
Michael Stahl e4892750c3 sal: remove MD2, SHA, HMAC_MD5 digests
These are all obsolete and unused:
`rtl_Digest_AlgorithmMD2`
`rtl_Digest_AlgorithmSHA`
`rtl_Digest_AlgorithmHMAC_MD5`

Adapt `rtl_digest.cxx` to use some random other digest instead.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I886297bec6fafbc56afabd212517a8f4478f3253
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4669
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 2e0c87ff340d7ea99afd638ebb9bd7bb36e53afc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207148
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-23 13:16:38 +02:00
Michael Stahl 3bad9e2daa sal: remove rtl_createNamedUuid
This has never been called in the git history, other than by its test.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ic233632a3656fe125f71a944afdedb8687627e78
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4670
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit fbf2894e11b2411c3fd9c06fa0cc490c6570bdc7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207149
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-23 11:22:49 +02:00
Michael Stahl 048458993f sal,sc: replace SHA1 digest with comphelper::Hash
in `InsertThreadedCommentOperation`

Cherry-picked note: the renaming was skipped since
variable names in sal/util/sal.map had to be renamed
as well

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ic12e3fcc99c46288222901d8392cd0b9ad95c92e
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4668
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit d57188a30916fab5f661039ac1fc5e88d7f358e6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207147
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-23 11:10:39 +02:00
Michael Stahl 6589ba5e8a sw: improve test coverage of first-page header/footer
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I708f06ee82a1db3cb8a43b16c03506fa2305a803
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4399
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit d67de2f005ac782a0c2413bc151d1d76fc0415c2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206704
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-18 15:36:31 +02:00
Michael Stahl a50e3188a3 svx,sw,xmloff: split no-first-page-header-flag in 2
In Word only the first-page-shared flag is shared between header and
footer, while the existence of header and footer is independent.

Split into core flags `DisableFirstHeader` / `DisableFirstFooter`,
properties `HeaderNoFirst` / `FooterNoFirst` (which allows removing some
special checks as the name prefix checks now cover these).

`SectionPropertyMap::setHeaderFooterProperties()` had some special code
to turn off a header but not a footer, add that to do it consistently.

Also rename the ODF attributes, `is-first-page-header-enabled` better
describes the values than `is-first-page-header-shared`.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ieee9cb7a8f7b4fb7e66352c95142d8ccb06f9cb5
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4383
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit a443891f1a6480421fa08c311526c1a9d4bdd642)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206703
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-18 12:17:26 +02:00
Michael Stahl de4a472a86 sw,xmloff: DOCX: improve Word page margin compatibility
The problem with not having some but not all headers enabled on a page
style is that Word does page margins differently than Writer, and this
causes `testTdf116486` and `testFdo44176` to fail.

In Writer, it's always additive: page `fo:margin-top` + header
`fo:margin-bottom` gives the spacing from the top of the page to the
body text.

In Word, there is a `w:header` (from top of page to header) and `w:top`
(from top of page to body text) and the problem is, they're not
additive, both are measured from top of page.

If all headers are enabled,
`SectionPropertyMap::PrepareHeaderFooterProperties()` can map this to
`HeaderHeight` and `HeaderBodyDistance` properties, but of course those
won't be used if there's no header on the page.

So import `w:top` as a new property "MinTopBodyDistance" (and also
"MinBottomBodyDistance") implemented as new item
`RES_FRMATR_PAGE_MIN_TOP` (and also `RES_FRMATR_PAGE_MIN_BOTTOM`).

Use it in `SwLayoutFrame::Format()` to set the page frame margins, but
only if there is no header; else rely on the existing header properties.

Export this to ODF as
`coext:min-page-margin-top` and `coext:min-page-margin-bottom`.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I9d98bbf7138c9ef04d4ab1ddcb4c3183a12d9b11
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4310
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e065ba01c029cd01c9128afccdc953e2e3a49e65)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206702
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-18 12:17:15 +02:00
Michael Stahl 68c0f96030 sw: RTF import: fix signedness of cell counter variables
Change-Id: I20c94254eee8c612a6bcdd88c47e911aa66000f4
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1382
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 159c389eee4a1986403aa307b93c0c9f5f765534)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206296
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-10 17:05:02 +02:00
Michael Stahl b439dc9acf gbuild: rebuild UnpackedTarget when tarball changes
Add gb_UnpackedTarball_get_version_target to track what was the tarball
that was extracted, so incremental builds work.

This requires removing the dep from gb_UnpackedTarball_get_target to
gb_UnpackedTarball_get_preparation_target so that UNPACKED_TARBALL is
inherited to version target.

Change-Id: Id6e265d03c80d17cb81aa3fffdcec5f0bd8c2efe
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1257
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1379
(cherry picked from commit b15dd2d51de5d00c388d2c30f511ca638b9ffd8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206297
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-10 16:40:06 +02:00
Michael Stahl 8701886edf sw: RTF import: fix defaulting of style properties
`RTFDocumentImpl::getProperties` needs to check if the applied style is
actually a character style; in that case, the default paragraph style 0
is apparently used by Word.

And when merging character style properties into paragraph style
properties, it must not overwrite the `pPr` with a dummy one that
`RTFDocumentImpl::createStyleProperties` unhelpfully inserted into the
character style.

Change-Id: I2e5935879bc1f0c9a3c03366465080ad57056f28
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3453
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 325cd2b30649570404823013f8539ebae124380c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206201
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-08 11:41:18 +02:00
Michael Stahl e0befe8bfe python3: remove obsolete universal-sdk liposuction args/patch
`python-3.3.0-darwin.patch.1`: remove the adapting of `UNIVERSAL_ARCHS`

This was only enabled on `CPU=INTEL` (32-bit IA32) which is no longer
supported by/for MacOSX anyway.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I5a3f1de9b6ba21efa53319914d126395226ce075
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2475
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 7664bb2285fa968e2dd4e86f42057f671ec958f6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205152
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-13 11:12:58 +02:00
Michael Stahl d2e70beadd sw: RTF import: ignore spurious table properties like Word, part 2
The bugdoc has several consecutive table definitions before a table, and
the first one's borders are erroneously applied to the table cells,
instead of the last one's (no borders).

Create a new struct `TableRowDef` for the top-level table cells state,
and actually clear it on `\trowd`.

Also use it for both "backup" and "previous" table row.

Move the sending of `tblStart` from `\cellx` handling to `\par` and
`\cell` where it is determined if it is actually a table.

`m_nTopLevelCells` is redundant and can be removed.

Leave the table row properties as-is for now, could be added to
`TableRowDef` later...

Unfortunately UITest_sw_table sheetToTable.sheetToTable.test_tdf116685
fails with `~SwIndexReg` assert.

This is because previously, `tblStart` was sent from `\cellx`, and in
`DomainMapper::sprmWithProps()` the `rContext` did not exist yet, so
the whole `AddDummyParaForTableInSection` was skipped; now it is done
and the `pUndoPam` in `SwReader::Read()` points to the deleted node.

Change-Id: Iba60e871e6c3ac0bc2559c975358edc14a7e2d6b
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1254
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 4c7e5b5b5aeea37d06b17e7e82e6874cbed504b2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204407
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-05 09:29:45 +02:00
Michael Stahl 77b3b688e6 sw: RTF import: ignore spurious table properties like Word
The document contains a table definition before 3 paragraphs, but Word
doesn't turn it into a table.

It looks like there's 3 ways to actually put a paragraph in a table:
        \intbl \par
        \itap1 \par
        \cell

The following places were wrong to send a synthetic \intbl:
    \cellx
    \pard

Instead, send synthetic \intbl at:
    \itapN, N>0
    \cell - if there was no preceding \par, or if there was \intbl
            in preceding paragraph in buffer

Adapt \itap handling to not force the value from 0 to 1, instead
pre-pend itso that \intbl always takes priority in TableManager.

On \par, if it turns out it's not in a table, replay the table buffer to
clear it and let the \cell handling work.

Start table buffering on \trowd, \intbl and \itapN, N>0, to ensure the
buffer is there on the first text run.

Stop table buffering on \row.  This requires disabling the paragraph
marker properties on the *last* paragraph of the document; Word 2013
does some odd special handling there to set it to document defaults,
based on superficial testing. (Previously, the char properties were
buffered, and the buffer was discarded without replay.)

Change-Id: Id760cf031c901a54455c103cb7ffb110fdcf7969
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1058
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 054322ecaa2f9b0cc1ceb8af036ee7a8e236938f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204406
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-04 09:38:52 +02:00
Michael Stahl 90629a2de9 sw: fix cursor update problem
(regression from commit 93fe03c059)

SwTextNode::Update() was changed to check the
getIDocumentLayoutAccess().GetCurrentViewShell() instead of
pDocShell->GetWrtShell() but apparently that was based partially on
incorrect assumptions.

getIDocumentLayoutAccess().GetCurrentViewShell() is updated on
SwView::GotFocus(), but that happens only in Classic.

SwDocShell::SetView() actually updates the other one and is actually
called from ChildSession before any sort of editing operation.

Unfortunately i don't remember what exactly failed in
CppunitTest_desktop_lib and the change was with experimental yrs feature
enabled so just revert this for now.

Change-Id: I6fececd1f85bd8ba347865a198845250a9946e2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202057
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 0194ef39a5f07d6152117994704d1d4f82072165)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204405
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-27 18:36:19 +02:00
Michael Stahl bf7bd37d1c libtiff: add patch for CVE-2026-4775
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I3554b8f27176ebc837029cf07e0dca0a24595459
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1601
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 3ca37a2c4a3ecd7b4e2c4731af91776813f72093)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204408
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-27 12:40:43 +02:00
Michael Stahl fdd69f4dc8 sw: improve error reporting of networked AutoText
Every error about an AutoText path is reported as "Inadmissible path",
which might imply that the path doesn't exist.

In the situation where the AutoText is on a WebDAV share that is mounted
by Windows Explorer, the path will be a file:// URL, and it is possible
that the user needs to authenticate before being able to access the
files, but it's not known how an authentication dialog could be shown in
LO (the Windows File Picker dialog is able to do this btw), so detect
this situation and show a more specific error message. (As far as
possible; we cannot tell if the problem is that the user is not
authenticated or if it is that the user is not authorised to access).

Use `PathIsNetworkPathW` to check if it is a mounted network location.

In case the network location is not reachable, the error code will be
different and the generic error dialog will be shown.

sw: fix -Werror=undef
(cherry picked from commit cee293d3ee4fef108790eed63c69eee40d37c0bf)

Change-Id: I633ea331f957edb4a943426464524a5decf0fe15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200856
Tested-by: allotropia jenkins <jenkins@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
(cherry picked from commit 7a2efe02293382374cd80f9d23215740e731c755)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201398
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 19e9e767145a5147bfee59f0b476c6a7dbf3ba12)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201468
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2026-03-12 08:38:00 +01:00
Michael Stahl 84ce473ad9 curl: add patches for CVE-2026-1965 CVE-2026-3783 CVE-2026-3784
Change-Id: I8421831c20452ea84a67ff4c751f9eb9166b66d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201437
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 4aa94dbcac28a521f23c91c1ab658d5973c8af36)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201452
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2026-03-11 19:53:58 +01:00
Michael Stahl b483b1c6c0 nss: upgrade to release 3.121
Fixes CVE-2026-2781

Change-Id: I49936c56638dc6ce2bc5d7cf7d591586d4c5924a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200787
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit e340bae8d3fb6b8d5ba4880e4853b975d48e8a8e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200812
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2026-03-02 19:10:58 +01:00
Michael Stahl ce6536debf sw: layout: invalidate first row when table upper margin changes
The problem is that when the user inserts a paragraph break in the
yellow section on the first page, the table below this section
disappears.

Previously, one line of text of the table was on the first page, but it
must move to the next page now, and then what happens is that inside
SwTabFrame::Format() the CalcFlyOffsets() finds an overlap with the text
frame that was already on the 2nd page; at this time the table print
area height is 9711, and this causes the table frame to have the Y
position of the print area set to 10383.

Now the first row is positioned based on that, but then another
iteration of SwTabFrame::Format() sees its height as 7672 and thus the
table now fits before the text frame, the table frame upper margin is
reset to 0.

But the problem is, the first row's position is not invalidated, so all
the table content remains positioned outside the table frame.

Reportedly this started to happen since commit
8e3afdb598 and apparently the problem
doesn't happen when there isn't a fly anchored in the footer but there's
no obvious relation to the missing table invalidation.

Change-Id: I6552ef3340b47abcfa5eb3a70aa1dc27733da253
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200294
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 66723c13181e0e56a6a9e55862ece318c9d45f23)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200340
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2026-02-26 16:13:13 +01:00
Michael Stahl 432ef1e111 sw: add missing headers
Change-Id: I91875b8b2070a3da6c8d69f07f93724da1def0b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198840
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2026-02-06 16:22:49 +01:00
Michael Stahl 4ca7291c93 xmloff: ODF import: fix z-index rotation in header/footer
ShapeGroupContext::popGroupAndPostProcess() is called 2 times when
importing an ODF package file, once at the end of styles.xml, then at
the end of content.xml; in the 2nd case, all shapes of styles.xml end up
in maUnsortedList.

There are 2 problems with it:

1. in the XShapes3 branch, once maZOrderList is empty, any remaining
   elements in maUnsortedList are ignored and thus the aNewOrder
   contains duplicate 0s at the end which will cause sort() to throw

2. the XShapes3 branch removes elements from maUnsortedList, hence when
   the exception is caught and the fallback path runs, it only moves
   the elements that happened to remain in maUnsortedList

   Effectively, what happens is that the z-order of everything in
   headers/footers is rotated so that the last (topmost) N elements go
   to the start (background).

3. In case the objects in content.xml happen to be sorted correctly
   wrt each other, but there was an object with higher z-index in
   styles.xml, sorting is skipped.
   Turns out that testTdf159158_zOrder_headerBehind already tests this.

(regression from commit a8b1699ca9)

Change-Id: Ifdde6fc43af4c655b430d723b875dfd46e8533f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197475
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 66a1ad2163d5799a79b23554b22e08a07f693225)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197730
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2026-01-22 10:11:23 +01:00
Michael Stahl 9e0d4c693c sw: fix setting mbIsTextBox on shapes' text boxes
SetTextBoxes(true) is never called because it checks the shape's
SdrObject, while previously this code was in
SwFrameFormat::SetOtherTextBoxFormat() where it would be called a second
time for the text box SwFrameFormat which has the SwFlyDrawObj.

SwTextBoxHelper::getCount() can't ignore the text boxes if the flag is
never set; this ends up confusing
ShapeGroupContext::popGroupAndPostProcess() (and causes tests like
testTdf84695 to fail with the fixes in the next commit).

Because shapes with text boxes are sorted again with this, testTdf146272
and testTextBoxLoss need adapting.

(regression from commit 504d78acb8)

Change-Id: I80c375d900a10f1956cd112d60c3f25332c485ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197594
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 327e92c78603e011e7ddf8b57749dfd9e690addf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197729
Tested-by: Jenkins
2026-01-21 19:52:23 +01:00
Michael Stahl a61f371ee5 curl: disable ipfs protocol, not needed
Change-Id: Ie16206b6e853a130e51fbc664224091090f78ff0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197473
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit ae9260a063ec51ee87dc7b85d0bd48d982a12b95)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197573
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2026-01-20 13:13:32 +01:00
Michael Stahl c455986626 xmloff,svx,sw: ODF export: prevent spurious z-index="0"
Currently any object anchored in a Writer header / footer which isn't
actually used in the document isn't put on the SdrPage and thus doesn't
have a ZOrder; this results in a spurious z-index="0" attribute, where 0
is a perfectly valid value that is typically already used by a visible
shape and is thus duplicated, which is invalid.

Fix SvxShape::getPropertyValueImpl() and SwXFrame::getPropertyValue() to
check that it has a parent, and
XMLTextParagraphExport::addTextFrameAttributes() to properly check that
the property has a valid value.

There is one possible use case for producing a z-index for something
that isn't visible: when it's anchored in a delete tracked change, and
we want to preserve the order relative to other shapes in the document.

However, it turns out that in SdXMLShapeContext::AddShape() and
XMLTextFrameContext_Impl::Create() the z-index of anything anchored in a
delete redline is already explicitly ignored, so it's a non-issue.

Change-Id: I37e461ebcd3e4546c60f421054ee39c053919267
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197474
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 7ffd4f7a27b9b2bc55ac3ddb7333dbaf3d48109c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197622
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2026-01-20 11:36:37 +01:00
Michael Stahl 85624a4ccc libpng: upgrade to release 1.6.54
Fixes CVE-2026-22695 CVE-2026-22801

Change-Id: Id7c4c4d2ffa583ca1eeec23720a4ce74b819305f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197183
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 4e63ac95e1cce0c56e0277c6ecdade3ff43d1f96)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197190
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2026-01-14 12:44:18 +01:00
Michael Stahl d92905f099 filter: XSLTFilter: unbreak XSLT2Transformer
Creating the service fails:

  java.lang.ClassCastException: class com.sun.star.beans.NamedValue cannot be cast to class [Ljava.lang.Object; (com.sun.star.beans.NamedValue is in unnamed module of loader com.sun.star.lib.unoloader.UnoClassLoader @6ff3c5b5; [Ljava.lang.Object; is in module java.base of loader 'bootstrap')
  at com.sun.star.comp.xsltfilter.XSLTransformer.initialize(XSLTransformer.java:143)
  at com.sun.star.comp.loader.FactoryHelper$Factory.createInstanceWithArgumentsAndContext(FactoryHelper.java:271)

because initialize gets a sequence<any> where the anys are NamedValues,
but it expects a sequence<any> where the any is sequence<any> where the
anys are NamedValues.

(regression from commit d22f3b8c78)

Change-Id: I4fd13f3e04d79f7646e6bb31c8f0d35efd42ae69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197132
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2026-01-13 09:07:20 +01:00
Michael Stahl 148ce16629 Revert "cid#1680311 Uninitialized scalar field"
This reverts commit 9b5c39d3b0.

Reason for revert: causes merge conflict, will be fixed anyway

Change-Id: I5d4adc6806e0da9dd875516eb2d695ea5a8ddf87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197135
Tested-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2026-01-12 19:24:24 +01:00
Michael Stahl c649a09c73 ucb: webdav-curl: print SAL_WARN if no CA certificates are found
Apparently nothing prints the exception message, so make sure this
config issue is visible in logs.

Change-Id: Idfb18e2fe42aa7bdcc1c8029833657bb8269b980
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196860
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 4b007c890995d143cb8916db8b23773d6935e3fc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196907
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2026-01-12 12:13:31 +01:00
Michael Stahl bb77fdf427 nss: try to fix Windows ARM64 build
Reportedly it breaks if CC is set to anything sensible, let's just leave
it alone... also it turns out that the newer nss version builds with CC
containing an argument in config_host.mk anyway.

Change-Id: Ifecc68ffe582790134f91cbef459e2728d9202c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194963
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2025-12-05 18:50:37 +01:00
Michael Stahl 698e6705c0 libpng: upgrade to release 1.6.52
Fixes CVE-2025-66293

Change-Id: I1f0aefccf2b80d14e70b423381c121a97e510045
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194979
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit f65e262ac15f247f9fabe6d60d3e69d269c68608)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194991
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-12-04 14:55:42 +01:00
Michael Stahl 3ff253e277 gbuild: -fsanitize=address MSVC build
setup_native assorted DLLs must have ASAN disabled.

ICU build doesn't work, so disable ASAN for that.

This built with MSVC 2022 and:

CC=...cl.exe -fsanitize=address
CXX=...cl.exe -fsanitize=address
--disable-firebird-sdbc
--disable-skia
--disable-pdfium

Change-Id: I296241e43b68579fdd9b6af9c98a5b541c8ae89a
(cherry picked from commit 98b92b339fa3c28319f3f6cec94abb04229f487a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194728
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 579956c4c54f498a22b8e5ed20468ceb9a6e0e30)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194866
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-12-01 12:01:23 +01:00
Michael Stahl e3a9530f29 tdf#167362 sw: fix footnote hang with JAWS
When moving the cursor to a line with a footnote, JAWS tries to retrieve
the text attributes, gets an E_FAIL, but never gives up trying again.

The problem is that some entirely undocumented magic number is stuffed
into an uno::Any as `long` but the "CharEscapement" property is actually
`short` and thus reading the property in
AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes()
throws and this is caught by CAccTextBase::get_attributes() and E_FAIL
is returned.

>	vcllo.dll!o3tl::doAccess<short>(const com::sun::star::uno::Any & any) Line 284
 	vcllo.dll!AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rUnoAttributes, IA2AttributeType eAttributeType) Line 271
 	vcllo.dll!AccessibleTextAttributeHelper::GetIAccessible2TextAttributes(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleText> xText, IA2AttributeType eAttributeType, long nOffset, long & rStartOffset, long & rEndOffset) Line 346
 	UAccCOM.dll!CAccTextBase::get_attributes(long offset, long * startOffset, long * endOffset, wchar_t * * textAttributes) Line 145
 	UAccCOM.dll!CAccText::get_attributes(long offset, long * startOffset, long * endOffset, wchar_t * * textAttributes) Line 54
 	FSDomNodeSymphony.dll!00007ff93f0fea12()
            ^ JAWS

Change-Id: I6c487f9d2db462b787034df3d5ba2f2822d14746
(cherry picked from commit 776662481583935ca148930de1e91ea499c53b3a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194737
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-11-28 09:56:24 +01:00
Michael Stahl b2c03ef9c7 tdf#168897 winaccessibility: fix JAWS crash with CAccTable
stack:

 	UAccCOM.dll!ATL::CComObjectRootBase::OuterAddRef() Line 2631
 	UAccCOM.dll!ATL::CComContainedObject<CAccImage>::AddRef() Line 3719
 	AccEventCache.dll!00007ffd2039be28()
 	AccEventCache.dll!00007ffd20355677()
 	AccEventCache.dll!00007ffd20346d41()
 	AccEventCache.dll!00007ffd20347f9a()
 	AccEventCache.dll!00007ffd20338ba2()
 	AccEventCache.dll!00007ffd20380dd8()
 	AccEventCache.dll!00007ffd2037fd7b()
 	AccEventCache.dll!00007ffd2037f7ee()
 	AccEventCache.dll!00007ffd2037d9e6()
 	AccEventCache.dll!00007ffd2037d07f()
 		^ JAWS
 	GlobalHooksDispatcher.dll!00007ffd214daed4()
 	GlobalHooksDispatcher.dll!00007ffd214d8d84()
 	user32.dll!00007ffd492068ac()
 	ntdll.dll!00007ffd4ae71424()
 	win32u.dll!NtUserNotifyWinEvent()
 	winaccessibility.dll!AccObjectWinManager::NotifyAccEvent(com::sun::star::accessibility::XAccessible * pXAcc, UnoMSAAEvent eEvent) Line 182
        	^ selfAccObj looks very dead here but that is a red herring!
 	winaccessibility.dll!AccContainerEventListener::FireStateFocusedChange(bool enable) Line 351
 	winaccessibility.dll!AccContainerEventListener::SetComponentState(__int64 state, bool enable) Line 178
 	winaccessibility.dll!AccParagraphEventListener::SetComponentState(__int64 state, bool enable) Line 123
 	winaccessibility.dll!AccContainerEventListener::HandleStateChangedEvent(com::sun::star::uno::Any oldValue, com::sun::star::uno::Any newValue) Line 106
 	winaccessibility.dll!AccContainerEventListener::notifyEvent(const com::sun::star::accessibility::AccessibleEventObject & aEvent) Line 72
 	winaccessibility.dll!AccParagraphEventListener::notifyEvent(const com::sun::star::accessibility::AccessibleEventObject & aEvent) Line 77
 	comphelper.dll!comphelper::AccessibleEventNotifier::addEvent(const unsigned long _nClient, const com::sun::star::accessibility::AccessibleEventObject & _rEvent) Line 256
 	swlo.dll!SwAccessibleContext::FireAccessibleEvent(com::sun::star::accessibility::AccessibleEventObject & rEvent) Line 457
 	swlo.dll!SwAccessibleContext::FireStateChangedEvent(__int64 nState, bool bNewState) Line 478
 	swlo.dll!SwAccessibleParagraph::InvalidateFocus_() Line 397
 	swlo.dll!SwAccessibleContext::InvalidateFocus() Line 1314
 	swlo.dll!SwAccessibleMap::InvalidateFocus() Line 2695
 	swlo.dll!SwViewShell::InvalidateAccessibleFocus() Line 2597
 	swlo.dll!SwEditWin::GetFocus() Line 5569
 	vcllo.dll!vcl::Window::CompatGetFocus() Line 3891
 	vcllo.dll!vcl::Window::ImplGrabFocus(GetFocusFlags nFlags) Line 385
 	vcllo.dll!vcl::Window::GrabFocus() Line 2983
 	sfxlo.dll!SfxFrame::GrabFocusOnComponent_Impl() Line 650

The problem is quite simply that CMAccessible::SmartQI() returns a
pointer that is the result of querying the newly created COM aggregation
for IID_IUnknown instead of the requested `iid` interface.

Apparently the wrong result happens to work in many cases, but the
CAccTable actually has 2 interfaces IAccessibleTable and
IAccessibleTable2, and the COM aggravation for IAccessibleTable2 is the
one that crashes; in this case the correct pointer is an offset of 8 to
the start of CAccTable, while in the working cases there is no offset.

So likely the bug was introduced by commits
3b86569fcb and
d0e8e6e3cd but only started to crash with
839dbf9ecf.

Change-Id: I7c7d295c8032b95fe7f64b8da4dd9bc3212563f9
(cherry picked from commit 9502a9f76731afa0f5105e6d79b069222677f88d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194730
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-11-28 09:56:17 +01:00
Michael Stahl 037c7677e4 libpng: upgrade to release 1.6.51
Fixes CVE-2025-64505, CVE-2025-64506, CVE-2025-64720, CVE-2025-65018

Change-Id: Id58827859de899aea020f43835f2b37bf262ed33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194421
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 313c6d0a0d8a65e23e06ebcae08e0249f9f0d749)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194454
Code-Style: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-11-25 13:23:02 +01:00
Michael Stahl 99c7fea261 sw: prevent anchoring SwXFrame to itself
ooo30979-1.doc, converted to rtf, then loaded by writerfilter will
create a text frame anchored to its own 2nd paragraph, triggering:

  sw/source/core/doc/doclay.cxx:1591: bool SwDoc::IsInHeaderFooter(const SwNode&) const: Assertion `pNd != rAnchor.GetAnchorNode()' failed.

Change-Id: I5d0ee2ea406273ca42a50047b40a6d8d8d759f0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194121
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-11-18 11:31:35 +01:00
Michael Stahl 8e52bae5c4 tdf#169314 configure: default to --without-system-libxml (Linux)
Tragically libxml2 2.14 changed the SONAME to libxml2.so.16, breaking 25
years of ABI compatibility.

Debian sid and Ubuntu 25.10 both appear to ship only libxml2.so.16 with
no compat package for libxml2.so.2

configure has always defaulted to preferring system libxml on
Linux/macOS but that used to be overridden for release builds before
commit b20f17ce082f30b0a2afd0d311f63f6b2ad8a99a

Change-Id: I7d9b27bd7334ae4ade8c9b58fcf2cd0f9f07fab4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193735
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-11-12 14:27:52 +01:00
Michael Stahl 6c6c5227f3 sfx2: fix mysterious -Werror=shadow
GCC 14 now mysteriously finds a -Wshadow here but not in the many other
SfxChildWindow subclass member functions that have a parameter named
"pParent":

  sw/source/uibase/sidebar/QuickFindPanel.cxx: In constructor ‘sw::sidebar::QuickFindPanelWrapper::QuickFindPanelWrapper(vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo*)’:
  sw/source/uibase/sidebar/QuickFindPanel.cxx:115:59: error: declaration of ‘pParent’ shadows a member of ‘sw::sidebar::QuickFindPanelWrapper’ [-Werror=shadow]
  115 | QuickFindPanelWrapper::QuickFindPanelWrapper(vcl::Window* pParent, sal_uInt16 nId,
      |                                              ~~~~~~~~~~~~~^~~~~~~
  In file included from include/sfx2/quickfind.hxx:13,
                 from sw/source/uibase/inc/QuickFindPanel.hxx:13,
                 from sw/source/uibase/sidebar/QuickFindPanel.cxx:11:
  include/sfx2/childwin.hxx:102:32: note: shadowed declaration is here
  102 |     VclPtr<vcl::Window>        pParent;         // parent window ( Topwindow )
      |                                ^~~~~~~

Change-Id: I98228f312308ee69a17af34bb31a5d4109b06ad9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189017
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit a8c445bb1ecf5a68c3925e3ab19d08f0b44644c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193750
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-11-10 19:22:41 +01:00
Michael Stahl f2f320b98b nss: try to unbreak iOS build
(regression from commit e39a1baeb4)

Change-Id: I8955f772dd2ccb9d66142115f2c9a2aafc06d8f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193559
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-11-10 17:56:36 +01:00
Michael Stahl d97775f3ee sw: fix SwDoc::IsInHeaderFooter() with flys
If the node is in a fly, this can only print:

  sw/source/core/doc/doclay.cxx:1619: Found a FlySection but not a Format!

This is a regression from commit
e07feb9457 which used the wrong node's
anchored objects: of course the fly is never anchored to itself, so this
will never find anything.

It turns out that there is already a function SwNode::GetFlyFormat()
that can do most of the work, even using the layout to speed it up, so
just use that to get the anchor.

Change-Id: I7a22231f929175ed7c5c11724882b03890781cfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193476
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-11-06 09:38:59 +01:00
Michael Stahl 9e330d0562 sw: prevent anchoring SwXShape to its own textbox
SwXShape::setPropertyValue() allows anchoring a shape to its own
textbox; this actually happens in testTdf146955.

Detect this and throw IllegalArgumentException.

Also catch the exception in GraphicImport::lcl_attribute() so the test
doesn't fail.

Change-Id: I236e12384e07793e0cf3474fc92657967d9249f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193475
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-11-06 09:38:56 +01:00
Michael Stahl d2c387bc60 tdf#136220 sw: text formatting: fix breaking line with multiple fields
... when there is an anchored object in the footer, and the last field
fits only partially on the line.

This stopped working with commit 8e3afdb598
removing the IsFooterFrame() check in SwTextFly::GetTop().

Previously a new line below the last line that fits on the page started
with the field rest portion, when the not-fitting line is deleted in
SwTextIter::TruncLines() this caused pDel->IsRest() to be true and
setting SetFollowField(true) which later caused the mbFieldFollow to be
set in the follow text frame.

Now the pDel->IsRest() is false because the line contains only a big fly
portion due to the fly in the footer, and then SetFieldFollow(false) and
the follow doesn't start with the rest of the field.

There is a long standing bug in lcl_NeedsFieldRest() causing this, it
simply doesn't work if there are multiple fields in a line, it
erroneously considers the first field to be the last one in the line.

Change-Id: I99e9f68e8e9f8019e4d22ce5d7874d4cdac285e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193474
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-11-06 09:35:48 +01:00
Michael Stahl 116facc290 sw: text formatting: add test for per-line paragraph properties like Word
Test for commit 0849ddd0b1

Change-Id: Ia26286593b3e7f21799a86b1762ab30421941fad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192957
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-10-27 12:00:50 +01:00
Michael Stahl d274abca3e libxslt: add patch for CVE-2025-10911
Change-Id: I951aad2bff3911f685f73390e4f42ed29fe49b41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192444
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit fca876c2c369b26244413fafe506acafb9d3b5bf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192860
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-10-22 18:13:42 +02:00
Michael Stahl 07674a32af tdf#51850 sw: fix a nullpointer crash
lcl_PasteFlyOrDrawFormat() may return nullptr, causing testTdf155028 to
crash in older release branch.

(regression from commit d072b5e09e)

Change-Id: I68549648aef2c9d58919f4d26415834d0784eeef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192173
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-10-13 11:04:51 +02:00
Michael Stahl d072b5e09e tdf#51850 sw: AutoCaption for a single pasted image
AutoCaption mostly isn't enabled for clipboard paste, except for one
special case.

For the case when the source is outside LO, let
SwTransferable::PasteGrf() set a flag that the caption should be
inserted (the SwPasteSdr::Insert case), which can then be handled at the
end.

PasteFileList() appears to be used when an image file is copied from
Nautilus.

For internal paste, it gets more complicated because SwFEShell::Paste()
knows what was inserted, but caption can only be added later, outside of
any StartAction()/EndAction(), because if an action is pending,
SwWrtShell::GetSelectionType() does not return useful results, and the
lcl_InsertLabel() ends up erroneously inserting a text node next to the
SwGrfNode.

Change-Id: I3e16f407fd409a0f315be139376ad9e5f0b526cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192165
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-10-10 15:36:01 +02:00
Michael Stahl 2ae71afbef sw: fix too early reset of m_oParagraphBreak
Thanks to Mike Kaganski for finding this

(regression from commit 0849ddd0b1)

Change-Id: I1dd68f2b45f346f4dc0ac5242900d67970998dfa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192105
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-10-09 16:34:25 +02:00
Michael Stahl 0849ddd0b1 sw: text formatting: implement per-line paragraph properties like Word
This doesn't make a whole lot of sense.

Add compatibility setting "HiddenParagraphMarkPerLineProperties" for RTF
and DOCX compatibilityMode < 15.

Apparently what Word's "Compatibility Mode" is doing in case a paragraph
mark has hidden formatting is that it merges the last line of the first
paragraph and the first line of the second paragraph together, and
applies the first paragraph's properties to the line (and the preceding
lines); but for the second line of the second paragraph, it applies the
second paragraph's properties.

This is now implemented here; firstly, by adding a flag to the
MergedPara's Extents so that the situation can be distinguished (if the
paragraphs are joined by a delete redline, Word does something different
of course).  Because it's possible that the hidden paragraph break is on
a paragraph that doesn't have any extents, but a preceding paragraph has
extents that are affected, this sometimes requires 0-length dummy
extents.

FindParaPropsNodeIgnoreHidden() sets the last paragraph as
pParaPropsNode, which is used for all non-per-line properties.

Note that it's somewhat likely that the various Update functions in
txtfrm.cxx don't maintain the isHiddenParaMerge flag on extents
correctly, so it may look different than Word when editing.

Currently it affects these properties:

* line spacing

* tab stops

These are now set per line by SwTextIter::Next() calling
SwAttrIter::GetTextNodeForLinePropsWordCompat() and a factored out
SwLineInfo::InitLineInfo().

Evidently Word also does adjustment this way, but it's not implemented
here.

Change-Id: I216d9e2afdac9ab6f97c0ea822d4d501689df7a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192077
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-10-09 13:07:17 +02:00
Michael Stahl 0622d8d160 configure: openssl 3.0.18 evidently needs perl Time::Piece
Can't locate Time/Piece.pm in @INC (you may need to install the Time::Piece module) (@INC entries checked: ...) at Makefile.in line 37.

Change-Id: Ia47eeb971f7bf91972f46be46330f10e64682799
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191735
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-10-01 17:31:49 +02:00
Michael Stahl e1dfc36c9d tdf#168538 package: now i notice there's bRecoveryMode
Change-Id: I909ab70a97d6e89456d17a6804551abd618444a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191723
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-10-01 15:46:21 +02:00
Michael Stahl 7978401cfc sw: fix "Export Directly as PDF" with set-variable fields in hidden text
... results in wrong conditional text fields.

First, add a testHiddenSectionPDFExport2 for the bug that was fixed with
commit 1e007e8f17 - and
testHiddenSectionPDFExport for a slightly different scenario that also
failed.

Investigating this, it turns out that the conditions are only evaluated
properly inside SwDBManager::Merge(), because this sets up its
m_pImpl->pMergeData, and without that SwCalc::VarLook() will not know
which record is currently selected and return SbxVoid (if there is no
xConnection) or a wrong record (if there is a xConnection).

There is even code in SwDBManager::Merge() that tries to store the new
state in m_DataSourceParams so that later SwCalc are able to use it, but
this broke in 2007 with commit d06a6d2c19
which changed SwNewDBMgr::FindDSData() to return the m_pImpl->pMergeData
instead of a m_DataSourceParams entry, and thus the *pTemp assignment
became self-assignment.

Also, FindDSData(bCreate=true) already does everything that this code
was doing anyway, so if we just call that *before* creating
m_pImpl->pMergeData we can delete all that code.

Now another problem becomes apparent: an obvious mismatch between how
SwDBManager::GetColumnCnt() and lcl_MoveAbsolute() treat
SwDSParam::aSelection - in the caller the nAbsRecordId is an index that
is *contained* in aSelection (see explicit search with std::any_of), in
the callee it is an index *into* aSelection.

Apparently this is a regression from commit
f5ccfd60c2 and testing reveals that for
tdf#73025 the lcl_MoveAbsolute() is never called from GetColumnCnt(),
but only from SwDBManager::ToRecordId(), so let's have 2 different
functions for callers expecting different behaviour.

Then revert 1e007e8f17 as this scenario
works with the above described fixes.

Add a testHiddenTextFieldPDFExport for the new bug.

Change-Id: Ibca38edec8782c06a61d4eb5c9065098de8562fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191104
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-10-01 11:59:18 +02:00
Michael Stahl 347512a77b tdf#168538 package: downgrade assert to SAL_WARN
It is only impossible during normal package parsing because of the added
consistency checks, but the inconsistency can happen during recovery.

Kind of arbitrary which size is used then?

Change-Id: I31ce9ae8b6fe3d1ca50a118ae6c1feaaaffe17ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191455
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-09-24 19:47:24 +02:00
Michael Stahl 528d5c8e0b sw: layout: when positioning SwSectionFrame, ignore dead prev sections
The place where it went wrong was in a second layout iteration when
after positioning some objects everything was moved down, in
SwSectionFrame::SimpleFormat(), where an empty section frame 72 of the
1st outer section was the prev of the 2nd outer section frame 73, and
was itself not positioned properly.

Apparently this empty section frame is inserted by InsertCnt_() but of
course empty section frames can happen in other ways too.

(reportedly regression from commit a85bd1bc9305af059d880ee422a656a3d9ce1b0b)

Change-Id: I7513a2171fe4f3763f7b73b2e4368032e015c495
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191410
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-09-24 13:41:07 +02:00
Michael Stahl abfdc11fa4 tdf#167205 package: fix writing Zip64 local headers
This would be reported on reading as an 8-byte gap at the position where
a 32-bit DD for the entry would end.

The problem is that if flag bit 3 is set, and the uncompressed size
exceeds 2^32, writeDataDescriptor() will write 8-byte sizes, but the
Zip64 extension header is missing - the latter should also write 0 even
though the APPNOTE doens't appear to require it.

      4.3.9.2 [...] When extracting, if
      the zip64 extended information extra field is present for
      the file the compressed and uncompressed sizes will be 8
      byte values.

Also make sure that the ZipEntry nSize member actually contains the
uncompressed size, which is somewhat tricky, but is required in
writeLOC() to check if Zip64 is needed.  (Assume that the DEFLATEd size
is never larger than uncompressed, which is true for every XML file).

Change-Id: I611e6ffda12d8e6953e9306dc4a4407be8e725a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191185
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-09-23 11:42:58 +02:00
Michael Stahl c850dd1c36 sw: add test for bug fixed in 7a036a6458
Change-Id: I8a665383a2e71678e7ec1b267f8775736d09b2f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191139
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-09-18 18:37:16 +02:00
Michael Stahl 7a036a6458 sw: PDF export: fix crash on section in table in section
soffice.bin: vcl/source/gdi/pdfextoutdevdata.cxx:798: void vcl::PDFExtOutDevData::EndStructureElement(): Assertion `mpGlobalSyncData->mCurrentStructElement != 0' failed.

The problem is that the parent-opening code in
SwTaggedPDFHelper::BeginBlockStructureElements() when called for a
section in a table cell opens a section that is outside the table.

In this case, there are actually 2 section frames, one containing the
table and one in the table cell, so reopening the outer section frame
that is already on the stack ends up restoring a 0 parent SE and that
triggers the assert.

(regression from commit d5f68529a7)

Change-Id: Idd5be655345f96e1c2de84c5623f6e1dba4aae1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190781
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-09-11 15:36:39 +02:00
Michael Stahl e21f78274d tdf#166319 schema: limit change nesting to what is actually supported
Change-Id: Ie574377ea9cdd90ed9261229abaca480b4010440
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190738
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2025-09-10 16:04:40 +02:00
Michael Stahl fc53ab8e76 sw: floating table split
The problem is that the Table Split feature on a floating table results
in 2 tables inside 1 frame, which then cannot be exported to DOCX as a
floating table.

Split the fly frame in this case, and add an anchor node because every
floating table needs its own anchor node.

Change-Id: I7444a75a953fcea60ffc92c2fa7eaca1b044f54b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190009
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 6f55b9a74f8fdd8609e1aa72388a5f8b97dfcea0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190075
Tested-by: Jenkins
2025-09-03 11:22:11 +02:00
Michael Stahl e00e1410ee sw: remove another obsolete comment
Change-Id: Ia424d39562421a7945d6206dbb715973ab44019b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189972
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-08-21 18:07:20 +02:00
Michael Stahl c57fe4069a tdf#167833 sw: handle more ways of pasting anchored objects
Handle it in SwTransferable::PasteOLE() for embedded objects from
non-Writer applications, SwTransferable::PasteSdrFormat() for SdrObjects
from non-Writer applications, and SwTransferable::PasteGrf() for image
files from non-LO applications.

This is a bit more difficult because some of these call
SwTransferable::PasteTargetURL() after the SwFEShell function that
creates the anchored object, and this will only work if the anchored
object is selected at that time, so the deselection must be done later
in SwTransferable.

SwTransferable::PasteTargetURL() can also be called directly and would
need a check added in that case, but i couldn't figure out what to put
on the clipboard to get there (has to be INET_IMAGE or NETSCAPE_IMAGE).

Change-Id: If068622b0998893f016b84498d0618c112460db5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189629
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-08-19 10:47:33 +02:00
Michael Stahl 457872f8ca rhbz#2354168 configure: workaround bogus "dbus-1" libs
DBUS_LIBS contains -L/usr/lib64/pkgconfig/../../lib64 which eventually
causes link failure:
  desktop/source/lib/init.cxx:6451: error: undefined reference to 'ublock_getCode_77'

Reportedly realpath(1) is available even on macOS now so use it to
resolve these paths.

Change-Id: I754447ad23982918d6f8e80f839112db22b75205
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189864
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-08-18 16:40:25 +02:00
Michael Stahl 7905077311 sw: prevent negative width SwTabLeftPortion
This will eventually assert in SwTabPortion::Paint():

  sal/rtl/strtmpl.hxx:801: void rtl::str::new_WithLength(rtl_tString**, sal_Int32): Assertion `nLen >= 0' failed.

Also move a comment from its current misleading position (this one is
using TAB_OVER_SPACING).

Change-Id: I0a8b347f7467fcd7176b75a5a7e5e672ad5e13d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189382
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 3bfa151d6f834ef46f1f112ab670cc2d8af6de5c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189682
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-08-18 13:44:41 +02:00
Michael Stahl 1261c20004 sw: fix mismerged and redundant comment
Change-Id: I745dc8415936e4140be1dcbd76f0b2c626af48eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189698
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-08-18 13:13:33 +02:00
Michael Stahl 034276dbfc tdf#167910 filter: xhtml: try to handle combinations of underline and overline
Change-Id: I2dc735157d5278fb8e95881ef967443a48fee10f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189416
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-08-12 16:30:35 +02:00
Michael Stahl 825edbcc67 tdf#167910 filter: xhtml: simplistic conversion of overline to CSS
Change-Id: Id577cf71cb383260c4c66ab929794c02911d01c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189415
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-08-12 16:30:26 +02:00
Michael Stahl 6af7e6f1e5 libxslt: add patch for CVE-2025-7424
See https://gitlab.gnome.org/GNOME/libxslt/-/issues/139

Change-Id: I68f01dcb6b540ddf3d2e74927ec21c0ca4fc865f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189105
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 0f59405c5b255e80707a550129045c3dadd3c46f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189119
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2025-08-08 12:02:48 +02:00
Michael Stahl d6409f6292 libxml2: add upstream patch for CVE-2025-7425
Change-Id: I84110fc1ed54eac4a0ce4d8b8070a031c761fb39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189104
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 88e2be781bc22f8500f57c84cec572ead8af32c4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189118
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2025-08-08 12:02:06 +02:00
Michael Stahl 6204dfeb53 tdf#167833 sw: if an anchored object is pasted, don't select it
Instead, leave the cursor in the text at the paste location, like
(reportedly) some version of Word does.

This can be configured with the new
Office::Writer::Cursor::Option::SelectPastedAnchoredObject

Change-Id: Id1ddeb0e17c5cd568100d5a8169d929487d16749
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189001
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-08-06 16:58:39 +02:00
Michael Stahl b45ba94bf2 tdf#167710 writerfilter: RTF import: ignore text in \revtbl
Only text in groups in \revtbl is relevant. Same goes for \stylesheet.

(regression from commit 82e17dbb2a)

Change-Id: I70a97f7815e1f83b10be7cf12ee5abcd6b662a92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188705
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-08-01 14:02:41 +02:00
Michael Stahl 40d659647d sw: Backspace/Delete hidden section must delete flys anchored therein
During save to ODF this asserts, or later crashes:
    atrfrm.cxx:3810: void sw::CheckAnchoredFlyConsistency(const SwDoc&): Assertion `std::find(rFlys.begin(), rFlys.end(), pSpz) != rFlys.end()' failed.

Initial idea was to fix this by changing SwWrtShell to not use the
ArtificialSelection mode when a hidden section is selected - this fixes
the initial problem but there is another one!

Because ArtificialSelection is now also set in
SwXTextRange::DeleteAndInsert() and SwXTextCursor::DeleteAndInsert(),
the crash can also be reproduced by calling setString("nonempty") on a
cursor that selects multiple nodes with an object anchored on a middle
node.

So better to fix this in SwUndoSaveContent::DelContentIndex() by moving
the Replace check into the IsSelected functions, and to ignore *only*
flys on the start and the end node of the selection, so flys anchored on
the middle nodes are now deleted.

In any case for Undo to work a SwHistoryHint must be created for these
which ExcludeFlyAtStartEnd prevents so it's a different case.

This covers all the initially intended use-cases of
DelContentType::Replace, which actually only were 1-2 node selections
anyway (limited by UI); the arbitrary-sized selection cases were from
later re-uses of the flag for other use cases, and in both the Backspace
and the API case the possibility of flys anchored on middle nodes was
unfortunately missed.

Currently SwUndoSaveContent::DelContentIndex() was the only caller of
the IsSelected functions that could see a DelContentType::Replace.

(regression from commit 85376a0234)

Change-Id: Ifc5aad47e80c638d4e7cb5f66c035fdf1e34b89f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188251
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
2025-07-24 00:09:43 +02:00
Michael Stahl 0fad4a4a27 sw: better type for UNO_TABLE_COLUMN_SUM
As Mike Kaganski points out it's not really a size but a unitless value.

Change-Id: I0e24a18c3553a3f560a849bc3f8b781c2e94d857
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188211
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 7748d38241c543b468e9d4d1bfaa5cae01a6159d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188245
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-07-23 23:53:30 +02:00
Michael Stahl bee609cf3d sw,writerfilter: move UNO_TABLE_COLUMN_SUM to swtypes.hxx
Change-Id: I0e9a5e0e7916d91d791b0b68fa0a5d27fe2a811f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188157
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 00a276222a2f78d760db33f3880cd71f227823a2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188217
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-07-23 17:19:24 +02:00
Michael Stahl b2dcf38fdb tdf#166953 writerfilter: add column width when adding extra cell
It's not so obvious how the cell widths are set...

1. The table gets USHRT_MAX as initial width
2. All the cells in the table get USHRT_MAX/nCells as initial width
   (this is SwFrameSizeItem in box item set)
3. Table property "Width" is set -> this scales all the box widths
4. Row property "TableColumnSeparators" is set; this is *relative* widths
   to a hard-coded value of TableColumnRelativeSum=10000

Evidently the result is bad if the number of separators is too low.

(regression from commit 038473595e)

Change-Id: Ie71889a074bff43d8f0c34ccefb4d30ed0a9f0c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188153
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 23e308d5e02ee45ef589d3fddf53dabaa12aadfe)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188207
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-07-23 17:19:16 +02:00
Michael Stahl 7c9b5d56f0 sw: fix rounding problem in lcl_SetTableBoxWidths2()
Prevents bunch of warnings like:

    swnewtable.cxx:2525: Line width differs from table width: 14148 current [0]: 14144

Change-Id: Ic24096d91ad6646635038a06b74251e3bcbad134
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188152
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 65987cb2f8ed6b6cf67032cbce4c5e58f2577803)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188202
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-07-23 12:48:25 +02:00
Michael Stahl e9e01ff356 sw: add something about styles to README
Change-Id: I2f6e23a69fdb950bfa778252b2f10eaa371f0e1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187756
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2025-07-14 10:18:20 +02:00
Michael Stahl 55fbce8051 tdf#166975 sw: fix DOCX export of list level format with repeated levels
MSWordExportBase::NumberingLevel() would only replace each level's
placeholder once in the format string; rework this so it iterates the
whole format string.

Change-Id: I7f375ac1f96f4fcbac51f7cba1cc67378f4edbb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187580
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 58db687fd96fcbb6a6b2909142df2fa01427add9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187635
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-07-11 10:03:02 +02:00
Michael Stahl 1db8174359 tdf#166975 sw: fix expansion of list level format with repeated levels
SwNumRule::MakeNumString() would only replace each level's placeholder
once in the format string; rework this so it iterates the whole format
string.

Change-Id: I1d0c5bf5c60c3003cc0257acfb69b37d209be617
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186977
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit e200c729797e7f3c19e958f9796a1d0fbae829d1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187020
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2025-07-10 14:51:02 +02:00