Commit Graph
100 Commits
Author SHA1 Message Date
Caolán McNamara 8cfa628be8 firebird: only write back an embedded database that was opened
When construct throws before the attach succeeds, the connection is
disposed with the temporary .fdb extracted but never opened, but
storeDatabase ran the backup service against it anyway.

Note whether the database was opened and skip the write back when it was
not.

Change-Id: I7c1bfdd880699d661e4b798fff441a357c141f12
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/6703
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit a73db8b145af1c74cb181e094c0b7ccc4d92d8f0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208041
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-14 10:29:32 +02:00
Caolán McNamara 736210ff4c firebird: don't attach a database that is not in the normal backup state
A database we extract from a .odb is always in the normal backup state,
so refuse one that is not, we're not interested in the difference file
mode case.

firebird upstream attempt as:
https://github.com/FirebirdSQL/firebird/pull/9089

And do it manually for the system-firebird case.

Change-Id: Iff9ebbb075379ca47a7f7f5886b693ac23860566
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/6702
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e7ea381e87cadaf31bf1ad2213a23f17a6284d1c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208040
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-14 10:29:25 +02:00
Caolán McNamara c656bab4c9 firebird: keep each embedded database's files in one directory
Give the driver a directory of its own, extract each embedded database
into a subdirectory of it, and set DatabaseAccess so firebird keeps any
associated files it makes for a database in the same directory.

A distro firebird reads only firebird.conf from the directory the
FIREBIRD variable names and finds its other resources at their normal
absolute paths. A bundled firebird finds everything relative to it.

Change-Id: If082a30d2426e7942fc9dd48f7124928fc984434
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/6701
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 520d8173cef39a4da85b3ba21bdaaa3150384c25)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208039
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-14 10:29:05 +02:00
Caolán McNamara cc5ac2a819 firebird: don't run an attached database's own event triggers
for the embedded and file cases suppress the database's ON CONNECT and
similar event triggers when attaching, they should not fire just because
the document was opened

Change-Id: I37edab43f25d8cb72cc6dcafd743045f96b4c2e6
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/6700
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 36335ff89ea2309e99da02b449c9b35517cd6f9d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208029
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-13 17:36:08 +02:00
Caolán McNamara 427178ee5c upgrade to libstaroffice-0.0.8.tar.xz
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: If15e225516d3435bb3274e1772345759a1d2430d
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6691
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit de87637a86d4d97f4346ce125cf766343c6da152)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208019
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-13 17:24:31 +02:00
Caolán McNamara a950aba70f sd: implement "block untrusted referer links" feature for exported ppt sounds
The ppt sound collection fetched the sound url straight through
UcbStreamHelper, without the referer and exotic-scheme checks applied
before fetching any other document-supplied url. The avmedia media
loader guards the same way:

commit 5668e73beb
Date:   Wed Nov 20 14:43:45 2013 +0100

    avmedia: Implement "block untrusted referer links" feature

commit 836d73a651
Date:   Fri Nov 15 12:30:39 2024 +0000

    consider VndSunStarExpand an exotic protocol

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I2e3f6e025dba2b660e3b69a7c8097e3663e8d1a9
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4548
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit d0663178249d57ee55a505813efc8a9618478a3f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208024
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-13 15:53:30 +02:00
Caolán McNamara d7712feea1 sc: quote the table name in the sql data provider query
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I27a52fe9b3a3d9a9703589b74df259baf2312c46
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6707
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 1d24f1b1937995936011f61b6c1436d821f66faf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208009
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-13 13:56:30 +02:00
Caolán McNamara 0f40910170 chart import: avoid rescanning every style per data point
look up a point's data-label style through a map built once, rather
than searching the whole style vector for each point, which made
importing a chart with very many styled points take minutes.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I6e8ce35e2e6f7248f14d84c3c5a390bcde032929
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6573
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 962197f436444984d8679be269887b92cee8edf4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208006
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-13 13:53:33 +02:00
Caolán McNamara 5176ac54c5 use = not == in test
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ifec7cd6a5158de2e2e1319733cea509a748b486c
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4318
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 6f222d7e143ebf7fddeaf9af3aaf132e6fdec853)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208011
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-13 12:17:53 +02:00
Caolán McNamara 35ddb41dcc crashtesting: clamp string concatenation to each matrix operand's size
Concatenating two matrices of different sizes gives a result the size
of the larger one.

Each operand was read across the whole result. The shorter operand
has fewer cells than the result, so the read ran past the operand's
end and went out of bounds, which crashed. Now each operand is read
only within its own size.

A cell that only the larger operand covers has no partner in the
shorter one to join with, so it stays empty.

a problem since:

commit b4957ed105bcaa4a73666a6a5e119d523284b0c9
Date:   Sat Jun 27 19:26:56 2026 +0900

    sc: extend mismatched-extent matrix arithmetic to the longer side

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I0ae4a0b71a846bb88383cd1cb472a022895ae14a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6696
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 645e103b914f07f80c0c425fb1b3262e5e4f1648)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208007
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-13 11:41:28 +02:00
Caolán McNamara cd489d2a8b crashtesting: leave a result on the stack after running a callable
Interpreting a callable consumes its arguments off the interpreter stack
and must leave exactly one result token behind.

Two paths returned without pushing anything: a lambda whose result was
empty, and a macro whose arguments could not be built.

Each such call left the stack one entry short, so a later token read
past the stack base. That surfaces later as the "underflow" abort in
Interpret, and as the matrix count mismatch in ConvertMatrixParameters.

Push the error, or an empty result, on those two paths.

crash converting forum-en-34250.ods to xlsx:

  #21 ScInterpreter::Interpret at sc/source/core/tool/interpr4.cxx:4328
  #22 ScFormulaCell::InterpretTail at sc/source/core/data/formulacell.cxx:2201
  #24 ScFormulaCell::GetMatrix at sc/source/core/data/formulacell.cxx:3267
  #25 ScInterpreter::ScMatRef at sc/source/core/tool/interpr5.cxx:3764
  #26 ScInterpreter::DispatchOpCode at sc/source/core/tool/interpr4.cxx:4050
  #27 ScInterpreter::Interpret at sc/source/core/tool/interpr4.cxx:4333
  #30 ScFormulaCell::MaybeInterpret at sc/inc/formulacell.hxx:515

the same problem also aborts in ScInterpreter::ConvertMatrixParameters
at sc/source/core/tool/interpr4.cxx:1555.

since:

commit 837cf12bc45c72e08c4629d07a43c27763b263b2
Date:   Sat Jun 20 23:28:17 2026 -0400

    Implemented callables as first-class objects in Calc formulas

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I46a9fa77872ac1c540f9b0904da2e3f9397e71c9
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6153
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit f239eafadbb1c539d0c6dfbb459ca25bc10b7456)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207976
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-12 23:12:03 +02:00
Caolán McNamara ea2543a570 ofz#532839163 Integer-overflow
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Id43a56b3b7b84d490a2e1f083b985f53d3a6dc86
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6576
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 448d75b8ad849458cfe71fa968038b4a3e1177b8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207974
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-12 23:11:23 +02:00
Caolán McNamara 2cdb8ce0ac crashtesting: read a plain cell value when filling a matrix from a reference
PutMatrixValue cloned the referenced cell's formula result token for a
single, double or list reference, but a reference can point at an ordinary
value, string or empty cell, where ScDocument::GetFormulaCell returns null
and cloning its result token dereferences null. Read the plain cell value
into the matrix in that case.

crash finalizing an xlsx import (forum-mso-en4-792534.xlsx):

  #0  ScFormulaCell::NeedsInterpret (this=0x0) at sc/inc/formulacell.hxx:487
  #1  ScFormulaCell::MaybeInterpret (this=0x0) at sc/inc/formulacell.hxx:501
  #2  ScFormulaCell::CloneResultToken (this=0x0) at sc/source/core/data/formulacell.cxx:3236
  #3  ScInterpreter::PutMatrixValue at sc/source/core/tool/interpr5.cxx:1285
  #4  ScInterpreter::ScByRow at sc/source/core/tool/interpr5.cxx:1521
  #5  ScInterpreter::DispatchOpCode (eOp=ocByRow) at sc/source/core/tool/interpr4.cxx:4090
  #6  ScInterpreter::Interpret at sc/source/core/tool/interpr4.cxx:4371
  #11 ScCellFormat::GetString at sc/source/core/tool/cellform.cxx:90
  #19 ScColumn::GetOptimalHeight at sc/source/core/data/column2.cxx:950
  #24 ScDocShell::UpdateAllRowHeights at sc/source/ui/docshell/docsh5.cxx:450
  #25 oox::xls::WorkbookGlobals::finalize at sc/source/filter/oox/workbookhelper.cxx:665

since:

commit e95c50471e6553f04ec814184456c50209a7e970
Date:   Sat Jun 20 23:53:18 2026 -0400

    Implemented functions which rely on callables

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Iadede9c4c75e9d1ee79fe2156d356389827595d6
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6151
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 0abe27b56512e1d524e23f1b759d9647cba85a87)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207975
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-12 17:53:29 +02:00
Caolán McNamara 0500f647f3 crashtesting: fix ScLet/ScLambda crashes on a non-name parameter token
ScLet and ScLambda read the parameter-name token's string without checking
GetType() first, so a token that isn't a string name faults on load, e.g.
forums/xlsx/forum-mso-en4-789942.xlsx:

  #0  rtl::str::acquire (pThis=0x20d) at sal/rtl/strtmpl.hxx:735
  #6  std::vector<OUString>::push_back
  #8  ScInterpreter::ScLet at sc/source/core/tool/interpr1.cxx:10938
  #9  ScInterpreter::DispatchOpCode (eOp=ocLet)
  #13 ScFormulaCell::MaybeInterpret
  #15 ScCellFormat::GetString
  #17 ScColumn::GetRangeScriptType
  #24 GetOptimalHeightsInColumn

ScLet used to have this check until it was rewritten, the new ScLambda
never had it, since:

commit 6ad6aebb83305608788c878909cd77c29b298271
Date:   Sat Jun 20 23:50:39 2026 -0400

    Implemented LAMBDA and ISOMITTED for Calc

use the same fix as:

commit 4f5764a223f86ceea1eca70cbec55eb8aebea1f3
Date:   Tue May 5 11:45:29 2026 +0100

    crashtesting: fix ScLet/ScMatch/IterateParametersIf[s] crashes

Add a GetStringNameToken() helper for this and use it in ScLet, ScLambda
and the dynamic_cast calls in callable.cxx.

see also:

commit 65da502b7b40bd3bcad0cfd146716e815c72d48d
Date:   Thu Apr 16 12:31:01 2026 +0200

    reduce virtual calling in String*Token

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I7ce591bf5e53538aa947fafa9607b7339d715aaa
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6107
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 8b1f9cc417d914d72ea223815e8306bcb07299ec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207977
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-12 17:52:48 +02:00
Caolán McNamara 64050cd789 crashtesting: tolerate annotation ranges that share an end position
Annotation marks bind to their comment field by end position. The field
used is the one at end minus one.

Two .doc range comments that end at the same position then resolve to
the same single SwPostItField, and only one mark can own it.

The first mark applied names the field. A second mark at the same
position cannot get its own field, because AnnotationMark::InitDoc
looks the field up by end position and would only reuse the
first mark's name.

So the second comment trips the assert that the field is still unnamed.
Its range cannot be reconstructed, but the comment still exists in the
text as the postit field. Keep it as a point comment instead of
asserting.

assert added since:

commit 4b4ebb1545
Date:   Wed Aug 30 22:47:09 2017 +0200

    sw: WW8 import: properly handle consecutive range annotations

which fixed ends colliding through MoveAttrs. Here the collapsed end
positions are already in the file, written by our own .doc export of
adjacent ranged comments.

Reproduced with tdf89698-1.docx converted to doc and reloaded (also
tdf132496-1.docx and fdo82922-2.odt), dbgutil build:

soffice.bin: sw/source/filter/basflt/fltshell.cxx:617: virtual void
SwFltControlStack::SetAttrInDoc(const SwPosition&, SwFltStackEntry&):
Assertion `pPostIt->GetName().isEmpty()' failed.

 #21 SwFltControlStack::SetAttrInDoc at sw/source/filter/basflt/fltshell.cxx:617
 #22 SwWW8ReferencedFltEndStack::SetAttrInDoc at sw/source/filter/ww8/ww8par.cxx:1393
 #23 SwFltControlStack::SetAttr at sw/source/filter/basflt/fltshell.cxx:419
 #24 SwWW8ImplReader::DeleteStack at sw/source/filter/ww8/ww8par.cxx:4218
 #25 SwWW8ImplReader::DeleteRefStacks at sw/source/filter/ww8/ww8par.hxx:1458
 #26 SwWW8ImplReader::CoreLoad at sw/source/filter/ww8/ww8par.cxx:5253

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ic0ba214dab656ed1bd121e3151417b92b7675fed
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4725
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit e78633c0161added4c4b57a5fe532e65a7159683)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207947
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-10 15:37:44 +02:00
Caolán McNamara 96691462de crashtesting: re-search lagging columns past nRow in the attr iterator
ScHorizontalAttrIterator only reinitialises when nRow passes the global
nMinNextEnd, so a column can be more than one run behind and a single ++
leaves its run end below nRow, tripping the "Sequence out of order"
assert. Re-search with ScAttrArray::Search instead, as the first row does.

forum-mso-en4-146187.xlsx aborted before this when saved to xls or xlsx.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I3065114f04b976a72ef44634bc981547fff4a87b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4721
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit f48aa0234af8a16aecb20f32c9584226fc928d3f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207396
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-10 01:08:20 +02:00
Caolán McNamara fcfec741ef crashtesting: don't parallelize a conditional sum that grows its range
A three argument SUMIF or AVERAGEIF grows a small sum range to the shape of
the criteria range. It then reads cells that no reference token names.

The parallel-calc dependency scan only follows reference tokens, so it
misses those cells, and a worker hits one uninterpreted and trips the
group-calc assert.

Drop that form, like the nearby ocRange guard. The two argument form
sums the criteria range itself and stays parallel.

  sc/inc/formulacell.hxx:514: void ScFormulaCell::MaybeInterpret():
      Assertion `!rDocument.IsThreadedGroupCalcInProgress()' failed.

seen reloading forum-mso-en4-35616.xlsx saved as xls, M9 is
=IFERROR(SUMIF(B9:E33,B9,L9:L33)/SUM(L9:L33),0): the sum range grows from
L9:L33 to L9:O33 and reads the uninterpreted O9.

Only started asserting once the callables work landed, which doesn't touch
this path, so that seems to have uncovered an older gap.

maybe since:

    commit 837cf12bc45c72e08c4629d07a43c27763b263b2
    Date:   Sat Jun 20 23:28:17 2026 -0400

        Implemented callables as first-class objects in Calc formulas

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I861c7f645a65cd0c7564ccb96bf040e401cd2f08
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6160
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 04ad1ed4ba2c9a78ed260fc4e18249a40137db94)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207824
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-09 11:42:23 +02:00
Caolán McNamara f21dc6f83d ofz: check buffer bounds before reading multi-byte CFF dict operators
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I434749e74e29f0aa3cda76746440af64cc2965dd
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2693
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 7263a6b61264ebf1bdfe01c27e2e6c53bee7687b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207732
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-08 11:20:02 +02:00
Caolán McNamara f62f3a2552 ofz: check for failure here too
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ib48de81390607918e58d200a65b869b18c58e8b1
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3162
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 51fa2756479e99d1fc8d804d50bfd969d582ebdd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207731
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-08 09:04:19 +02:00
Caolán McNamara 99f5d81441 ofz: check buffer bounds before reading offsets in CFF seekIndexData
Same pattern as:

commit 304208502164c07df8eb5a3677cb445ab0965f0e
Date:   Fri May 15 08:38:40 2026 +0100

    ofz#513301090 UNKNOWN READ

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I841619bc2f6eb2cb1a599f8eee2be9a75c68d2ca
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2695
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 7c237925e474326f3c8dea179264b60d835145d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207724
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-07 17:33:00 +02:00
Caolán McNamara 3d487485bd ofz#506472785 Integer-overflow
vcl/source/outdev/ImplMapRes.cxx:115:70: runtime error: signed integer overflow: -9223372036854775808 + -57089 cannot be represented in type 'long long'
    #0 0x592c9880de2d in operator() vcl/source/outdev/ImplMapRes.cxx:115:70
    #1 0x592c9880de2d in ImplMapRes::CalcMapResolution(MapMode const&, long, long) vcl/source/outdev/ImplMapRes.cxx:119:9
    #2 0x592c9819827c in OutputDevice::SetMapMode(MapMode const&) vcl/source/outdev/map.cxx:519:18
    #3 0x592c9830750e in GDIMetaFile::Play(OutputDevice&, unsigned long) vcl/source/gdi/gdimtf.cxx:365:26
    #4 0x592c978beda6 in TestImportSVM vcl/source/filter/svm/SvmConverter.cxx:1281:22

This seems to have appeared since:

commit 64c6a8c44b7730d1f703f260e7359642e8af9288
Date:   Sun Mar 22 15:09:35 2026 +0200

    Fraction->double in MapMode

Clamp the divided value to sal_Int32 range to explicitly restore the
limits that BigInt path incidentally.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I3c8061a72e447e4bdcad07ace3075076d09285be
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1891
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit b1dd07307b7a00e73996975616efa113940fdf37)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207723
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-07 16:00:44 +02:00
Caolán McNamara 7fe12adeec ofz#513301090 UNKNOWN READ
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I8d9dde7634b770cb7642bed42c85b36527921f4b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2653
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit ac65c3fae20b6c207ef8ebb12ab66b5e035c6a03)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207721
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-07 14:33:07 +02:00
Caolán McNamara 49360f34f5 ofz: cff, track the charstring output capacity
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I0bd22e737fb9700108d616a1ba4a69f6bd95691d
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6165
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 0b090eff6ca18e3f2bacc7311b746d2a15ed1247)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207718
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-07 14:29:57 +02:00
Caolán McNamara 073913a2cc ofz#513277199 Integer-overflow
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I8a07f47f382502ab24670a270e8cd23a888f1ba4
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2656
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 6eb214dbe24ac7c1cde3fe8a6ce242f2d7e24151)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207713
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-07 14:29:51 +02:00
Caolán McNamara f4bbd5bb5f upgrade to latest librevenge
drop merged-upstream patches

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I93ae57ad8fefda3650be53d184c7c16e267054b7
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6167
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit c70d101f0fe49b2499060ba0686d8b74cb452977)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207685
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-06 20:58:04 +02:00
Caolán McNamara b5953116c4 ofz: skip checksum check when fuzzing
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I7404322dc9cd8b7e6e4595b3867a6bf42c83b056
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6115
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 5c1fa7bf1ff8c2a28fba70804b41fa02e5c59c82)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207657
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-06 13:56:37 +02:00
Caolán McNamara 1db305f340 ofz: wmf, check record against max allowed size
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I3c0a155bdf0922771694fc500a24eb09ec8abc27
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6116
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 9b412f7cda30a4e1b820e51249fa7b3c36a812d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207658
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-06 13:20:38 +02:00
Caolán McNamara 4406da79b0 ofz: ignore an advance array shorter than the string
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I6ceec1ecbae58a714d2f45eb786e01b428e6d942
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6114
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 6ab602ca281f507f7e637183a49dd514ffb1376b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207656
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-06 13:13:59 +02:00
Caolán McNamara 21124741e0 ofz: pdf, check record againsts max allowed size
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I51a31c1e09d2b5d5a413c5345c40998e032f09d6
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6117
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit e230b10b7cd2d5d8623cdba0877ec68f67003690)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207659
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-06 13:06:56 +02:00
Caolán McNamara dcf16d610a ofz: pdf, clamp stream Length to the bytes actually read
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I155f3eddbd204069084b50f52f7cc6328fb053eb
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6118
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 332e8831e0b0e580dae0d77a0ec27bd267af6b29)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207660
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-06 12:29:35 +02:00
Caolán McNamara 1087430c4c ofz#529419819 keep m_oLastAnchorPos valid while erasing the footnote char
ReplaceCharWithItem's EraseText can delete an earlier footnote's text
section that m_oLastAnchorPos points into, leaving it dangling. Save and
restore it across the erase like the two existing spots do, and fold all
three into a WW8LastAnchorPosSaver guard.

see also:

commit 1de064acc0ef2b7084e31a1e5ba872054e3942e8
Date:   Fri Mar 13 20:55:50 2026 +0000

    crashtesting: SwContentIndexReg::~SwContentIndexReg on reimport of docx->doc

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I46c237cf65b58e99628bd3da69b44c145a4ce80e
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5976
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 09a12e662d33ca33e1e398c9c2a26eaf9405450d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207582
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-03 12:50:23 +02:00
Caolán McNamara 855da692bc crashtesting: unshare formula cells the matrix import overwrites
ScDocumentImport::setMatrixCells places the matrix master and its
reference cells with raw cell-store set() calls. set() destroys the
cell it overwrites with no shared-formula bookkeeping, so a group
whose member dies that way is left with a stale length, or with a
dead top cell that the next Interpret of a surviving member
dereferences (formulacell.cxx:1560).

The xlsx import builds exactly such groups from stacked dynamic
arrays: the empty <f ca="1"/> spill placeholders of adjacent rows
compile to identical empty token arrays, and applyCellFormulas puts
vertical runs of identical formulas into one group. Materialising the
upper row's array then destroys the lower row's group top.

A member surviving its top cell's destruction became reachable since:

commit e4476c8072af0d825578f5222935718a159bb383
Date:   Wed May  6 23:33:16 2026 +0900

    sc: Preserve #SPILL! state through XLSX and ODS import

which keeps the cells of a spill-flagged array's range alive instead
of overwriting them all. Detach the doomed cell from its group before
each set().

Reproduced with forum-mso-en4-756517.xlsx and forum-mso-en4-756511.xlsx
from interop-test-files, soffice --headless --convert-to xlsx, dbgutil
build.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ic347cee8c30b0d93919173a85fdd42cfd8a208e9
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4723
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 2f74f677ce588c1ecbf3370c08a85ef94d49313e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207397
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-29 14:22:18 +02:00
Caolán McNamara bd11de9abf crashtesting: clear the tracked-change flag when dropping...
...the footnote mark buffer

A custom footnote mark is buffered into m_aSuperBuffer, and when the
mark sits inside a tracked insertion the start of the tracked change is
buffered there too.

The footnote path copies the mark text out and then clears
m_aSuperBuffer. So the buffered start is discarded but the states that
buffered into it still had their StartedTrackchange set.

On group close they emitted an end that has no start, and
RemoveTopRedline attempted to pop an empty redline stack.

So clear the flag on those states when the buffer is dropped.

seen loading ooo53739-2.doc converted to rtf and reloaded (also
ooo83985-4.doc), where the footnote sits inside the tracked insertion as

{\revised... {\super b{\*\footnote ...}}}

 #1 writerfilter::dmapper::DomainMapper_Impl::RemoveTopRedline at engine/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:10035
 #2 writerfilter::dmapper::DomainMapper::sprmWithProps at engine/sw/source/writerfilter/dmapper/DomainMapper.cxx:3242
 #3 writerfilter::dmapper::DomainMapper::lcl_sprm at engine/sw/source/writerfilter/dmapper/DomainMapper.cxx:1614
 #4 writerfilter::LoggedProperties::sprm at engine/sw/source/writerfilter/dmapper/LoggedResources.cxx:365
 #5 writerfilter::rtftok::RTFReferenceProperties::resolve at engine/sw/source/writerfilter/rtftok/rtfreferenceproperties.cxx:34
 #6 writerfilter::dmapper::DomainMapper::lcl_props at engine/sw/source/writerfilter/dmapper/DomainMapper.cxx:4970
 #7 writerfilter::LoggedStream::props at engine/sw/source/writerfilter/dmapper/LoggedResources.cxx:244
 #8 writerfilter::rtftok::RTFDocumentImpl::replayBuffer at engine/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:1921
 #9 writerfilter::rtftok::RTFDocumentImpl::popState at engine/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:3899

see also:

commit 013ec10d4e
Date:   Wed Oct 22 22:35:01 2014 +0200

    i#84172 RTF import: handle nested groups inside redlines

Change-Id: I2a7c5f3d3aef328a6e5a663dddc72175066fcafc
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4724
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 69a5dcf79103b16d44bdab56a94242ede0347977)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207398
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-29 13:54:58 +02:00
Caolán McNamara d89e2655f9 crashtesting: reuse a cached glyph subset only where it is safe to concatenate
The glyph layout cache builds the layout for a substring by cutting it out
of the cached whole-string layout and reusing those glyphs without reshaping.
That is only correct at a cluster boundary that HarfBuzz reports as safe to
concatenate.

The previously checked unsafe-to-break flag is a smaller set and does not
cover boundaries where the surrounding text changes the glyphs, for example
which fallback font a run resolves to, so a subset could be cut where a fresh
layout of the substring would differ.

Ask HarfBuzz to produce the unsafe-to-concat flag and guard the subset with
it instead.

seen loading sd-cre-hea-ar-7e49187f4be1eb63.docx

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I8ff201a4af6c1c9e283a87267b47749a8ce717e6
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5516
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 573d06f6ce4b5123ac7b0d55ae3e846c0a07cbf1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207395
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-29 13:52:35 +02:00
Caolán McNamara 997fb96d27 crashtesting: bail if the table of contents section was not inserted
crash on loading sd-leg-tch-nb-e9e5c5efad47c4ae.docx

 #4  SwDoc::SetTOXBaseName (...) at engine/sw/source/core/doc/doctxm.cxx:803
 #5  SwXDocumentIndex::attach (...) at engine/sw/source/core/unocore/unoidx.cxx:1352
 #6  writerfilter::dmapper::DomainMapper_Impl::createSectionForRange (...) at engine/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:7775
 #7  writerfilter::dmapper::DomainMapper_Impl::handleToc (...) at engine/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:7557
 #8  writerfilter::dmapper::DomainMapper_Impl::CloseFieldCommand (...) at engine/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:8717

InsertTableOf returns null when the section cannot be inserted at the
given range, but attach went on to dereference it. createSectionForRange
already catches the exception, so throw instead.

same fix as:

commit 5bc6c7b2e1
Date:   Wed Sep 12 21:51:48 2012 +0200

    fdo#42450: fix crash in SwXTextSection::attach:

Change-Id: Ia97e41017d736cced41b16501763f5fc8b9f89c4
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5488
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit aa92567bb5771e62d27dbefcc24574a9db9c35cf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207329
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-26 11:18:07 +02:00
Caolán McNamara dce3608001 afdko: upgrade to 5.0.1
txNew, txFree and doSingleFileSet are public now, so the extern_tx
patches go away.

The mergeFonts crash fix is merged upstream.

