I messed up in
commit e174028ce0335d702ecdad5eac823845a16e2f6d
Author: Noel Grandin <noelgrandin@collabora.com>
Date: Mon Sep 21 18:13:44 2026 +0200
Rename paragraph related types in EditTextObject.
This is not the primary paragraph data structure for
EditEngine.
Add some commentary to reduce the chance of anyone
else making this mistake.
Rename typedef
EditEngineParagraphs -> EditTextObjectParagraphs
Rename class
EditEngineParagraph -> EditTextObjectParagraph
Change-Id: I810571cb61b944dd9d056145fe4cef14ba3e43bb
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13273
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit e8dde7d988a1768b68380ab95ba8fabb5feefc2e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211653
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
we have a background task with a call-stack that looks like
SwStyleSheetIterator::AppendStyleList
SwStyleSheetIterator::First
StyleItemController::DrawEntry
StylesPreviewWindow_Base::GetCachedPreview
StylesPreviewWindow_Base::UpdateStylesList
StylesListUpdateTask::Invoke
And we can avoid iterating repeatedly over the entire pool
by searching by name.
We could be even faster by caching pointers to stylesheets
but that is a more invasive change.
Change-Id: Iec25bb4757440825aec62110d974a5001b0690f7
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4188
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 0572dc68861e7fd85da43a0b6635af7c5ea3889b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211560
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
as part of the process of merging the Outliner code into the normal EditEngine paths.
So instead of keeping a bunch of information "on the side" and then having to merge information
from multiple sources, it all lives where it logically belongs.
Also take the chance to rename the depth/getdepth/setdepth
fields and methods to NumberingDepth, which makes the purpose
more obvious.
Change-Id: I314673ee1b9efa14f178ac34a122995a554cd788
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10551
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 284bbe0af12b96844976f30bb35ade3a327ea76d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210503
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
I saw some warnings and got suspicious, so I converted
the OSL_ENSURE to assert, and then found that we
have two copies of the s_nRefCount static field, which
obviously causes trouble.
I tried to fix this by removing usage of this dubious
template class, but the templates classes are intertwined,
and that lead to a very large patch with weird failures.
So this is a hacky minimal fix, using explicit template
instantiation to force the code to only be emitted
in a single library.
Change-Id: I634afb8b40570f2e7e0f8da541b8a2b6325fdc29
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/904
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit af69817a343ccf1411f6f8980c94ed1f696769b4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207023
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
found by running
make CppunitTest_sd_tiledrendering \
CPPUNIT_TEST_NAME=testA11yPresentationInfo
under ASAN with detect_leaks=1
There are two bugs here. One is that we are allocating
SfxViewFactory and not deleting it. The other is that in
sd/ we were calling the same function multiple times and
overwriting a global pointer to SfxViewFactory.
So fix both those bugs, and add a couple of asserts
to prevent future double-allocation issues.
Change-Id: Ia71861bd8da44876fbdd2a2aac3b22527030a598
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3130
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 7f83acffa0c4e1cee9f744658d8ed7d6450a5816)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206322
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
this is using the test document in tdf#171768
I tried reloading the ScPatternAttr pointer, similiar to
commit 1bf9bbea96
Author: Bayram Çiçek <bayram.cicek@collabora.com>
Date: Tue Oct 28 16:53:49 2025 +0300
tdf#169115: sc: fix use-after-free bug in ScDocument::FillInfo
but unfortunately the recalculation can affect random
other ScPatternAttr pointers, not just the one being
used at a specific point in the loop.
So we are forced into a compromise that reduces performance
a little, does not entirely maintain correctness (of painting), but manages
to be mostly performant and mostly correct.
Change-Id: I46591dc38fed20c52eaf8dc00e22c5b6e8a9e233
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2771
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 20fe691a18fb35120d0765dd1519acd6d2986c38)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206280
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
this is using the test document in tdf#171768
I triggered this by deleting a couple of sheets and then saving.
What is happening is that during save, we doing some recalculation
and then BOTH the underlying attribute mdds data structure
AND the ScPatternAttr objects are freed and re-allocated.
I tried re-fetching ScPatternAttr pointers
(which is what we do elsewhere to solve a similar bug) but
then we end up with an assert when iterating over the attribute
data because the underlying mdds data structure has changed.
So CalcAll() seems to be a safe bet, and does not introduce any
performance penalty here (but might cause perf issues with other docs,
we shall have to see).
Change-Id: I72274bef2e2fa50d5119dac53745bb72dc7b46f3
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2770
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 9f366af81478ad218dc2ef2e37423a9ebcc84e73)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206279
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
the last caller was removed in
commit 508ea2d571
Author: Kurt Zenker <kz@openoffice.org>
Date: Mon Oct 4 18:53:05 2004 +0000
INTEGRATION: CWS mav09 (1.6.2); FILE MERGED
2004/08/18 12:24:34 mav 1.6.2.4: #i27773# use system fallback
2004/06/24 17:13:42 mav 1.6.2.3: #i27773# reactivate linking support for OOo documents
2004/06/18 14:17:55 mba 1.6.2.2: #i27773#: special objects don't have a hatchwindow
2004/06/10 16:19:50 mav 1.6.2.1: #i27773# use configuration for conversion purposes
and I cannot find any indication of external use
Change-Id: If895bd2309db8f16729ae0854d6d339f3525ff55
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3876
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 67f1434988c3ac51759f4d392daa728c1bfbaeb5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206188
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
shows up when running CppunitTest_sc_shapetest
probably from the recent changes here, when calling tryToGetCairoSurface.
Rather than doing explicit cleanup, lets follow the same path used in
include/vcl/cairo.hxx
and pass around a shared_ptr that makes cleanup automatic.
Change-Id: I1bec6f579af182b259cb0edbd86192627e5c61ea
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1858
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 70966239f816d81cb9dcb208e7c02e08339da28c)
(cherry picked from commit ee2349dba8aa282e30ae65cbf5ffbb27b707e0ec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205990
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
similar to
commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
reduce ScRefListToken virtual calls
Push the GetIndex() method down to the only subclasses
that actually use it.
And take the chance to rename them to something more meaningful.
Introduce an inbetween ScExternalToken class to represent
tokens that have an external file id.
Change-Id: If45e87a5bb66aeb1c65d82121b430b886b53f20b
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/955
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 7705899fa7bca501f331070f7969374fcf5f52e9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205576
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
similar to
commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
reduce ScRefListToken virtual calls
Push the GetString() methods down to the only subclasses
that actually use it.
We change the inheritance hierarchy a little here
-class FORMULA_DLLPUBLIC FormulaStringOpToken final : public FormulaByteToken
+class FORMULA_DLLPUBLIC FormulaStringOpToken final : public FormulaStringToken
because FormulaStringOpToken and FormulaStringToken share
a type svString which makes it hard to decide which subclass we
are handling.
So now we can check for GetType() == svString and then
cast to FormulaStringToken safely.
Change-Id: I3f087d65a2297b2d8fb5213e81987e0001bc1c62
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1152
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 8710f98c1565b1d8ecbbbec743b29bcbb38c5ce2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205569
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
similar to
commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
reduce ScRefListToken virtual calls
Push the GetDoubleRef() methods down to the only subclasses
that actually use it.
Which means we can return a ref instead of a pointer,
since we now never return nullptr.
Change-Id: I4dfce551e985fe20db00d3a0694ed99f20f87731
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1050
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 9aab43b4e3a68cd833eddfdd11086f03e55f2c1a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205508
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
Blind fix of error in CppunitTest_sc_ucalc
caused by
commit 8cbc57006c7836d8959add41cb6af68ef22a7a5f
Author: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Tue Apr 14 14:37:31 2026 +0200
reduce virtual calling in ScMatrix*Token
which for unknown reasons I cannot reproduce on my ubsan build
> ```
> engine/sc/source/core/tool/compiler.cxx:5704:31: runtime error: downcast of address 0x7be60e03d610 which does not point to an object of type 'const ScMatrixToken'
> 0x7be60e03d610: note: object is of type 'ScMatrixFormulaCellToken'
> 00 00 00 00 d0 ae 77 bf a5 7b 00 00 00 00 0f 00 01 00 00 00 70 72 09 0e d6 7b 00 00 c0 73 09 0e
> ^~~~~~~~~~~~~~~~~~~~~~~
> vptr for 'ScMatrixFormulaCellToken'
> #0 in ScCompiler::CreateStringFromMatrix(rtl::OUStringBuffer&, formula::FormulaToken const*) const at engine/sc/source/core/tool/compiler.cxx:5704:31
> #1 in formula::FormulaCompiler::CreateStringFromToken(rtl::OUStringBuffer&, formula::FormulaToken const*, bool) at engine/formula/source/core/api/FormulaCompiler.cxx:2745:17
> #2 in ScSimpleFormulaCalculator::Calculate() at engine/sc/source/core/data/simpleformulacalc.cxx:76:15
> #3 in ScSimpleFormulaCalculator::GetErrCode() at engine/sc/source/core/data/simpleformulacalc.cxx:122:5
> #4 in testFormulaWizardSubformula::TestBody() at engine/sc/qa/unit/ucalc.cxx:6548:37
> ```
Change-Id: I38a7e826d4375cc5adb07bc13158403501d7432c
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1067
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 5c1b422ea8b9f1d73eac88a0cd81e78e8c7d2942)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205462
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
which shows up when loading and browsing
forum-mso-en4-130383.xlsx
This shaves 10% off the profile.
Both ScQueryEntry and Item always have a certain number of elements in their vector.
So we can use the boost::small_vector data-structure here to inline those allocations
and avoid some heap allocation and freeing work.
Change-Id: If8585899c22d2d5cd69cba4b56271229ada7bee3
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/607
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 0c0e44e2a68af7dee029cbbf117772f1f1028984)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205220
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
found when running CppunitTest_sc_spreadsheet_functions_test under
ASAN with detect_leaks=1
We are putting cloned instances into the map, but then we
clone those pointers again inside replaceNamesToResult().
And it is not obvious if we use the pointers only once inside
replaceNamesToResult(), in which case we could avoid the second
clone, or if we need to clone here because we might use a
source pointer more than once.
To simplify the memory management here, make the map use
FormulaTokenRef so that least we dont leak anymore.
Also skip a couple of clone calls in ScInterpreter::ScLet(),
which are not necessary because we are going to clone again.
We still have some inefficiency here,
because we are creating a new ScMatrixToken and then cloning
that new instance.
Change-Id: Ibc254833c078a9c5ef95e17c7a019a7a598a4a6a
(cherry-pick from commit Ibc254833c078a9c5ef95e17c7a019a7a598a4a6a)
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2167
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Change-Id: Ie6c439faeb7955470a90872e95fea9ab87fdec82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205023
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
found when running CppunitTest_sc_spreadsheet_functions_test under
ASAN with detect_leaks=1
The AddToken method will call Clone() on our behalf, so the
extra Clone call here resulted in a leak.
Change-Id: I5463e2b89a71c46096ef3f9806fc33f0e523e5e7
(cherry-picked from commit I5463e2b89a71c46096ef3f9806fc33f0e523e5e7)
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2166
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I9a2bd6dfac42fe203099ae23c1def3fce063d5a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205022
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Found when running under ASAN with detect_leaks=1
This triggers with
make CppunitTest_sc_subsequent_export_test CPPUNIT_TEST_NAME=testInvalidSheetNameLength
We have a complex aggregation object here which needs to have
dispose() called, or we leak it and all of its child objects.
(cherry-pick from commit I4c89fadba3335713147353960990be30afa36bec)
Change-Id: I4c89fadba3335713147353960990be30afa36bec
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2121
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205018
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
There is no indication why this code was needed.
It was added in
commit 01212b4ade
Author: Oliver Bolte <obo@openoffice.org>
Date: Tue Oct 21 07:50:39 2003 +0000
INTEGRATION: CWS formcelllinkage (1.77.160); FILE MERGED
2003/10/01 09:50:27 fs 1.77.160.1: #i18994# merging the changes from the CWS fs002
but makes no sense.
Things that are listening to a ScCellRange*
need to hold a reference to it.
(cherry-picked from commit I51a38b5898286e07b7ca4fced1abd37dfb1671a9)
Change-Id: I51a38b5898286e07b7ca4fced1abd37dfb1671a9
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1840
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205016
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Which shows up when running CppunitTest_sc_shapetest
as a leak of ScTransferObj and some friends.
We have to fix this problem in both sc/ and sw/
simultaneously, because both of these modules try to
shut down the underlying itempools, which the other one
might need (yes, sometimes both writer and calc
are initialised in the same process).
Change-Id: Ia007722ef4d72909ddd77c3e5a9b136aa7e420b9
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1446
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205014
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins