100 Commits
Author SHA1 Message Date
Noel Grandin 0e9f94c375 remove bounds checking EditDoc methods
which just tends to obscure problems, rather than help.

Fix a couple of places which have out-of-bounds data, for normal (i.e. not a bug) reasons.

Surprisingly, very little fallout.

Change-Id: I3ade28e73e584c4885e3e1a896007f535b494058
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13788
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 031eddcb0fb671d1e0cdb6b2fd08ad0bba85a926)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211693
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-10-05 08:58:22 +02:00
Noel Grandin b00fc0d4e7 add some editeng/sd unit tests
which will be useful in upcoming changes to EditEngine/Outliner

Change-Id: I762a5b213f3ee9a65a83ac8b17d377f9d91a2a2a
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13817
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit a6899cb5b04532f2efa24619b93ba0e9fef6c344)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211654
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-10-01 13:53:06 +02:00
Noel Grandin 73c41f63cd Rename again in EditTextObject
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>
2026-10-01 12:33:02 +02:00
Noel Grandin 447298ce46 rename EditEngine::GetDepth to GetNumberingDepth
to distinguish it from the various other depths we have.

Change-Id: I2917ecc55baa90c375150d2066b98c6e5f384626
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13272
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit dc56f1179397f2b6765cdf12a3d09a99fcf7e679)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211652
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-10-01 12:11:03 +02:00
Noel Grandin 90f327c670 merge OutlinerEditEng into EditEngine
as part of the process of simplifying the whole Outliner vs EditEngine
infrastructure.

Change-Id: Ia4f173ba41b374864cc4e47d895b037d6493a08f
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13238
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 196eccebee433d3cfe170786a81ea39f5c491ec1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211615
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-10-01 09:01:56 +02:00
Noel Grandin 212d17f7ea add a non-const GetEditEngine() method to Outliner
to avoid const-casting all over the place

Change-Id: I75f3442341894dbe4e12cc7995669dc7f3bf63f7
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13354
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 318e2cf839c6311d4a69572b4534f554bdda3f96)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211604
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-10-01 09:01:52 +02:00
Noel Grandin f13d47614f reduce CPU cost of updating styles list
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>
2026-09-29 16:38:54 +02:00
Noel Grandin 40062dd0b8 cool#16122 export to pdf produces bad PANTONE element
The name element in a PDF file needs escaping if it contains spaces, like the PANTONE element does.

Re-use the escaping logic in COSWriter, and while we are here, convert
the COSWriter function from 'const char*' to std::string_view.

Change-Id: I4f6fdb049e746688c393371e2fea30bbaf6da314
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10095
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 765ae13aa2e7a954a1629314726207f551d83ff8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210955
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-14 20:21:00 +02:00
Noel Grandin fcf0bcc0f9 Hold EditTextObject by value in OutlinerParaObjData, not by pointer
OutlinerParaObjData is already ref-counted data, no need
for further indirection.

Unfortunately, this sets off a larger chain of changes
than I would have preferred, but we end up storing
EditTextObject on the stack much more than before, so
that worked out well.

Change-Id: Ie7d0ccfbfeec4e6935f2ed6b8ad48aadfe1bac20
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10973
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit fbf7d1bc7142d3f0e4e5f959983dea065afc5ea3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210927
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-14 16:27:02 +02:00
Noel Grandin 8ce702c278 simplify impl_addVbEvents_nolck_nothrow
no need to use a loop construct here

Change-Id: I590e0716d81879ffe52bb62c3ae7eea0550e0c3c
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1838
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit d49dfcbc653cde558bce9adf8e7ddf738d727091)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210488
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-09-05 00:10:50 +02:00
Noel Grandin 1b276f9265 merge the outliner ParagraphData information into the regular EditTextObject
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>
2026-09-05 00:09:20 +02:00
Noel Grandin ac037dfe6b remove some manual bounds checking from editeng
which only serves to obfuscate logic errors, the debug
stl library will do this for us.