The noverbose patch is replaced by a SAL logger installed through
slogger::getLogger.

A new fatal-callback patch lets fatal errors raise exceptions, which
appSpecificFree used to do.

afdko 5.0 replaces makeotfexe with addfeatures, drops the typecomp
Type 1 to CFF converter, and rewrites most of c/shared in C++.

hotconv now only reads CFF, so makeotf() first converts its Type 1 input
to bare CFF with tx, the same step the upstream makeotf driver script
performs.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I1e5b6ac8413eb66d81034f4f1d0b7f2e46e12233
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4251
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 6c40019917bd6e88f6b54d0a2d53d64729c64166)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207285
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-26 09:17:58 +02:00
Caolán McNamara 14ce8debf9 crashtesting: pdf uri links might not be valid UTF-8
Read the bytes with the tolerant UTF-8 constructor, we can't be sure
that incoming bytes from outside our control are valid UTF-8

Reproduced with ooo61064-2.pdf and ooo61064-3.pdf, dbgutil build:

include/rtl/ustring.hxx:2757: static rtl::OUString
rtl::OUString::fromUtf8(std::string_view): Assertion `bSuccess' failed.

Change-Id: Ib56e27bad46107a1a6c3f569103f2d33dfcbac72
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5199
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 457bdd412c9fd7e2cb1b62e65f6bf5efeedfe4a9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207328
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-26 09:14:11 +02:00
Caolán McNamara 8d0cb8f2e9 remove the write-only second animation sound field
loplugin:unusedfields already lists it as only used in the constructor.
Drop it, and note in its place that the second effect's sound URL really
lives in the shape's bookmark string, not in a sound field of its own.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I6ba402fd6e8052d6533f396d746da735abbf27bd
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4809
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 9d96470a60ad0c783fd3836bfc7f22ea91c5c24a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207282
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-25 15:36:57 +02:00
Caolán McNamara 41f64ccc3f crashtesting: don't create a redundant SwRedlineItr for a merged paragraph
CtorInitAttrIter can build a SwRedlineItr for a merged paragraph in
Mode::Ignore but have no extended-input array.

That combination has nothing useful to do, and the ctor asserts.

An issue probably since:

commit 4fccc66345
Date:   Tue Nov  3 16:40:45 2020 +0100

    sw_fieldmarkhide: SwRedlineItr assumption that Show means no MergedPara

Reproduced on saving ooo121134-1.docx (and ooo121176-1.docx) to odt. The
docx loads fine, but asserts on export to odt when exporting a text
frame forces an on-demand layout.

Skip it, a null m_pRedline is already handled throughout SwAttrIter.

soffice.bin: sw/source/core/text/redlnitr.cxx:858: SwRedlineItr::SwRedlineItr(...):
Assertion `m_pExt || m_eMode != Mode::Ignore' failed.

 #4  SwRedlineItr::SwRedlineItr at sw/source/core/text/redlnitr.cxx:858
 #5  SwAttrIter::CtorInitAttrIter at sw/source/core/text/redlnitr.cxx:817
 #10 SwTextFormatter::CtorInitTextFormatter at sw/source/core/text/itrform2.cxx:97
 #12 SwTextFrame::FormatImpl at sw/source/core/text/frmform.cxx:2092
 #14 SwContentFrame::MakeAll at sw/source/core/layout/calcmove.cxx:1633
 #20 SwLayAction::Action at sw/source/core/layout/layact.cxx:404
 #21 SwViewShell::CalcLayout at sw/source/core/view/viewsh.cxx:1313
 #22 SwEditShell::CalcLayout at sw/source/core/edit/edws.cxx:89
 #23 SwXFrame::getPropertyValue at sw/source/core/unocore/unoframe.cxx:2216
 #25 XMLTextParagraphExport::addTextFrameAttributes at xmloff/source/text/txtparae.cxx:2968
 #32 XMLTextParagraphExport::exportText at xmloff/source/text/txtparae.cxx:1746
 #34 SwXMLExport::ExportContent_ at sw/source/filter/xml/xmlexp.cxx:552
 #36 SvXMLExport::exportDoc at xmloff/source/core/xmlexp.cxx:1440
 #44 SwXMLWriter::Write at sw/source/filter/xml/wrtxml.cxx:479
 #46 SwDocShell::SaveAs at sw/source/uibase/app/docsh.cxx:544
 #53 SfxBaseModel::storeToURL at sfx2/source/doc/sfxbasemodel.cxx:1829
 #54 desktop::DispatchWatcher::executeDispatchRequests at desktop/source/app/dispatchwatcher.cxx:714

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ia290785e8a60c5b8b972e51d490b0cdf0b730111
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4726
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 602a72cb5aa116b244d1a499c156d9321c7b1e58)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207159
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-23 09:40:09 +02:00
Caolán McNamara 0adbe1f614 ofz#525950860 Direct-leak of header/footer item given to SetFormatAttr
a problem since:

commit b8af8f046a098c67d7caf44dc70d1db5cabf24e2
Date:   Wed May 27 16:02:27 2026 +0200

    Support of page styles without header/footer on first page

Change-Id: I8291aab234c02ff492f6874387d6c38cee80d8af
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4927
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 86dccc7838c627460f265ea75914808b33b944f7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207109
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-22 16:03:49 +02:00
Caolán McNamara 01726140ea Release import-side shape data after each slide is imported
After createXShapes pushes shapes into the core model, the oox-side
shape tree and shape map are no longer needed. Clear them immediately
so memory from one slide is freed before the next is imported.

Save the title text from the shape map before clearing so that
importSlideNames can still set slide names from titles.

Reduces peak memory during PPTX import by around 58% for a huge
slide deck.

Change-Id: I078d4af1aec4a7d19f29658bd3edbb393cf99570
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/963
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 8114fa350fcaa0bb7a148935d3d2124516524d94)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207075
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-06-21 22:25:23 +02:00
Caolán McNamara 42cfdea1b5 remove optimize svx::ThemeColorsPaneBase::initColorSets cost
19.17% of

https://github.com/CollaboraOnline/online/issues/15054#issuecomment-4213614352

this is fired too often, make the broadcast/listen more direct and avoid
the spurious wakeup on generic invalidate-all that it can't filter out.

Change-Id: I9476591a5feefa5e47de5f8098eaa152fc8b10ac
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/870
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 92ae69bd1c8a8bc7f8fafc2dddec000182c6fb6d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207074
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-06-21 22:16:28 +02:00
Caolán McNamara afc4a48212 more langtag length limits
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie6a84f836be42e4edc16871d8d4dd12a99046d38
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1592
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit cca41c7cfbfb77777fe8a58be53f6f2ba84638ab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207068
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-06-21 20:30:25 +02:00
Caolán McNamara 6e0dd5492d ofz#523506442 Integer-overflow
Track the running scale as the actions are read, and drop one that would
push it past a usable range.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I9e4ec76f04cb9946035d3c6ef210491c969993bb
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4463
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit d91893fdc322d3e0a79d29f2ee4fe0296ce24ea0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206678
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-16 20:34:53 +02:00
Caolán McNamara 4ba5567cc4 match the package content provider when checking a vnd.sun.star.pkg url
IsExoticProtocol used GetHost() to recover the nested package url of a
vnd.sun.star.pkg url, but the package content provider in
ucb/source/ucp/package/pkguri.cxx uses the whole authority between "://"
and the next '/', which GetHost() truncates at '@'. Check the same
substring the provider does.

The vnd.sun.star.zip branch below already did the equivalent extraction,
so pull the shared parts into a helper that both branches call.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I27be6a839108f2e58d62baefc1a71dcbfc9a4568
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4410
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit ce436efb34d2e0e90ee2cdb450da285530c562f7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206681
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-16 16:14:58 +02:00
Caolán McNamara b601b4304e crashtesting: defer dynamic-array resize during the CalcAll walk
ScTable::CalcAll interprets every formula cell in each column's cell
store. Interpreting a dynamic-array master whose result size changed
runs ResizeMatrixFormula, which deletes or inserts reference cells in
the columns being walked and frees the block the iterator sits on.

Take a MatrixResizeGuard around the whole per-table walk so any such
resize is queued and drained once, after every column. At the table
level this covers both callers, ScDocument::CalcAll and the direct
FetchTable(n)->CalcAll() in the xlsx exporter, and the per-table drain
makes the trailing ProcessPendingMatrixResizes in ScDocument::CalcAll
dead, so drop it.