Change-Id: I184c7bc2ca65e663c464e6392108da5cbd83253d
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10547
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit c94cad08817882699a4ff8a04bb1d9abbcd4e795)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210502
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-05 00:09:14 +02:00
Noel Grandin c9e799015c mbIsEditDoc is dead
ever since
  commit 110a25fdc2
  Author: Noel Grandin <noel.grandin@collabora.co.uk>
  Date:   Wed Jul 18 14:49:58 2018 +0200
  loplugin:unusedfields

Change-Id: I8406712984a6d9938d2b1951e9ac783ee8c10f44
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10450
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 1e9e993313bc0b5093c65e707681827ddef6d9b6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210501
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-05 00:09:05 +02:00
Noel Grandin 6a9d955a54 map->unordered_map in XMLShapeImportPageContextImpl
this map does not rely on ordering anywhere, and std::unordered_map
is faster and more memory-dense.

Change-Id: I8c5fc00b1d8d677a3023daba30fe5f73cf989344
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10125
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit b5f6ddd08f6e4e6a9efda70efd98db70adbe2aaa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210496
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-09-04 19:47:56 +02:00
Noel Grandin c877de09f1 std::map->std:unordered_map in XMLPropertyHandlerFactory
This map does not need ordering. std::unordered_map is faster
and more memory-dense.
Also avoid double-lookup in GetHdlCache()

Change-Id: I0aea9eabe660b110e24dbec9ee523d217e4183f8
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10124
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit c2a0e2bb613e9ecae177325217cc700d6f4eb73e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210495
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-04 19:47:50 +02:00
Noel Grandin 01df8b6ff0 map->unordered_map in lcl_fillNativeSymbols
no need to use an ordered map here, and an unordered map
is much faster.
Also avoid repeatedly indexing into the map.

Change-Id: Ia6b39800a9890ab0df3e8e73282d504e91e679ec
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9633
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 1e786f1a4b588ce289b90979231b3c5e55cab27d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210492
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-04 19:47:34 +02:00
Noel Grandin 75589a573e map->unordered_map in PropertySetMixin
no need to use an ordered map here, and an unordered map
is much faster.
Note that I leave the property name map alone, because
the ordering of that shows up in the output of some methods,
and some code is sensitive to non-ordered property names.

Change-Id: I34f9c516b6e5a981f789615fe986cd026c2ac8dd
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9632
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 08443a9446cb1cfe1eae18955598f1a23a7a9aad)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210491
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-04 19:47:26 +02:00
Noel Grandin 63a9abb2ab map->unordered_map in ConfigurationWrapper::getPropertyValue
no need to use an ordered map here, and an unordered map
is much faster.

Change-Id: Ia4b6fa7174e2d8c62cec80a2ea65e12c0a837ec4
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9631
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 8003011a7b16bf4f7e3826cba5600b2cea18d1f8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210490
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-04 19:47:21 +02:00
Noel Grandin 1318b7834e drop EditTextObject::CreateAttrib
which means we can move XEditAttribute back inside editeng,
no need to expose it in the module header.

Change-Id: Ica8bcf7d1414b582011b473aac807b8a7a7369eb
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10688
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 60d0dc551f7acb6bbdfc8ee2f4c8369eff3df4c0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210360
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-02 01:03:33 +02:00
Noel Grandin 3b52fbc96f merge EditTextObjectImpl into EditTextObject
this is a weird kind of pimpl pattern, lets just simplify it.

Which means we can remove the Clone() method in favour
of a normal copy constructor.

Change-Id: Ib5793c66df4729f48def8b3cead0f39f2ba94830
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10550
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit dd8a795b5aed4c44e11eef86eaf19b1f88edf0f8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210320
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-01 15:40:01 +02:00
Noel Grandin 7b0729cd8b UpdateAllLinks pParent parameter is always nullptr
Change-Id: I67b9bc9cb235d66ffb4eef1d6a01535664b30bc7
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10464
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 178ec8504f2fe78725c2f9bff78f1db698b8fca3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210286
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-31 15:56:24 +02:00
Noel Grandin 8be85cad83 switch INetURLObject::IsExoticProtocol to default-deny
and whitelist known-good stuff, rather than playing
whack-a-mole with bad protocols.

Change-Id: I8ea95a2af57b826f16f3d97daffac15659a4ad9c
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9687
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 7e5feed961ef2344d580d63a5752e9d6e2c0797e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210126
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-27 15:46:41 +02:00
Noel Grandin 3b403f69d6 address review comment
in
  commit f7b67e6c8c5981790fb9ac162dcc68e470b53112
  Author: Noel Grandin <noel.grandin@collabora.co.uk>
  Date:   Tue Aug 18 12:17:04 2026 +0200
  pdfexport: reduce the number of times we split images

The call to CreateColorBitmap() is redundant here, since
in this case it just returns "this".

Change-Id: I32fe17149d16509e602ff928843ba8c9898ef24a
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9506
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 8ddf30a6e91076831c7432c0cbd10ed254f23c2c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209506
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-23 13:25:56 +02:00
Noel Grandin 32a2ba1a48 pdfexport: reduce the number of times we split images
into color and alpha.

Calling CreateColorBitmap() and then calling CreateAlphaMask() calls SplitIntoColorAndAlpha twice.
So rather call it directly, halves the number of times we do this, which shaves about 10% off the profile here.

Change-Id: I9fa3073bc41fd98154028696efa4a4b635fed3fd
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9438
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit f7b67e6c8c5981790fb9ac162dcc68e470b53112)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209505
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-23 13:25:52 +02:00
Noel Grandin 37d0bc1d77 return by ref from ScDocument::GetRangeName
to make it obvious that it never returns nullptr

Change-Id: I8218f921583c49fcbd57a1693716317423a9febe
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/941
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 8a63916739a316a9432b47862d2212c1e689f9cf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209451
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-21 16:26:06 +02:00
Noel Grandin f478a4f600 speedup ScTable::SetDrawPageSize
which calls GetColOffset() with a very large column value, which
causes it to loop, repeatedly searching the hidden-columns
data-structure. With large spreadsheets, this becomes expensive.

Change-Id: If1a1a7f85e2f36273e2de8da41be2756f52be8a5
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5764
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 86a8a9ec70c039a493986cf78abaa17882f49bd7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207624
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-06 10:47:56 +02:00
Noel Grandin eb3cee606e template static field appearing in two different CUs
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
2026-06-20 14:20:53 +02:00
Noel Grandin b1712dadb7 the depth parameter to the configmgr open call has never done anything
Change-Id: I74c803a93f561d09d6ec8cccc9bdc764596f321a
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3591
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 758e96b21b067487931bb1e1f3c49815e976955e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206438
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-18 11:17:33 +02:00
Noel Grandin d36d217f44 cool#15759 Speedup style preview rendering
We have an O(n^2) loop here, iterating over formats,
and then scanning the list of formats inside the loop (twice!).

Build a map to avoid that, and add some new method calls to IDocumentStylePoolAccess

Change-Id: I62d688377a8ed87a8888013bb3f65babd6c771e6
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2547
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 824e31c44f7ce8a443bff5e0d6aef02b08e100c6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206682
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-17 08:53:08 +02:00
Noel Grandin 66b83a0107 use more unique_ptr in SmNodeListParser
Change-Id: I546d0aa488c55c8336da8156c6a8d41e788bc515
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2453
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit f803c18ff8a888fe4353050f0c010f36c1002ba8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206684
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-16 15:38:27 +02:00
Noel Grandin bce4b4af9d [API CHANGE] remove deprecated XSpell1 and XSupportedLanguages
in favour of their replacements XSpell and XSupportedLocales

Change-Id: I3ad20d0c6c3bf0a00d7ef3947705059027a1ff6f
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4228
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 35842d441f2e82204ce77ba8c53735be3f18dc78)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206467
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-16 14:55:20 +02:00
Noel Grandin 9fb6bc06eb cool#15761 Speedup calc cursor / data-entry
I suspect that what is happening here is that maDirtyTableColumnNames is
getting a lot of entries and we are refreshing stuff more than we need to.

Swap the loop ordering so that refresh each DB at most once.

Change-Id: Iee629083a81dd52365af90a820a5a78a27f6c3ef
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2556
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 5d7371e71ecf7fc9a52d70e55f3060c0aab04d56)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206683
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-16 14:47:36 +02:00
Noel Grandin 9537ccc6fe no need to allocate SmNodeList on heap
It is already a node-based structure and supports being std::move'd around.

This avoids some unnecessary heap allocation work.