forum-mso-en4-776376.xlsx aborted before this under DoHardRecalc when
saved to xlsx or ods, and converts cleanly with this.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I54cd8ce944d791339a0f2feec02bea5bb87d9312
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4216
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 630cd3a5e5a7280cc19f80b51751de8afda2afe9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206659
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-16 10:38:45 +02:00
Caolán McNamara 4ffb30e976 ofz#523165456 Timeout
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Icf8d2fe0208a076251c791e713d8a859e2c8eaca
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4408
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit fb90356fc40c859f5cb7e6c03b4c828351862c7d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206615
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-16 09:18:32 +02:00
Caolán McNamara 716cae1cd4 remove dead AddAllUnknownWords/FN_ADD_UNKNOWN slot
there is no implementation of this

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ibc3f36c6133b10e59a0826d20e6991fd9d27ded0
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3248
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 9c729eb552208f8024d9711cc8eaa3bc4f5391a5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206652
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-16 09:12:11 +02:00
Caolán McNamara 92b5ede0df the custom pivot point widget should take focus
Change-Id: I1b26dcf8fe836e3a45752789033b4decbc806671
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/989
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Parth Raiyani <parth.raiyani@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit ba0aa2cb2294ddd57d4eeca4356122935d23706f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206666
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-06-16 08:29:37 +02:00
Caolán McNamara 0ae4789b37 use the more efficient RangeIterator to skip hidden rows
SfxBindings::NextJob_Impl
     SfxBindings::Update_Impl
       SfxDispatcher::FillState_
         ScCellShell::GetState
           ScTabViewShell::GetFunction
             ScDocument::GetSelectionFunction
               ScTable::UpdateSelectionFunction
                 ScColumn::UpdateSelectionFunction  (4,067 samples, 4.62%)

from:

https: //github.com/caolanm/profiles/blob/co-25.04/watchdog/Share-2026-04-15T08%3A15%3A18.958372.svg
Change-Id: I4bb965d3abc0077c966e974c4894579cb777cfb6
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/987
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit fb3166336e203bb423942b9001440aa4c1f08e66)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206668
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-06-16 07:50:44 +02:00
Caolán McNamara 36b3eb054b add a recursion depth to ReadRegionNode
Change-Id: I6e17304405af5e6260ebe9c78ff344101a7c0060
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/762
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 4cebc4ad8b977959430829223b10309df8601d1c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206667
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-06-16 07:50:11 +02:00
Caolán McNamara 64b1bf3a65 sd: stop refreshing SlideTransitionPane on every shape change
SlideTransitionPane's EventMultiplexerListener default branch called
onSelectionChanged + onChangeCurrentPage on every non-Disposing event,
including ShapeChanged.

ShapeChanged fires for every text edit on any view, so with several
users editing the panel re-emitted its full notebookbar state hundreds
of times to every view, although the page-level transition properties
had not changed.

Sync SlideTransitionPane with CustomAnimationPane so SlideTransitionPane
handles only the same explicit cases. And use the same sort of setup
as that panel does, e.g. take the controller from the ViewShellBase directly like:

commit ec58f5e318
Date:   Thu Dec 16 09:12:41 2004 +0000

    2004/12/10 10:11:53 af 1.2.10.1: #i38630# Using the right controller after views have changed.

Transitions panel update sent on every shape edit since:

commit c4e0d6596d
Date:   Thu Jun 2 15:43:45 2016 +0200

    notebookbar: added slide transition tab

To reproduce: open the Slide Transition sidebar in Impress, click into
a text frame and type. updateControls() fires twice per keystroke via
the ShapeChanged -> default path. With this change it only fires on
actual slide selection changes.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I12a44e17e982f0502fe8fbf6b61f41cb3ac26e07
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3236
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit 9a49d09e20b0687b30c9603d427ae2bd87d20638)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206639
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-16 01:20:16 +02:00
Caolán McNamara 4b3f1395d3 oss-fuzz: enable libc++ fast hardening
so an out-of-range operator[] aborts instead of reading adjacent live
memory that the address sanitizer's redzones don't catch.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I4af111c97251a3e55f836b7eff2d80b3eb3f4c96
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4438
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 995bf715d44a2e6483719cf446936dd6ae82f36c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206637
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-15 23:01:23 +02:00
Caolán McNamara e663f8baed translate only file URLs
Change-Id: I41076b8af670d673bf29b14c02db0c66744feb0b
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4409
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 478eb7de0d14a05e6501bd44851f73ec0df5c59a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206635
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-15 22:45:57 +02:00
Caolán McNamara 0e42d404ec ofz#501319523 Timeout
GetEndEllipsisString removed one character at a time. Some fuzz document
cases have thousands of extra characters, so do a smarter binary search
effort instead.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5df5d029f1a2ca894adaafc6d16e7f08c425a7f4
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3573
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 15c4f6a44d60eab4c82197ae2565ed59a50d62e0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206616
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-15 22:36:30 +02:00
Caolán McNamara a0bb721247 crashtesting: rtf export wrote footnote table rows outside the footnote
Footnote text is buffered into m_aSectionHeaders while
m_bBufferSectionHeaders is set, but EndParagraphProperties and the
depth-1 StartTableRow wrote straight to the output stream, so a table
in a footnote shed its row definitions and intbl/itap paragraph marks
outside the buffered footnote group. Route both writes through the
buffer.

Not a regression, co-25.04 writes the same. Reproduced with
File_1333.docx (the cloudon set) converted to rtf and reloaded, where
the import rejects our own output with the io::WrongFormatException
"mismatch between \itap and number of \nestrow" of

 #1 writerfilter::rtftok::RTFDocumentImpl::dispatchSymbol at sw/source/writerfilter/rtftok/rtfdispatchsymbol.cxx:305
 #2 writerfilter::rtftok::RTFTokenizer::dispatchKeyword at sw/source/writerfilter/rtftok/rtftokenizer.cxx:2195
 #3 writerfilter::rtftok::RTFTokenizer::resolveKeyword at sw/source/writerfilter/rtftok/rtftokenizer.cxx:2145
 #4 writerfilter::rtftok::RTFTokenizer::resolveParse at sw/source/writerfilter/rtftok/rtftokenizer.cxx:2023
 #5 writerfilter::rtftok::RTFDocumentImpl::resolve at sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:920

and on the crashtesting box as part of the loadComponentFromURL
AbortOnLoadFailure cluster.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I71a46c396f52f3a3d38bb84c778bd1eef871e3c8
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4449
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit c5a540fde6c993c9aa527ffbc2e9a1700808f9c8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206634
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-15 22:36:19 +02:00
Caolán McNamara cfa0fd5a76 keep the WW8 autotext entry index within the sttbfglsy tables
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Id748a8eb55244e44c58e2645668f9ba78f276099
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4435
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 8c571be687e642566e0a46c45358194e9198c45d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206633
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-15 22:36:02 +02:00
Caolán McNamara 6bc93227e7 limit palette index
use the same SanitizePaletteIndex guard ipsd and iras already have.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Iff3450ab2c3781c5181b3f28ed2a321d1e49c6ae
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4425
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit ada76821319b80671dba9908aeea8cabba5cedc0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206612
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-15 22:35:38 +02:00
Caolán McNamara 4510754aa3 Get notes page via flat list instead of forcing page list rebuild
this is a typical way to get the notes page anyway

Change-Id: I1f5d0195980e1a0e5e7b1531f95ee3891ba5d8f4
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/961
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit b803327d156c4c799a176e3ce62e774d3c381d6f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206608
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-06-15 21:15:19 +02:00
Caolán McNamara 99a9627474 don't fill the ScPatternAttr format caches during threaded calc
As seen with CppunitTest_sc_statistical_functions_test
reported at https://gerrit.libreoffice.org/c/core/+/189023

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5ec84a02b308cf7189b1a26a4e1415a7c8dd8e50
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4248
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 96cdd385759f3c19c2a61c0dee9d551c2a4784b7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206614
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-15 18:12:20 +02:00
Caolán McNamara d69b6bb243 limit the column index in the WK3 row attribute import
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I577c3bc2da2e0589015f682a207459341131fbc8
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4429
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 5b1f87ab6b93518c266434711a9e5c00baceac2c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206613
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-15 16:39:37 +02:00
Caolán McNamara 582c2ace3f crashtesting: skip the deferred-break paragraph split in headers and footers
The split (finishParagraph plus lcl_startParagraphGroup) pushes a
CONTEXT_PARAGRAPH with no matching pop, tripping the stack-balance
assert at the end of DomainMapper_Impl::substream(). A header or footer
cannot break pages or columns, so skip the split there.

Reproduced with tdf89392-1.odt converted to docx and reloaded, dbgutil
build:

soffice.bin: sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:10370:
void writerfilter::dmapper::DomainMapper_Impl::substream(Id, const
writerfilter::Reference<writerfilter::Stream>::Pointer_t&): Assertion
`m_aContextStack.size() == contextSize' failed.

 #21 writerfilter::dmapper::DomainMapper_Impl::substream at sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:10370
 #22 writerfilter::dmapper::DomainMapper::lcl_substream at sw/source/writerfilter/dmapper/DomainMapper.cxx:5012
 #23 writerfilter::LoggedStream::substream at sw/source/writerfilter/dmapper/LoggedResources.cxx:272
 #24 writerfilter::ooxml::OOXMLDocument::resolveFastSubStreamWithId at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:132
 #25 writerfilter::ooxml::OOXMLDocument::resolveHeader at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:398
 #26 writerfilter::ooxml::OOXMLFastContextHandler::resolveHeader at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:897
 #27 writerfilter::ooxml::OOXMLHeaderHandler::finalize at sw/source/writerfilter/ooxml/Handler.cxx:214

Change-Id: I45f10d3d990bbf13614299e87d27dd88dcf9e0a3
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4243
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 671b1b51f26fbb8630d1f0022a6d2771bba938db)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206354
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-13 02:03:18 +02:00
Caolán McNamara 23ea1663b7 put calc background images under link control
Change-Id: I5adbbaf7e4860732dad2375dcbee541198ef6fab
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2393
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 6ebc3fb5db211b6c9de96dcf3ba14b6b7f37c203)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206342
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-11 21:42:21 +02:00
Caolán McNamara dfc1b53266 put impress/draw background images under link control
Change-Id: Id1355ed3346e2c2123a2b35f16bd9cabf21d451f
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2391
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit bdb5efeea50d3d7aeb1b50bc5b7e00b5a89c17d9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206341
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-11 10:45:37 +02:00
Caolán McNamara 579f8080ed sfx2: move doctemplateslocal.hxx to the shared source/inc dir
This removes the last ".." include and the build-directory-dependent
dependency path it produced.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I2c46b6104f581f8f30df4b7d67f4c0532bb2f097
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3993
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 0c8bd5df341d2a54acd3b52f414e850996a54e5a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206245
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-09 15:43:37 +02:00
Caolán McNamara 51ec108a45 sw: include core headers canonically in the ww8 filter
matching how the rest of sw includes them, so relative dependency paths
work properly

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I7ed3d2aad4fa85761ce3eb673efdd5a8ef3ebff6
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3991
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit eebe7a1f4ed2eaa94ce946f1382c207f00bf8d11)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206233
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-09 09:52:23 +02:00
Caolán McNamara f5c0446b86 ofz#518578175 Null-dereference READ
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I3d959f515fe6af816bb5c309495093dfd66a5416
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4004
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 61d89c1c37610aa3116429b13bd8d8ba3ddb4774)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206221
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-09 09:51:57 +02:00
Caolán McNamara 098d0fd1c3 skia: make SK_USER_CONFIG_HEADER relative so ccache can share it
In from-scratch engine builds of two git worktrees the cacheable hit
rate rose from 91.8% to 99.3%.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I4857aad79d0aaaff403e88fd72f8d5eae6b55d2a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3983
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit bd18bc96a30d3af3041590944426691258a8fbc5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206219
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-08 20:33:20 +02:00
Caolán McNamara e074f782b3 backport raptor fixes that are merged upstream but unreleased
These three changes are on raptor master but not in any release

raptor_ntriples.c: inspect the last character of a blank node id only
when the id length is greater than zero (upstream ece2c79d, github issue
70).

raptor_rfc2396.c: return an empty path when normalisation reduces the
remaining length to zero (upstream da7a7997, github issue 70).

raptor_term.c: guard the language copy loop with language_len (github
issue 83 / pull request 84)

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I70d9f5d5489628775a7e8a3b0dbe448ef285465b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3990
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit f34d6fa958a84638060f648abbecbca0b290d63e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206206
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-08 13:37:09 +02:00
Caolán McNamara 1ccb64c3c6 ofz#491538002 Timeout
Stop opening further inline attributes past a shallow depth while
fuzzing, matching the existing bFuzzing guards in this filter.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I34654564a9c0b624699a084902dc92f6326ca3a5
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4005
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 46cd26fcee40e19cb0deb3289154dea0ec7a2ec4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206198
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-08 11:43:59 +02:00
Caolán McNamara f905cb46ad libnumbertext: invoke configure like the other externals
Every other external prefixes ./configure with just gb_RUN_CONFIGURE.
libnumbertext alone put $(SHELL) in front of it, which is unnecessary

Change-Id: I32f705434a2913d3f133fd457a2b75ed6520c7c7
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4008
(cherry picked from commit 975ffa76b66e700f135e614c69e9a2790a0b883f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206197
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-08 11:43:33 +02:00
Caolán McNamara 761f114b87 chart2: include ChartModel.hxx without the leading ../
so an incremental rebuild can fail to resolve it with relative dependency paths

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I796d1ed4fb0c56b71691a43eea6d7f49d5a4ad9f
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3989
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit f0bc3a68a2570eb3219371eef3dcd2a35c6d2570)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206199
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-08 11:30:48 +02:00
Caolán McNamara 24dd7cf9eb ofz#494504031 Timeout
long field expansion inside an as-char text box

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5b706839d608062c3324361f96e29a76acf156de
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3570
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 311f7773d4b58afaa10cefb385cae669164ff654)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206189
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-07 22:49:19 +02:00
Caolán McNamara ac972aa3bc optimize GetBackColor by iterating over pattern ranges
instead of row by row. Same sort of thing that GetUnprotectedCells
and similar does.

Change-Id: Ie49c67759695bb683b5679194a6e3810432e7b4b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2362
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 6c176f61de242b621903b8179ce29aea7b5fb339)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206168
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-05 19:29:50 +02:00
Caolán McNamara 6070630ccb cool#15054 use the same cache strategy as CairoCommon does
which allows independent-axis scaling, so we cache
closer to what we need.

10000x5000 images

 Dest          Before              After
510x287  1080x200 (216K px)  540x287 (155K px)
179x100  1080x200 (216K px)  270x100 (27K px)
132x74   1080x200 (216K px)  136x100 (14K px)

1080x200 background

 Dest          Before              After
477x460  1250x626 (781K px)  626x626 (392K px)
385x351  1250x626 (781K px)  626x626 (392K px)
331x320  1250x626 (781K px)  626x626 (392K px)
267x243  626x314 (197K px)   314x314 (99K px)

Change-Id: I8a72a45ea22f9f1343ed1a280416e85434788a6d
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1068
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-by: Armin Le Grand <armin.legrand@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 024f2c8e04156e7633dbc6a46edf0ceed0e3e420)
(cherry picked from commit 043dceb6590cb094425b37462f2b3b788d172de7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205985
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-04 19:04:59 +02:00
Caolán McNamara 0cd4b7b13a crashtesting: assert on converting forum-mso-en4-588737.xlsx
to xls at least an assert of:

sc/source/core/tool/compiler.cxx:4693: bool ScCompiler::NextNewToken(bool):
Assertion `pArr->GetCodeError() != FormulaError::NONE' failed.

formula is:

INDIRECT("'WHS'!"&"$"&CHAR(CODE(LEFT(AM28,1)))&"$2:$"&CHAR(CODE(LEFT(AM28,1)))&"$6")

CODE("") returns 0, and CHAR(0) inserts a literal null character into the resulting reference string

Triggered at export time since:

commit c6bcd2f7c467b944765b363e9a900eaa6625ff6f
Date:   Fri Mar 6 19:29:29 2026 +0530

    XLSX: Skip export of Data Validations with invalid formulas

which I think is blameless though

Change-Id: I28dd96e9107631d05b9e16ac7247dbc44309f3aa
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1595
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e7810e8e2d2216afda181768744ea15ff42046cb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205955
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-03 21:57:18 +02:00
Caolán McNamara 901b959505 crashtesting: deduplicate maTableNodes to avoid duplicate auto-styles in ODF
Six docx-to-odt files in crashtesting assert in
XMLTextParagraphExport::RecordNodeIndex since:

commit 801debfc36
Date:   Mon Jun 16 12:37:30 2025 +0500

    tdf#167033: allow double processing of Writer shapes' text frame nodes

    It turns out, that these are naturally processed twice.

with callstack of:

collectAutoStyles -> exportTable ->
CollectTableLinesAutoStyles -> exportText (cell) ->
exportTextContentEnumeration -> RecordNodeIndex.

fdo74357-1.docx
tdf119800-1.docx
forum-mso-en-18694.docx
forum-mso-de-60423.docx
forum-mso-de-139649.docx
forum-mso-en4-152181.docx

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I0de1d36ae275dc2ccfe36f57fbf4324cce77a6e2
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3135
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 43f4db8327999c085768abc199b41ddb0c94be3f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205960
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-03 21:19:17 +02:00
Caolán McNamara b25618a9b0 ofz#515065180 Integer-overflow
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ic19148985d4f8929ab815ddeb8dee757ff806cfa
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3165
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 8722cc0ab4386805a1ca5afd6ae999976a105bc5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205961
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-03 20:52:33 +02:00
Caolán McNamara 9bdfe90546 crashtesting: fix FormulaCompiler::Factor crashes
crash on loading bugtrackers/xls/ooo25114-1.xls (etc)

 #0  0x00007f118813ea61 in rtl::OUString::equalsAsciiL (this=<optimized out>,
     asciiStr=0x7f118814e760 "com.sun.star.sheet.addin.Analysis.getRandbetween",
     asciiStrLength=48) at engine/include/rtl/ustring.hxx:1255
 #1  0x00007f118813ff1a in rtl::operator==<char const [49]> (rString=<optimized out>,
     literal=...) at engine/include/rtl/ustring.hxx:2130
 #2  0x00007f118813c2a8 in formula::FormulaCompiler::Factor (this=0x7f11697fbe10)
     at engine/formula/source/core/api/FormulaCompiler.cxx:1743
 #3  0x00007f118813d274 in formula::FormulaCompiler::CompileTokenArray (this=0x7f11697fbe10)
     at engine/formula/source/core/api/FormulaCompiler.cxx:2429
 #4  0x00007f450a8dfe4a in ScFormulaCell::ScFormulaCell (this=0x7f4504e5a260, ...)
     at engine/sc/source/core/data/formulacell.cxx:701
 #5  0x00007f451675c6fe in ImportExcel::Formula (this=0x7f4504444ef0, ...)
     at engine/sc/source/filter/excel/excform.cxx:150