Change-Id: If6ee7d1852a26408f9e1c93b55a222d551a44550
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2452
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 2e3bad7d59c37d86e22f214c8ac640a0c54c25c5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206643
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-16 09:13:37 +02:00
Noel Grandin 3a46865a64 simplify MSC_VER conditionals
we require _MSC_VER >= 1930 now

Change-Id: I493a3fe4267c8ea148d411535b9de24666154722
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2887
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit adb5dce15a169d0142f40eb8efff94c6822c7dbc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206640
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-16 01:20:43 +02:00
Noel Grandin 6729212420 speedup BitmapScaleConvolutionFilter for 32-bit data
which shows up on a perf graph when exporting PDF files.

We can avoid the expensive unpremultiply/premultiply that
happens here.

Change-Id: I45fc19de86415ba0c010040a23affba66af6c75a
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4185
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 6c7f68c910515a711c1731bb7c0b730433aa249d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206468
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-14 10:24:59 +02:00
Noel Grandin c1fd9fdc81 fix leak in SwCalc::SetCharClass
triggered by running

  make CppunitTest_sw_ooxmlexport16 CPPUNIT_TEST_NAME=testTdf150542

under ASAN with detect_leaks=1.

If this is called twice, we leak the previous object allocated.

Change-Id: I291296883b791a6af83212b5878fbf674e4aca2c
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2565
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit a8c1a7dd53d4c271deae4b1af9519b0b705f0ae3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206358
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-12 12:55:38 +02:00
Noel Grandin d1aa3c4748 fix leak of XSLTTransformer
in

  make CppunitTest_sw_ooxmlexport4

CPPUNIT_TEST_NAME=testSegFaultWhileSave

found by running under ASAN with detect_leaks=1

Change-Id: Ia0e63e7eed2c2e84aaadccb94dc05aa6b241f49d
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2564
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 4d46d03fc56ddd7a816cd51cfa0b178d49f5465d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206357
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-12 08:50:35 +02:00
Noel Grandin 165ac32879 emit '#pragma once' in codemaker
instead of old-school header guards

Change-Id: I3aac6f970494de721735576c2a640d85fd61b7c2
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3029
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 9f5421d96d63d06f9b2c9478e45185409498b982)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206321
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-11 18:49:46 +02:00
Noel Grandin a5901d42c5 fix SfxViewFactory leak
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>
2026-06-11 08:58:23 +02:00
Noel Grandin a27dcf22cd fix SbxArrayRef leak
found by running

    make CppunitTest_sc_macros_test CPPUNIT_TEST_NAME=testTdf133889

under ASAN with detect_leaks=1

We end up with a cycle here, between the SbxArrayRef and one of its children.
Clear the SbxArray to break the cycle.

Change-Id: Ia996eca6da7d9f39821305514b456b7aba799cf1
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2608
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit ff5487aaab39aa8b862da1cf0b3f41e8fb1f8d7d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206324
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-10 22:28:40 +02:00
Noel Grandin 1da9c73591 fix SbxArrayRef leak
found by running
	make CppunitTest_sc_macros_test CPPUNIT_TEST_NAME=testTdf146742
under ASAN with detect_leaks=1

This is the same leak mechanism as
    commit ff5487aaab39aa8b862da1cf0b3f41e8fb1f8d7d
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Thu May 14 13:19:39 2026 +0200
    fix SbxArrayRef leak
and we use the same kind of fix.

Change-Id: Ia133e73062fca27ff6dbc344045ac62873cc7b4a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3005
Tested-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 834c60bef01e86a5af7f8862c47341cfdd8d70fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206323
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-10 22:27:34 +02:00
Noel Grandin f775fb92c9 ScPatternAttr use-after-free (2)
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>
2026-06-10 17:01:53 +02:00
Noel Grandin 88a6c29929 ScPatternAttr use-after-free
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>
2026-06-10 17:01:46 +02:00
Noel Grandin 716be93f00 drop the SC_OPCODE constants
now that we have moved the code to use the OpCode oc* constants

Change-Id: I00b0fe8f490803fc9a74f3c7a87d13da4b34ce58
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1819
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit fc05fda4b467ce7932a6341c8e98469964abdac6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206193
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-08 10:09:40 +02:00
Noel Grandin 114bc67a2d Convert from using SC_OPCODE_ constants to use oc* constants
so that we can standardise on a single enum

Change-Id: I2c9347a5ee59c8b8f0bb199b22ea51ca94ecf8c3
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1795
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 5b4826b51eee143a564dfa94ed50ab89cc36216b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206192
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-08 10:09:29 +02:00
Noel Grandin 0c55b6e0b3 rearrange OpCode order to match SC_OPCODE order
as a prelude to removing the SC_OPCODE constants and
just using a single enum for this stuff.

we need the order to match because when we switch
to using OpCode only, several parts of code check
for ranges of enum values.

Change-Id: I83cdca016b5fe9ab2486385593ab233eff393538
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1767
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 4009c9873f1c32f23b43fd51bd15dc159bae5b98)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206191
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-08 10:09:19 +02:00
Noel Grandin c11c29d401 crashtesting: assert on exporting forum-mso-en4-531883.xls to xlsx
since:
  commit 5c841b381fe16634c51121b351c89154a25eb8d9
  Date:   Tue Mar 17 16:33:19 2026 +0530
  XLSX: Truncate external sheet names if the length is > 31

Bug document: forum-mso-en4-109082.xls

Change-Id: I0050bd63a28c74d2e337073f2815c6ffd17478c9
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1433
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit b71a8f85dd1b99a8d879bcf5ddebd185a4354c85)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206190
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-08 09:30:11 +02:00
Noel Grandin 26305f046f remove css::embed::XLinkFactory
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
2026-06-07 22:49:13 +02:00
Noel Grandin f87c623b4e lsan:fix leak in CairoPixelProcessor2D::getOrCreateCairoSurfaceHelper
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>
2026-06-05 08:43:09 +02:00
Noel Grandin 62f1a275e1 ofz#516502581 Heap-buffer-overflow
regression from
  commit 726a1ff3abce3a4eff5dd115182b15eccb653568
  reduce FormulaByteToken virtual calls

Change-Id: Ica3e5a6c32f03cfdb215eb3ab78d74284e951094
Signed-off-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3497
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 15d5ebba4151353127ddcb41aa2824dbe283788f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205883
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-01 20:50:20 +02:00
Noel Grandin 8f6c2c38eb reduce FormulaByteToken virtual calls
similar to
  commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
  reduce ScRefListToken virtual calls

Push the Get/Set-Byte() methods down to the only subclasses
that actually use it.

Change-Id: I990e45baccb00657600ecf62004a67849ede2f62
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1008
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit d3ab7f03ee98fb23ab1b9c6a0e5f18874603f46d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205601
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-24 10:28:55 +02:00
Noel Grandin e22c8988d2 prefix pc field in FormulaCompiler
Change-Id: I2b7b78d6a9df1103084ac4a50d39e452645b4e5f
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1392
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 431e8c9e9a6a7e476e8240c6c8781e2344b558ea)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205600
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-24 09:05:43 +02:00
Noel Grandin 3a57fe4450 prefix fields in FormulaCompiler
Change-Id: Ib03b15f069d21dccaa585e0577c43c91fabb046c
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1391
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit c1020ea6fe5e8eb85b756857b0e80bbe1d560c4d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205598
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-24 09:03:58 +02:00
Noel Grandin 1d8cf993df reduce Sc*Ref*Token virtual calls
similar to
  commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
  reduce ScRefListToken virtual calls

Push the Get/Set-Ref*() methods down to the only subclasses
that actually use it.

Change-Id: Idf56c7c1fc2340438add93e11a549824461b80a8
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1243
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 003c0007c13e443fe4e520d1b70586266abf7811)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205579
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-23 21:47:06 +02:00
Noel Grandin af6e41b327 reduce virtual calling in Sc*Ref*Token
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
2026-05-23 13:14:34 +02:00
Noel Grandin 0bad6cbf40 reduce virtual calling in String*Token
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>
2026-05-23 09:01:44 +02:00
Noel Grandin 780e274c16 asan: fix some issues in ScFormulaDoubleRefToken
after
  commit 9aab43b4e3a68cd833eddfdd11086f03e55f2c1a
  Author: Noel Grandin <noel.grandin@collabora.co.uk>
  Date:   Wed Apr 15 19:57:41 2026 +0200
  reduce virtual calling in ScFormulaDoubleRefToken