since:

commit f59c512a885ae4264ba9f7b8fe4d7b9574a2a0dc
Date:   Mon Apr 13 15:36:11 2026 +0200

    reduce FormulaExternalToken virtual calls

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I1d578b329d120fb55f3ad47ea5d1acdfed6a5cdc
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2010
(cherry picked from commit 796aee17c6a78ac725eaa35270add93335412559)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205959
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-03 20:33:00 +02:00
Caolán McNamara 5cfccf9342 cid#561141 INVALIDATE_ITERATOR
and

cid#561142 INVALIDATE_ITERATOR

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I4f7fa8862ad02b8cf3b9a2cad525b85330776e87
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2594
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit e42f118c1d6b14f0c586cdae16eec5868f616565)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205957
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-03 20:17:35 +02:00
Caolán McNamara 5a49b5c33f crashtesting: fix ScLet/ScMatch/IterateParametersIf[s] crashes
crash on loading forums/xlsx/forum-mso-en4-792041.xlsx (etc)

 #0  0x00007ffff7f401a3 in rtl::str::acquire<_rtl_uString> (pThis=0x20d) at engine/sal/rtl/strtmpl.hxx:735
 #1  0x00007ffff7f48a67 in rtl::str::assign<_rtl_uString> (ppThis=0x7fffffff7db0, pStr=0x20d)
     at engine/sal/rtl/strtmpl.hxx:869
 #2  0x00007ffff7f433d6 in rtl_uString_assign (ppThis=0x7fffffff7db0, pStr=0x20d) at engine/sal/rtl/ustring.cxx:1169
 #3  0x00007fff9a0fdd86 in rtl::OUString::operator= (this=0x7fffffff7db0, str=<error reading variable: Cannot access memory at address 0x211>)
     at engine/include/rtl/ustring.hxx:579
 #4  0x00007fff9aafc478 in ScInterpreter::ScLet (this=0x1da98b0) at engine/sc/source/core/tool/interpr1.cxx:9985
 #5  0x00007fff9ab85ef3 in ScInterpreter::Interpret (this=0x1da98b0) at engine/sc/source/core/tool/interpr4.cxx:4158
 #6  0x00007fff9a709f42 in ScFormulaCell::InterpretTail (this=0x1cd79c0, rContext=..., eTailParam=ScFormulaCell::SCITP_NORMAL)
     at engine/sc/source/core/data/formulacell.cxx:1997
 #7  0x00007fff9a708a20 in ScFormulaCell::Interpret (this=0x1cd79c0, nStartOffset=-1, nEndOffset=-1)

since:

commit 65da502b7b40bd3bcad0cfd146716e815c72d48d
Date:   Thu Apr 16 12:31:01 2026 +0200

    reduce virtual calling in String*Token

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I2fce7f6d4fdb8ee3c72267a455b87aeae1f682a4
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2008
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 4f5764a223f86ceea1eca70cbec55eb8aebea1f3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205958
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-03 20:17:22 +02:00
Caolán McNamara 2961de8d41 ofz#517243149 Integer-overflow
reject non-Valid() rects

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I05f5ba73f0555d6b7dbf40c5e6dc20d876a7784a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3569
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 68b069d5c5d4a9276bf6d0b79c360002422365d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205870
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-01 16:01:04 +02:00
Caolán McNamara dbe1604818 ofz#518230883 Integer-overflow
page margins shouldn't negative, so clamp them to >= 0 on import.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Idbc180c1e7d710f9b655a188d41a1c573c28fb14
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3568
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e79cf4ad2adc9ed5bafdec2c23630471cb789e19)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205869
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-01 16:00:54 +02:00
Caolán McNamara ecaf7f7e00 crashtesting: defer dynamic-array resize while measuring optimal row height
ResizeMatrixFormula deletes cells from the column GetRangeScriptType is
walking, so the next ++ trips over the freed CellTextAttr block.
e.g. with forum-mso-de-138252.xlsx

 #23 ScColumn::GetRangeScriptType(mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<sc::CellTextAttrTraits>::iterator_trait>&, int, int, mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::iterator_trait> const&) (this=0x7f1fa944e780, itPos=..., nRow1=nRow1@entry=0, nRow2=nRow2@entry=0, itrCells_=...) at sc/source/core/data/column2.cxx:2352
 #24 0x00007f1fc068c95c in (anonymous namespace)::FindEditCellsHandler::operator()(size_t, ScFormulaCell const*) (this=this@entry=0x7f1fae5fcdc0, nRow=nRow@entry=0, p=0x7f1fb445d1d0) at sc/source/core/data/column.cxx:2987
 #25 0x00007f1fc068f24e in sc::CheckElem<mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>, mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>, (anonymous namespace)::FindEditCellsHandler>(mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits> const&, mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::const_iterator const&, size_t, size_t, (anonymous namespace)::FindEditCellsHandler&) (rStore=..., it=..., nOffset=nOffset@entry=0, nDataSize=nDataSize@entry=13, rFuncElem=...) at sc/inc/mtvfunctions.hxx:159
 #26 0x00007f1fc0692a0d in sc::FindElement2<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>, (anonymous namespace)::FindEditCellsHandler, (anonymous namespace)::FindEditCellsHandler>(mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits> const&, mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::size_type, mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::size_type, (anonymous namespace)::FindEditCellsHandler&, (anonymous namespace)::FindEditCellsHandler&) (rStore=..., nStart=nStart@entry=0, nEnd=nEnd@entry=12, rFuncElem=..., rFuncElse=...) at sc/inc/mtvfunctions.hxx:506
 #27 0x00007f1fc0692c64 in sc::FindFormulaEditText<(anonymous namespace)::FindEditCellsHandler>(sc::CellStoreType const&, SCROW, SCROW, (anonymous namespace)::FindEditCellsHandler&) (rStore=..., nRow1=nRow1@entry=0, nRow2=nRow2@entry=12, rFunc=...) at sc/inc/mtvcellfunc.hxx:140
 #28 0x00007f1fc0692ce1 in ScColumn::HasEditCells(int, int, int&) (this=this@entry=0x7f1fa944e780, nStartRow=0, nEndRow=12, rFirst=@0x7f1fae5fd074: 0) at sc/source/core/data/column.cxx:3333
 #29 0x00007f1fc06dabdd in ScColumn::GetOptimalHeight(sc::RowHeightContext&, int, int, unsigned short, int) (this=0x7f1fa944e780, rCxt=..., nStartRow=nStartRow@entry=0, nEndRow=nEndRow@entry=12, nMinHeight=nMinHeight@entry=0, nMinStart=nMinStart@entry=0) at sc/source/core/data/column2.cxx:949
 #30 0x00007f1fc0988ed0 in (anonymous namespace)::GetOptimalHeightsInColumn(sc::RowHeightContext&, ScColContainer&, SCROW, SCROW, ScProgress*, sal_uLong) (rCxt=..., rCol=..., nStartRow=nStartRow@entry=0, nEndRow=nEndRow@entry=12, pProgress=pProgress@entry=0x0, nProgressStart=nProgressStart@entry=0) at sc/source/core/data/table1.cxx:99
 #31 0x00007f1fc0989546 in ScTable::SetOptimalHeight(sc::RowHeightContext&, int, int, bool, ScProgress*, unsigned long) (this=0x7f1fb41403e0, rCxt=..., nStartRow=nStartRow@entry=0, nEndRow=12, bApi=bApi@entry=true, pOuterProgress=pOuterProgress@entry=0x7f1fae5fd5a0, nProgressStart=0) at sc/source/core/data/table1.cxx:508
 #32 0x00007f1fc075673d in ScDocRowHeightUpdater::updateAll(bool) (this=this@entry=0x7f1fae5fd7c0, bOnlyUsedRows=bOnlyUsedRows@entry=true) at sc/source/core/data/dociter.cxx:1701
 #33 0x00007f1fc07578ba in ScDocRowHeightUpdater::update(bool) (this=this@entry=0x7f1fae5fd7c0, bOnlyUsedRows=bOnlyUsedRows@entry=true) at sc/source/core/data/dociter.cxx:1629
 #34 0x00007f1fc0ed918e in ScDocShell::UpdateAllRowHeights(bool) (this=0x7f1fb4efb680, bOnlyUsedRows=bOnlyUsedRows@entry=true) at sc/source/ui/docshell/docsh5.cxx:450
 #35 0x00007f1fafae2cde in oox::xls::WorkbookGlobals::finalize() (this=this@entry=0x7f1fb445f9c0) at sc/source/filter/oox/workbookhelper.cxx:664