Change-Id: I0cb8c1a628a9049ad7a770529094075ba6027b73
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1110
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit fedbb94b891d876a39711ae1178a82fc2ac1238a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205563
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-22 22:01:16 +02:00
Noel Grandin 9cfdd6b430 reduce virtual calling in ScFormulaDoubleRefToken
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
2026-05-22 20:28:02 +02:00
Noel Grandin 212a751aea ubsan: blind fix of downcast runtime error
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>
2026-05-21 07:40:55 +02:00
Noel Grandin 724306c6a5 reduce virtual calling in ScMatrix*Token
similar to
  commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
  reduce ScRefListToken virtual calls

Push the GetMatrix() methods down to the only subclasses
that actually use it.

Change-Id: I52c17941a5ec015d56dd300f1421fe5a2bb8ad3c
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/954
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 8cbc57006c7836d8959add41cb6af68ef22a7a5f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205371
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-20 07:42:14 +02:00
Noel Grandin e0c845b2e8 be more explicit with ScMatrixRangeToken
instead of override GetByte() and abusing it, add an explicit method.

This will also make an upcoming patch series simpler.

Change-Id: Iafaec01cc45f1c7c54ab3f01cf5139011c78bce1
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/809
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 5ca5d540bbcf5ae74f974d8db38316344b7e33bf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205373
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-19 22:38:24 +02:00
Noel Grandin 8ccbc46307 make ScMatrixRangeToken subclass ScMatrixToken
it really is just a ScMatrixRangeToken with an extra field,
and it even shares the same opcode.
This patch will also help another patch series to be simpler.

Change-Id: I9749530168b529668f0e1cfc2a374d08832a124a
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/807
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit c2051178e492d833312730796a359318148c0e65)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205372
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-19 20:43:59 +02:00
Noel Grandin 140fbc4621 reduce virtual calling in FormulaDoubleToken
similar to
  commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
  reduce ScRefListToken virtual calls

Push the GetDouble() methods down to the only subclasses
that actually use it.

Change-Id: I999eb613f958fb24947e7656fe0e31d41e8f3aa3
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/967
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 54ffe7987829ef4c406a99f272159f58a9f30581)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205300
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-05-19 07:40:43 +02:00
Noel Grandin 575cea002f reduce virtual calling in FormulaIndexToken
similar to
  commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
  reduce ScRefListToken virtual calls

Push the GetSheet() method down to the only subclasses
that actually use it.

Change-Id: Ibaa3902cd097662127c5dd35af937a9163195a45
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/932
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 203fb0e436294f9f34a2bb9714efa72b9ec101fe)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205272
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-18 07:43:00 +02:00
Noel Grandin 83c887bdef reduce virtual calling in FormulaJumpToken
similar to
  commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
  reduce ScRefListToken virtual calls

Push the GetJump() method down to the only subclass
that actually uses it.
And also make the GetJump() method have proper const semantics.

Change-Id: I4e7053bf18c9dedbacfc2608e5b2d5f7738487ca
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/910
Tested-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 6e6129eb1cf13e813de17fdc41f59ee50a891762)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205271
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-17 23:16:23 +02:00
Noel Grandin 83dfd80774 reduce virtual calling in FormulaFAPToken
similar to
    commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
    reduce ScRefListToken virtual calls

Push the GetFAPOrigToken() method down to the only subclass
that actually uses it.

Change-Id: Iac66fc21b71e2ecf08b7eb5669705797c393ca7e
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/909
Tested-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 24cd3d084191af5f1f925d89ed99986dd8275e2f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205266
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-05-17 22:02:16 +02:00
Noel Grandin ef144db15a reduce FormulaErrorToken virtual calls
similar to
    commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
    reduce ScRefListToken virtual calls

Push the GetError() method down to the only subclasses
that actually use it.

Change-Id: I89625fea668f89d0be5c1c4f36cbb1676b050f9e
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/833
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 849a4167ab2ac248c8fcb93ea761f807324ec547)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205261
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-05-17 16:32:55 +02:00
Noel Grandin 86e6220fff reduce FormulaDoubleToken virtual calls
similar to
  commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
  reduce ScRefListToken virtual calls

Push the GetDoubleType() method down to the only subclasses
that actually use it.

Change-Id: I246421597fab589009ad2b5bbb62ba3b85abd9d8
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/823
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e0e5eb845c542b2f67bf8e4287e9ee6b731f2a36)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205255
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-05-17 13:01:52 +02:00
Noel Grandin ac89efe483 reduce FormulaExternalToken virtual calls
similar to
  commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
  reduce ScRefListToken virtual calls

Push the GetExternal() method down to the only subclass
that actually uses it.

Change-Id: I26281a30a8a8a32b4b6d28f3b5a24aa94814f953
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/822
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit f59c512a885ae4264ba9f7b8fe4d7b9574a2a0dc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205254
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-05-17 10:50:32 +02:00
Noel Grandin b96243ffd2 reduce FormulaSpaceToken virtual calls
similar to
  commit f47fc9a67f16a3da1e5cbcc8b821682298ec90b3
  reduce ScRefListToken virtual calls

Push the GetChar() method down to the couple of token
subclasses that actually use it.

Change-Id: I2b90a90e8ad1d374bd6a48fb4fcbeb20bf3d2858
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/821
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit c0770092833919f002f3872772247d814f8cff4f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205239
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-05-16 23:01:49 +02:00
Noel Grandin 3b9ff4c28c speedup ScCountIf
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
2026-05-15 17:08:39 +02:00
Noel Grandin 6b193f19d5 cool#15641 slow opening of ODS
regression from
  commit 64503f9187
  Author: Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>
  Date:   Tue Jan 23 20:56:17 2024 +0100
  ITEM: Add some default global sharing

Change-Id: I7f9c2319ca97338611458f93780da01f13c48516
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1448
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit a48cc7b525768ea6e02b4d58ef4d524850a71a0e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205046
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-11 15:46:57 +02:00
Noel Grandin 515a92aef1 lsan: fix leak of FormulaToken
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
2026-05-10 14:08:12 +02:00
Noel Grandin de6b35394b lsan: fix leak of FormulaToken instances
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>
2026-05-10 13:59:01 +02:00
Noel Grandin 1621777daa lsan:fix leak of OGeometryControlModel when exporting VBA stuff
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>
2026-05-10 11:05:37 +02:00
Noel Grandin 8d319d257a remove some acquire/release bogosity
similar to commit
  commit b07035d97fcfd0bf23a2dcb8b3373b461e5450ab
  Author: Noel Grandin <noel.grandin@collabora.co.uk>
  Date:   Thu Apr 30 14:54:19 2026 +0200
  fix a leak in CppunitTest_sc_filters_test

Things that are listening to ScChart2DataSequence need
to hold a ref to it if they want it to stay alive.

(cherry-pick from commit I5b5815390da7b9d1f4007cf9b6feb999e26123d7)

Change-Id: I5b5815390da7b9d1f4007cf9b6feb999e26123d7
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1920
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205017
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-05-10 10:18:10 +02:00
Noel Grandin 338b119e23 fix a leak in CppunitTest_sc_filters_test
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>
2026-05-10 09:20:41 +02:00
Noel Grandin b0841b5628 lsan: fix clipboard leak
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
2026-05-10 08:07:36 +02:00
Noel Grandin 6f1b246163 lsan: fix leak in forms::PropertyBagHelper
found by running leaksan with 'make sc_shapetest'