Wrap with MatrixResizeGuard to avoid this.

An issue apparently since:

commit 76b6825e4d237869cb32889b250277be693a2c5f
Date:   Sat Apr 25 08:29:48 2026 +0900

    sc: Auto-expand and contract dynamic array formulas

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I7ed5938cb1ad8d0f106e0f3c26d5f53f49255317
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3572
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 2a02ee1dcc573d56644b7ff6ead3629fcb23d402)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205868
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-01 15:08:07 +02:00
Caolán McNamara 50391b654f ofz#516218705 Bad-cast
Direct call to GetSingleRef became a cast to ScSingleRefToken since:

commit 003c0007c13e443fe4e520d1b70586266abf7811
Date:   Mon Apr 20 15:36:43 2026 +0200

    reduce Sc*Ref*Token virtual calls

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Icc95da1907ae1aed2688598d95eadf950cb62bbc
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3443
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 97c5c0e1f47236f8d604cfe0c31c2dbb5341663c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205836
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-29 15:12:58 +02:00
Caolán McNamara de69d69e73 add an a11y desc to this bare combobox
Change-Id: Iebb52bab1fdcc01a65aefd737b7f5f19d910917d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199611
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200127
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 7984094dc0c9d62b1382deecb75fd0a52b1c3331)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205818
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 20:07:46 +02:00
Caolán McNamara 3a3dccc8bd a11y: add accessible name for GtkLevelBar in sc's protectsheetdlg ui
similar to how it was added in the more common cui password ui

commit 82a88dcd4a1f95ed4f46167eefb403dbe86fc8d4
Date:   Tue Feb 10 12:56:34 2026 +0530

    a11y: add accessible name for GtkLevelBar in password ui

Change-Id: I09d53497569cd5225282426921f2a161c538adde
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199535
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200126
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 7a57efd85c7dd4d068e8a84633efaf0df9632a1b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205817
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-28 20:07:39 +02:00
Caolán McNamara 6838c26d54 add 'Sheet Name' to GtkEntry
Change-Id: I0b4b5f91d4a7cf1e0ef2f2ae704d01f4dfc791f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199533
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Parth Raiyani <parth.raiyani@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200125
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 094ae4f51e4aba37efbb0799b015bb571ce39743)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205816
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-28 20:07:33 +02:00
Caolán McNamara 74f490bf1c pdf import: use extra kerning to get text to fill supplied textbox
and reconcile our view of the inked area with the pdf[ium] view of
it

Change-Id: Ie6dafb135369836e5f0f61d687e0ec681b592dcf
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1146
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 7c10724b3fa3ba73c2dbddf567d8b605e079b265)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205762
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 15:32:50 +02:00
Caolán McNamara 6839b94df9 give all comboboxes/spinbuttons in sidebars labels
For all the ones that can appear in calc:

Put the label above the combobox and move the accessible-name (or reuse
tooltip if not present) to be the label text.

Change-Id: I8a98417c0cff56183759ec2879de33c26ed10ad1
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1192
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit b11db25cf67ecae68235a3eba2dde32588a07567)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205634
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-25 11:55:55 +02:00
Caolán McNamara 0e08ca725c ofz#516218705 Bad-cast
ScExternalSingleRefToken cast to its sibling ScExternalDoubleRefToken
to call GetTableName. The fields line up so the right string came back,
but UBSan flags the vptr mismatch.

Direct call to GetString became a cast to ScExternalDoubleRefToken since:

commit 65da502b7b40bd3bcad0cfd146716e815c72d48d
Date:   Thu Apr 16 12:31:01 2026 +0200

    reduce virtual calling in String*Token

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Id5d690fec60e52529f045779c40484df604b3e36
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3170
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 988be8de0a6422a97a6beed4bec877b83b5b0682)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205653
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-25 11:36:02 +02:00
Caolán McNamara 23e5efed4e add accessible name to advancedfilterdialog.ui
Change-Id: Idb7361914689e6fd0672ada35dd5e64cef1d947d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201662
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit af3593af5c541c8526f5d925b033a9cd9f6d2f3d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205632
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-25 09:02:02 +02:00
Caolán McNamara 81d8914159 add accessibility name/descriptions to the color dropdown
so its the same as the value dropdown, the color one is just a
specialization of the general value case and is shown instead
for colors.

Change-Id: I3f0d538a467f0498446db20120c167e5d5cecbcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201660
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit e2a8096f619fbe699734cc4e040f9a625b5c0f6e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205631
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-25 09:01:55 +02:00
Caolán McNamara 09d96d51fe add an accessible-name to definedatabaserangedialog
Change-Id: I0994f8e5395b934a974e18b7a5b17178f0c61feb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201627
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 3fa965cf7079d553d47791674acf54a6d80c2b67)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205630
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-25 09:01:41 +02:00
Caolán McNamara e494181c41 fix oss-fuzz ParseDictionaryFile startup errors
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I86602ef5cdd86a9c98829e172cdc04f7c3db018c
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3086
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 524d79c8f1f314f6df921da7e0093cd4a9a7c91e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205572
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-23 13:52:52 +02:00
Caolán McNamara e75f613109 call RemoveGrfLinks on num rule teardown
add some explanatory comment to the new class, and remove
some unnecessary scope guarding.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I98868920d78759e7a55a3f41b2d35ae9d0a627de
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2843
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 5ae5ec664c0f6b578c4006adc09ad7951760b644)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205495
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-22 14:05:13 +02:00
Caolán McNamara 0bda4b8824 ofz: initialCffRead fails during smoketest
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I9f8d71788cfd9e42a668670d08efd3c774b8455a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3085
Tested-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 15d96dba8b96f1248840da1bafa3b564b2ad2a95)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205514
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-22 12:51:35 +02:00
Caolán McNamara e1f7161054 crashtesting: fix divide-by-zero on rotated zero-width/height shape
crash on converting forums/xlsx/forum-mso-en4-719{400,422,450}.xlsx to .ods

 #0  0x00007fb8a598aeec in raise () at /lib/x86_64-linux-gnu/libc.so.6
 ...
 #21 0x00007fb87cce0b52 in o3tl::detail::MulDiv<long> (n=-9223372036854773760, m=72, d=127) at engine/include/o3tl/unit_conversion.hxx:75
 #25 0x00007fb87cec1c53 in ScDrawLayer::GetPrintArea (...) at engine/sc/source/core/data/drwlayer.cxx:1439
 #30 0x00007fb87d320577 in ScXMLExport::GetViewSettings (...) at engine/sc/source/filter/xml/xmlexprt.cxx:5337

Where the problem rectangle was produced (not where it crashed) at:

 #2  0x0000000000000000 in SdrTextObj::NbcSetSnapRect (...) at engine/svx/source/svdraw/svdotxtr.cxx:53
 #6  0x0000000000000000 in SdrObject::SetSnapRect (...) at engine/svx/source/svdraw/svdobj.cxx:1853
 #7  0x0000000000000000 in ScDrawLayer::RecalcPos (...) at engine/sc/source/core/data/drwlayer.cxx:1305
 #8  0x0000000000000000 in ScDrawLayer::SetPageSize (...) at engine/sc/source/core/data/drwlayer.cxx:683
 #9  0x0000000000000000 in ScTable::SetDrawPageSize (...) at engine/sc/source/core/data/table2.cxx:4287
 #10 0x0000000000000000 in ScTable::SetOptimalHeight (...) at engine/sc/source/core/data/table1.cxx:523
 #12 0x0000000000000000 in ScDocShell::UpdateAllRowHeights (...) at engine/sc/source/ui/docshell/docsh5.cxx:451
 #13 0x0000000000000000 in oox::xls::WorkbookGlobals::finalize () at engine/sc/source/filter/oox/workbookhelper.cxx:667

Each of the three xlsx files has a zero-width rectangle rotated -90 degrees.

WorkbookGlobals::finalize eventually calls SdrTextObj::NbcSetSnapRect
and scales the shape by:

    double(nWdt1) / nWdt0, double(nHgt1) / nHgt0

so the X scale becomes +inf. Eventually this bad value ends up in
ScDrawLayer::GetPrintArea and overflows.

presumably since:

    commit 282cb403cd5cf8660b36a410c0370d51fb1efc96
    Date:   Sun Mar 15 15:15:54 2026 +0200

        Fraction->double in SdrObject::Resize

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I087c5d10ad1fbc20d2735cf4a1b940c26e159350
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3016
(cherry picked from commit a7f20642f1f5355577a691ae27aff70154997a81)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205509
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-22 11:49:04 +02:00
Caolán McNamara fb7aa8e92f add a fodt page background test
Change-Id: I91259affeb7e5f9711ce7ac1eb01e2238c9a2a03
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2390
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 16d33fbb77e23d03fa16dd9e47d047ee1f6a45ff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205497
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-22 09:36:53 +02:00
Caolán McNamara 446068f9b5 put writer bg images under link control
Change-Id: I266d00888965ccfc91a8e1b447793b2dd5021dd2
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2389
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 970434f2e031a4bb5dfcd884e67795149631d00f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205496
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-22 09:36:49 +02:00