Change-Id: I9905d742b162b69d6c256cddb3e6f1f5631e714b
(cherry picked from commit e7888687f5ded1490a92b44f3ff01b76f6791a93)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204963
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-09 16:19:09 +02:00
Noel Grandin c422ba15c1 Fraction->double in various
Change-Id: I268df0e036ae922762eaf39b82af0fff1759d7e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202742
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-27 08:40:17 +01:00
Noel Grandin 808643c1ad Fraction->double in svx
Change-Id: Ib20d4b679ff833ab60630bcc8ad948d3c80ae45a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202741
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-27 08:40:02 +01:00
Noel Grandin ccd063bff1 Fraction->double in reportdesign
Change-Id: I1dd785efeb267066921ddceb65e6af16370b194b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202740
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-27 08:39:50 +01:00
Noel Grandin 5443088b8b Fraction->double in filter
Change-Id: Ia26e74e69250d6c9cb9afa2b5d4990949568a145
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202739
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-27 08:39:40 +01:00
Noel Grandin bf10f19a02 Fraction->double in sc
Change-Id: I04f49ebe0b594e92631f42069cc2403b5c643317
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202738
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-27 07:23:43 +01:00
Noel Grandin 7aa82cb2da Fraction->double in sw
Change-Id: I1f9fea338bbae72c3fe1c5ab1829396883792b1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202737
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2026-03-27 07:23:34 +01:00
Noel Grandin 1279168289 fix divide-by-zero in PictReader
regression from commit
  5772d98430
  Author: Noel Grandin <noel.grandin@collabora.co.uk>
  Date:   Tue Mar 24 15:07:00 2026 +0200
  Fraction->double in PictReader

Change-Id: I3c082b7441828c6290854a63a9c9f2384173d6bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202651
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-25 13:59:52 +01:00
Noel Grandin 9e5cdca053 Start process of converting MapMode from Fraction to double
add constructor and setters

Change-Id: I1ea8d0b5ac2e2f49e658247d4a21ed80457c68ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202603
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 19:57:43 +01:00
Noel Grandin 73581d0284 Fraction->double in SvxXConnectionPreview
and also avoid allocating these on the heap

Change-Id: I7797fabb2d0d99f3764594846efde6609a669950
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202601
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 18:40:11 +01:00
Noel Grandin 67c365fee9 Fraction->double in SdVectorizeDlg
Change-Id: Ice04e8e6e5bf6c5a048c2c582e982d91a1611acc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202600
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 18:40:01 +01:00
Noel Grandin d36ff48a79 Fraction->double in AnimationWindow
Change-Id: If9bf3c0acbfc51e913c5f471859a2734dbed7f17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202599
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 18:39:51 +01:00
Noel Grandin 5772d98430 Fraction->double in PictReader
Change-Id: I9cb7e5fbd36616afc7fd1dab101baa9c9e5d78e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202598
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 18:39:41 +01:00
Noel Grandin 5c310b4a05 Fraction->double in ImpSdrGDIMetaFileImport
Change-Id: Ie08f069baaaf57116e53568e4d2d1040db8efa46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202594
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 18:26:40 +01:00
Noel Grandin d40d2dcd8a Fraction->double in ImpSdrPdfImport
Change-Id: Id9c82631d92cff6721aa9f2a5a44a030ac001622
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202593
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 17:14:37 +01:00
Noel Grandin 2915f1291c Fraction->double in SdrFractionItem
Change-Id: I9dd1a78d1b69c2c3e6fba050360bdcd0f1de47e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202590
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 14:08:24 +01:00
Noel Grandin ca82a93896 Fraction->double in SfxPoolItem
Change-Id: Ie5fe5f9367c6e657cee20c877a12d4c290aaec94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202588
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2026-03-24 14:07:52 +01:00
Noel Grandin 6daae4d4fe Fraction->double in SmNode
Change-Id: I376b9f26e58cdd2ae59e8da669e67d51a0582b72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202587
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2026-03-24 13:28:03 +01:00
Noel Grandin ae8b87b8dc Fraction->double in MathMLAttributeLengthValue
Change-Id: I1d49474eadbf92765073698b22918033fad7be7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202586
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 13:27:54 +01:00
Noel Grandin b32caa1fde Fraction->double in SmNode
Change-Id: I92345c5087015f62502660ffbf77178765adc4b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202567
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2026-03-24 11:31:00 +01:00
Noel Grandin 6ec6259d87 Fraction->double in SdSnapLineDlg
Change-Id: I1cda893057073a9d51a991e2be6c1101a24c3435
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202566
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-24 11:30:51 +01:00
Noel Grandin 69af36db01 Fraction->double in CopyDlg
Change-Id: If57bb9ea9c39602946eeffbb6a09b8b8d3bd6c4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202565
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2026-03-24 11:30:42 +01:00