100 Commits
Author SHA1 Message Date
Michael Meeks e1b35f0bb1 sc: forward declare ScDrawView in tabview.hxx.
tabview.hxx included drawview.hxx for a std::unique_ptr<ScDrawView> member
and an accessor that returns the raw pointer. Neither needs the complete
type, and the destructor of ScTabView is already out of line. The include
dragged svx/fmview.hxx, svx/view3d.hxx, svx/svdview.hxx and the rest of the
svx view class chain into the 200 translation units that include the view
shell headers.

tabvwsh.hxx and tabview.hxx now include the small headers they used through
that chain, and the files that call into the draw view include drawview.hxx
themselves.

clang -ftime-trace says around 2% of the module build time saved here.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I198b19e74f6ad56090b987880a063dc9ee677cda
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12683
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit a7fd69666ea5fb4d26dfad0d286f6c1f3bcd3144)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211884
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-10-07 12:18:06 +02:00
Michael Meeks afea7eceec sw: forward declare SwCharFormats in doc.hxx.
Out-line the one inline: FindCharFormatByName that needed
charformats.hxx - saving ~1% of sw compile time over ~600
modules, most of the cost being boost multi_index
instantiation for SwCharFormats.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ie97b073efd225db873c7c17c7a064ef2d171b89b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12943
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 6858f88c20ed188157c5af932469a342e82bf985)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211356
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-30 08:42:34 +02:00
Michael Meeks 7b04a0a0cf sw: forward declare sw::FrameFormats in doc.hxx.
Forward declare the template and repeat the TableFrameFormats
typedef to drop the frameformats.hxx include, which gifted us
boost multi_index headers and libxml/xmlwriter.h into
every user of doc.hxx.

clang -ftime-trace suggests this is 0.75% of the sw compile.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I7863a8b59491f34d541944f252ec22ece0046b24
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12941
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit c38556dd61c5896d667767d125c59a1e2094f704)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211354
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-09-29 21:16:39 +02:00
Michael Meeks 645434b713 sc: include sheetlimits.hxx instead of document.hxx in tokenarray.hxx.
ScTokenArray only uses ScDocument through references, so the header needs
a forward declaration. The rtl::Reference<ScSheetLimits> member with the
defaulted copy constructor still needs the small sheetlimits.hxx. This
removes document.hxx from the 15 translation units that reached it only
through tokenarray.hxx, about one second of compile time each.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ie467d7297f7b02ed474114e7840e0ec52f1624aa
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12679
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 3c5d299ff6f767841bd8a781ca3ca200a8f12d2e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211315
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-09-28 21:33:17 +02:00
Michael Meeks 255d2f8d50 sw: drop the doc.hxx include from wrtsh.hxx.
wrtsh.hxx needed SwDoc only for the inline constructor of
MakeAllOutlineContentTemporarilyVisible - drop that into
wrtsh1.cxx near the guard's lock counter, and we get a free
fwd definition through editsh.hxx.

clang -ftime-trace data suggests ~2% of the sw compile time

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ie2f4baa82f83fea1ecdc4e189b93879a1ce8b3f3
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12942
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 90fd1010608bc49befeb5efe21540d006fe1f67a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211355
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-28 21:05:09 +02:00
Michael Meeks 94a89768af sc: forward declare ScDrawLayer in document.hxx.
document.hxx included drwlayer.hxx, and with it svx/fmmodel.hxx,
svx/svdmodel.hxx, svx/svdundo.hxx, svx/xtable.hxx and editeng/outliner.hxx,
in all 700 translation units that use ScDocument. The only place in the
header that needed the complete type was the inline destructor of
sc::DrawUndoGuard, which now lives in documen9.cxx next to
ScDocument::BeginDrawUndo. The ScObjectHandling enumeration, used as a
default argument of SetLayoutRTL, moves to types.hxx so that both headers
can see it.

The files that used the drawing layer or the svx model classes through this
include now include drwlayer.hxx themselves, and a few headers that relied
on the same chain for TranslateId, Idle or SvStream get the header or
forward declaration they need.

clang -ftime-trace suggests this is 6% of the sc build time.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Id723c46ef0c881428ab1d9a2e9a642713a92e79e
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12681
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 3e8fd8cd92ff57aaef5ba9d4b71933700ee3f83b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211316
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-09-22 21:02:36 +02:00
Michael Meeks a6cadf06df cool#16004 add unit test for column header detection from button rows
Cover the new behaviour in ScTable::HasColHeader: a first row whose
cells carry the autofilter or pivot table button attributes counts as
a header row even when every cell in the range is numeric, and stops
counting as one when the attribute is removed.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I2a3b8d2e704e7857c596825c4b7e855045dd920b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7743
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 338974d1513cbd8d34be3f7465998b688d6f9dbc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209259
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-18 16:40:11 +02:00
Michael Meeks 17a184f8b4 cool#16004 detect and don't include filter / pivot headers into calc sorting.
This seems to provide a very good hint that something is a header.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: If26a8e7aeceadff804d6d38c310bcab6ab26efca
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6644
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit e87f0e8c2b98e439c130e6f06d98faa61b0d0299)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209258
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-18 16:40:06 +02:00
Michael Meeks be1915d07b editeng: don't preserve escapement attribute on paragraph break.
This fixes a particuarly annoying habit of a trailing superscript
ordinal suffix getting dragged into the next bullet and causing
the unwary user weird small fonts, and non-aligned bullets.

Nail only the most obvious case, leaving multi-line superscript
in-place, and ignoring other attributes.

Include unit test.

Change-Id: I9ba5009ed17377e5c2f24c9edb74c3a1c1393cd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199203
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 03ed94560aaa20070708b265d3a551c862718bc3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204606
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-30 19:18:01 +02:00
Michael Meeks 50e0a48105 Implement translation mapper for XML content.
Loads content from a stream with this syntax:

 # list of supported bcp47 lang tags
 en-US,de-DE,fr-FR,en-GB
 # then each string
 This is a string
 [en-US] This is stil a string
 [en-GB] I say old boy, what a string

etc.

Change-Id: Id6e3c0de03f57c68246fd3eee7b4912f9adc218e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193627
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195192
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-12-08 09:42:29 +01:00
Michael Meeks d66a2686d0 Add content mapping into XFastParser.
Ideally this gets done for free in the parsing thread.

Change-Id: I2392fd51c8152c48cf03ac9ed26e6f62aa6ac4f8
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193626
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195191
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-12-08 09:42:21 +01:00
Michael Meeks d124441427 oox: share color hexification code.
Fixup various pieces from 3431c1ee1be1bd33638ffe5ff2e340a692bed9dc
prematurely merged to master with fewer adaptations.

Change-Id: Ib4a430d6d7c32f662a4b3e4f056cea1b11b3ca74
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192012
Tested-by: Jenkins
2025-10-10 12:43:25 +02:00
Michael Meeks ba1de32981 oox: add case-insensitive hex color comparison to the tests.
Change-Id: I1d0f6d5e21a27d45f1a8d3a837ff6094a9e0cf34
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192071
Tested-by: Jenkins
2025-10-09 12:37:15 +02:00
Michael Meeks f6e493a828 oox: crop ST_TextIndentLevelType to maximum value of 8.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I5994b4414a4ef79564a44a8a661498765fd4b125
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191980
Tested-by: Jenkins
2025-10-08 14:11:42 +02:00
Michael Meeks 0a8c2c1fcc oox: match bodyPr attribute ordering.
Change-Id: I26a5f73f2612b76a5fdb3af9aaebc61bb938b6ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192014
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2025-10-07 15:23:32 +02:00
Michael Meeks 995e669b87 oox: blurRad defaults to 0 in its users: outerShdw, innerShdw, and reflection
Change-Id: I681a238398b82ac85eeb2c32f09d501488394706
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192013
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2025-10-07 12:37:44 +02:00
Michael Meeks daba89f6b6 oox: don't write empty cNvPr descriptions to reduce diff noise.
Change-Id: I360dc8eb9dbfb618fff03c96d9447db21b5ddafe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191997
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-10-07 07:41:52 +02:00
Michael Meeks 5fef483cc6 oox: use a faster color hexification method with hex-in-uppercase.
This reduces the xml diff to MS' generation.

Change-Id: I10a3f1db3347d1fb06c0d823e4b5e50104318c91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191940
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 6219a5d42133048a7e384539f9454e222f96936f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191944
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2025-10-06 16:09:16 +02:00
Michael Meeks 8c582ee34d pptx: re-order animEffect and tabLst items for smaller diffs.
Change-Id: Iacc6daf63161cade51bac24d376f889915c6f1eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191945
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2025-10-06 13:14:18 +02:00
Michael Meeks 1950a7fd91 pptx export: re-order attributes to better match MSO.
This helps to minimize the diff.

Change-Id: I8a16932725094ca047350503f65c673fa85f8398
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191943
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2025-10-06 13:13:56 +02:00
Michael Meeks 0117608965 Timer - shutdown and re-start salhelper::Timer thread.
Necessary for lok background save.

Change-Id: Ib78f67f124dcd5b2a8b50c65ea58a9e1eb894ade
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182931
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 79197949d757c40f750406f59e85d6efe02bf584)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185641
2025-05-22 11:57:11 +02:00
Michael Meeks 131985e8d6 Avoid un-necessary busy timer looking to swap out images.
We can start this when we need to in a thread-safe way,
cf. Timer::Start, Task::Start etc.

Saves CPU, and better - saves debug churn and SocketPoll
wakeups in quiescent COOL instances.

Change-Id: Ib0e668702bcdfa9ffb34daf8c2a220af55dcc9d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184415
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-04-22 02:55:23 +02:00
Michael Meeks f05302c3df lok: encourage more sharing of config Node pages.
Profiles show lots of probe:do_wp_page events from things like
configmgr::Access::getUnmodifiedChild - as when we read we touch
lots of Node reference counts - un-necessarily.

So - reduce un-necessary reference counting thrash here in the
lok case through the environment variable. Quite possibly this
would also be safe and beneficial for the desktop app - needs
measurement.

measuring with coolmap and an empty hello-world.odt before & after:
before:
	unshared  3634 (14536kB)
	unshared  3631 (14524kB)
	unshared  3605 (14420kB)

after:
	unshared  3578 (14312kB)
	unshared  3613 (14452kB)
	unshared  3599 (14396kB)

Not hugely encouraging, perhaps there is another page touch
underneath we'll find when this is addressed.

Change-Id: I8ac74c5fcd17f8699139e914a7076a7848456e2a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175197
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182349
Tested-by: Jenkins
2025-02-28 15:43:40 +01:00
Michael Meeks b30c061989 SimpleReferenceObject: add ability to staticize the ref-count.
Useful for when we allocate data at startup and want to share it
across multiple threads. Also potentiall useful for turning
extreme cases of ref-count wrap-around into a more benign leak.

Change-Id: I04e6a62dbd366d294d86ab72036c3498402357f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175196
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182348
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-02-28 15:43:32 +01:00
Michael Meeks 5554fff70e vcl: better variable naming for annotating low priority idles.
Change-Id: I80dd443a864bc63b4e0214a13efdd76474daa57f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182140
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2025-02-25 12:24:56 +01:00
Michael Meeks 58249677c3 cool#4250 - add API to set per view options.
Change-Id: I5e3b3b3548ba93b96b33fe682405a2b0b53bbdee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176715
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 8dcb86a4a724f143f7d5cfcc3d1231a7f924cbd9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177445
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-11-28 15:09:27 +01:00
Michael Meeks c95b118982 lok: add SAL_DISABLE_FSYNC environment to disable fsync.
For state-less containers there is no benefit in fsync'ing,
file data is safe when it is up-loaded back to storage - but
profiling shows latency from stray fsyncs.

Change-Id: I9f03d5866dec05e5507deb56b0dca93b6876225e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167490
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 90bd45d7a96c8c7084db13e4b6f86753db67655a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172947
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2024-09-07 11:15:47 +02:00
Michael Meeks 47fbbd7c6b lok: elide various unhelpful events during background save.
In particular TEXT_SELECTION and TABLE_SELECTED seem to be favorites,
but nothing good would come of getting these others either.

Change-Id: I1f014824452bffaeddb1dfaf6565542c3c7c9e91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166158
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 95f1f2143ae53469417fcebc9b2020c34b53ff30)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172522
Tested-by: Jenkins
2024-08-28 16:15:16 +02:00
Michael Meeks 4149b79c0a lok: avoid sending jsdialog messages during background save.
This creates lots of enable/disable traffic that is no longer
needed, and may trigger a fallback to non-background-save.

Change-Id: I3dd789d13b6c28540422d99128014c9c17e00d70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166157
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit e005690e9c648ce516c1ed60da6341c7215bf2c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172521
Tested-by: Jenkins
2024-08-28 16:15:09 +02:00
Michael Meeks df27f61224 lok: add method to allow explicit cleanup of temporary files.o
Special case fast destruction of background saving children.

Change-Id: I8fba4d0818d23a8b0e1bb4d074e1afae7dacde33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165448
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 7d784910689172014b8cf6144e654402696d8801)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172520
2024-08-28 16:14:50 +02:00
Michael Meeks 4a5ab80057 lok: avoid perturbing parent background save process' temp file.
The temporary file that typically contains the content of thes
currently open document is re-written, and deleted on save. Avoid
deleting the original when we are background save worker.

Change-Id: Ibbb3a963cb3420088623994c067115ff77b96f54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165408
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 53316a6b8228885a17bf53c4fae6fe9d8ef80d2d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172519
Tested-by: Jenkins
2024-08-28 14:04:36 +02:00
Michael Meeks e4176371a0 lok: ensure our 'main thread' concept is updated post-fork.
Otherwise we fall foul of assertions and behavioral differences
around the main thread as the new forked main-thread has a
different thread-id.

Change-Id: I0bd97e5173767ac6c697326aaf0d0822037e480f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166319
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit ddeec9754cb2871a709d22efb460e141ab4c6f33)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172453
Tested-by: Jenkins
2024-08-27 11:33:17 +02:00
Michael Meeks b954a2409b Avoid excessive progress updates unconditionally.
This may make short lived progress bars somewhat more 'blocky' and less
smooth - but inevitably make loading faster, particularly for loaded
machines with ultra-beautiful, slow to render themed progress-bars.

Change-Id: I5a7e43690f5e7eff35c980cae4991376204eb5fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171503
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-06 21:48:54 +02:00
Michael Meeks c41401adeb lok: avoid excessive progress updates.
Perhaps for desktop 40 updates per second can provide a nice smooth
status experience for a full screen-width progress bar in some cases;
but it seems likely that five per second over a remote protocol
might be better.

Change-Id: Ic77b3b76d680771cb766984bdbcd9c8af4af303d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171407
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-08-05 18:52:32 +02:00
Michael Meeks b707ca9651 cool#9082 - lok: cleanup WakeUpThread before forking, then re-start.
It seems likely that this lingering briefly after various un-identified
and tough to reproduce, longer running operations in calc - which is a
big ScProgress user - caused problems with background save.

Change-Id: I1d0ec56c759dff30c48c8562b6400b57be4a25b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168033
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168052
Tested-by: Jenkins
2024-07-28 17:22:54 +02:00
Michael Meeks f9df8d71a9 lok: join Webdav Ticker thread.
Add 'startThreads' lok method for the few thread scenarios where
we need to have a background thread running that cannot be started
opportunistically.

Also add that to the ThreadJoinable interface so we can get into
UNO components' implementations to handle their worker threads
easily.

Implement joining and re-starting in WebDAV ucp too.

Change-Id: I329ef9decb32b263197e4c03a0d54952985fdd0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167858
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170979
Tested-by: Jenkins
2024-07-26 13:37:26 +02:00
Michael Meeks 7635a5eefd lok: joinThreads - take down configmgr's write-thread.
Change-Id: I1f9b6b88ef7e97da02fecf2035f953584cd28c16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170674
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-07-18 13:51:19 +02:00
Michael Meeks 7232d70476 Avoid potential negative array index access to cached text.
if ((nIndex != 0 || nLen != text.getLength()) && !skipGlyphSubsets)
	seems unlikely to protect us from this:

	/opt/rh/devtoolset-12/root/usr/include/c++/12/string_view:239: constexpr const std::basic_string_view<_CharT, _Traits>::value_type& std::basic_string_view<_CharT, _Traits>::operator[](size_type) const [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; const_reference = const char16_t&; size_type = long unsigned int]: Assertion '__pos < this->_M_len' failed.

	coolwsd[16958] ... SIG   Fatal signal received: SIGABRT code: 18446744073709551610 for address: 0x7300004e16

	SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<OutputDevice const>, rtl::OUString const&, int, int, long, vcl::text::TextLayoutCache const*)
		/home/collabora/jenkins/workspace/build_core_co-24.04_for_online_snapshot/vcl/source/gdi/impglyphitem.cxx:399
	GetTextArray(OutputDevice const&, rtl::OUString const&, KernArray&, int, int, bool, vcl::text::TextLayoutCache const*)
		/home/collabora/jenkins/workspace/build_core_co-24.04_for_online_snapshot/include/rtl/ref.hxx:128
	SwFntObj::GetTextSize(SwDrawTextInfo&)
		/home/collabora/jenkins/workspace/build_core_co-24.04_for_online_snapshot/sw/source/core/txtnode/fntcache.cxx:766
	SwSubFont::GetTextSize_(SwDrawTextInfo&)
		/home/collabora/jenkins/workspace/build_core_co-24.04_for_online_snapshot/sw/source/core/txtnode/swfont.cxx:1022
	SwTextSizeInfo::GetTextSize() const
		/home/collabora/jenkins/workspace/build_core_co-24.04_for_online_snapshot/sw/source/core/inc/swfont.hxx:314

	blind fix - but seeing a lot of these.

Change-Id: Icb6ca25e4b8c6ef8a5e5b89dfa01b56bb788378d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168539
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-07-09 17:18:53 +02:00
Michael Meeks 2456746bc2 lok: Avoid launching an un-necessary thread.
It seems this happens rather regularly with online; and yet we
are running the main-loop, seems this was introduced to allow
UNO usage without a main-loop, but this is not really our case.

    cf. commit 168a67f4b3
    Author: mm <mm@openoffice.org>
    Date:   Thu Feb 22 17:22:48 2001 +0000

        VCL without main

Change-Id: Ibd10a4966157f30557eff88c124e63ffae2e1f61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169821
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2024-07-03 05:24:17 +02:00
Michael Meeks c28bcfd7a0 WakeupThread - re-factor to have a single shared wakeup thread.
The WakeupThread is an attempt to avoid needing to call gettimeofday
and/or update a visual status bar very regularly, and to have a thread
marking the passing of time to emit progress updates infrequently.

Re-factor this to have a single time-keeping thread, so it will be
easier to shutdown and re-start for LOK; and also to simplify some
of the complexity lurking here.

Change-Id: Ia95890e5d6041a029484aa3f7df13b59a0397086
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167949
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2024-05-25 14:57:23 +02:00
Michael Meeks aaf4613a0a lok: stop amazing waste of repeated font sizes in each font element.
These days all sensible fonts are scalable, so anything else is madness.

With the compact_fonts option we go from:

    INCOMING: commandvalues: {"commandName":".uno:CharFontName","commandValues":
    {"Albany AMT":["6","7","8","9","10","10.5","11","12","13","14","15","16",
    "18","20","21","22","24","26","28","32","36","40","42","44","48","54",
    "60","66","72","80","88","96"],"Amiri":["6","7"

            <truncated 58,418 chars>

    INCOMING: commandvalues: { "commandName": ".uno:CharFontName", "FontNames":
    [ "Albany AMT", "Amiri", "Amiri Quran", "Amiri Quran Colored", "Andale Mono",
    "Andale Sans", "Andy MT", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW",
    "AR PL UMing TW MBE", "Arial",

           <truncated 6,948 chars>

An 8x size win.

Change-Id: I3dc9f5de876def6e4afc09a43105b1740f7c621f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167799
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 628f56a1802ad76cbe84a9a5590b04ed81a57a9e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167962
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-05-23 12:31:46 +02:00
Michael Meeks 9d1956031e lok: stop amazing waste of pretty-printed JSON sent over the API.
before:

INCOMING: commandvalues: {
    "commandName": ".uno:CharFontName",
    "commandValues": {
        "Albany AMT": [
            "6",
            "7",
            "8",
            "9",
            "10",
            "10.5",
            "11",
            "12",

        <truncated 199,811 chars>

after:

INCOMING: commandvalues: {"commandName":".uno:CharFontName","commandValues":
{"Albany AMT":["6","7","8","9","10","10.5","11","12","13","14","15","16",
"18","20","21","22","24","26","28","32","36","40","42","44","48","54",
"60","66","72","80","88","96"],"Amiri":["6","7"

	<truncated 58,418 chars>

A 3x size saving.

Change-Id: I574b8bdf790078c61b7605137a47a531dee16f1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167685
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2024-05-23 10:29:28 +02:00
Michael Meeks e2aab0d02e lok: dump more SfxViewShell state, and LOK notifier state on Windows.
This should help to associate the right view-ids, with the right
windows, and help to catch any stray / lingering windows from closed
sessions - hopefully.

Change-Id: I197a3280d5d2aeddd356ee037c51e4887f43278b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167765
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 8d979fae0c435b820302c76fcfdc2642b4820360)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167684
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-05-18 12:34:59 +02:00
Michael Meeks 113dabb58d lok: get faster ModifiedStatus from the core.
Gives a more responsive UI, closes a number of races, and helps us
to make better decisions, more quickly on whether to save.

Change-Id: I6e2548f06f715ba56ba75fd746273bdd57dc20dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167635
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 44e79f02241fbc213462df03a37b621cb72f9d05)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167469
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-05-15 18:16:00 +02:00
Michael Meeks 06f1787d50 lok: use of lok random hook in NSS.
This allows us to avoid opening /dev/urandom which may not be there.

Change-Id: I51727fe4a2a28be802afdf6d9ccca5a198167b7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165851
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 708663da401e1cc5c4531c8cbb3370c4cf2843d6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167670
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2024-05-15 14:37:19 +02:00
Michael Meeks fbfeb33b38 lok: Don't dump empty aria properties in every JSON element.
They simply bloat the json to no benefit if the properties are
empty, avoid serializing empty values.

Change-Id: I83c780d01820ec39acc85899d45ad9e929ad7e76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167496
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit 24876e5611abbaec9b2fe5fcbcf4be71a10ee366)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167457
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-05-11 14:27:33 +02:00
Michael Meeks b1c77f927a lok: dumpState should truncate very long JSON messages.
Otherwise we get huge dumps which can overwhelm our logging and hide
more useful information, and/or the journal can drop them on the ground.

Change-Id: Ie942c70a90a6df60ccd8986444362d622c213e15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167456
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-05-10 21:25:15 +02:00
Michael Meeks a2605a66fd lok: reseed comphelper's random number generator on fork.
Also avoid std::random_device it doesn't work in a COOL
kit process.

Change-Id: Ie2d063611a73e734afd92d6fd779f34a2f316230
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167070
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-05-07 09:51:13 +02:00
Michael Meeks b99082e4f3 lok: provide global random symbol to find random device.
This is vital for lok when used in a jail with no random device,
but with an inherited file-handle to /dev/urandom.

Use 'dup' to avoid changing code that wants to 'close' the handle
after use.

Change-Id: I15f40fb251f180a2394af030f56e47f2bf9651d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166113
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-04-15 15:28:41 +02:00
Michael Meeks c0dcd388b8 lok preinit: don't re-synchronize extensions on each child start.
We should sort out our extensions, if at all, at pre-init time.
This should save ~4% of CPU in a week-long profile of a COOL server.
From Desktop::Main's SynchronizeExtensionRepositories.

Change-Id: I2760de26635723492dfa5a52005ee90623337bee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165622
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-01 22:04:41 +02:00
Michael Meeks ccc2e526d1 lok: add isForkedChild method.
This can be used to tag short-lived transient 'save' processes
to encourage them not to mutate eg. filesystem state that is
shared with the parent process.

Change-Id: I027d18cbe4ce519b31c4fc1d3ac46b916d1efc87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165407
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 9dab5edb90d14ad6f71cc2ac96cc504c1e8c290b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165427
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-03-28 17:07:15 +01:00
Michael Meeks 52f2720af1 lok: implement a joinThreads function - to wind down thread pools.
Necessary to do this before forking on Unix systems; use a
dynamic_cast interface since this is all for internal use.

Change-Id: I8a911322acd4ec5654eb0d14804c09d513a0bd4b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163335
Tested-by: Jenkins
2024-02-14 17:29:02 +01:00
Michael Meeks ba0773e50b preload: open and close empty documents of main types in preinit.
Some quick testing suggest this saves ~800k for writer, ~3Mb for
impress each loading an ~empty hello-world document.

Change-Id: I9a7bc25d38d82b5556dfb04a99d5c145dd71ffec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162939
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit d85cb3832286ae1fdcf4a8494abb8212f21e4e9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163148
Tested-by: Jenkins
2024-02-09 12:54:46 +01:00
Michael Meeks d7bbd8363e trace events: fix deadlock from non-recursive mutex.
Release lock over s_pBufferFullCallback:
 #4  std::lock_guard<std::mutex>::lock_guard(std::mutex&)
 #5  comphelper::TraceEvent::getEventVectorAndClear()
 #6  0x00007f2367c61836 in comphelper::TraceEvent::getRecordingAndClear()
 #7  0x00007f236877263e in (anonymous namespace)::TraceEventDumper::flushRecordings()
 #8  0x00007f2367c60cb7 in comphelper::TraceEvent::addRecording(rtl::OUString const&)

regression from:
  commit c2424341ed
  Date:   Sun Jan 30 10:30:27 2022 +0100
    comphelper : use std::mutex in traceevent

Change-Id: Ic89d63d14f06d710937a4da759976ae308c9df45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161329
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-29 12:51:31 +01:00
Michael Meeks 13eb599d8b lok: async calc merge-cells popup dialog.
Change-Id: I6f7d1e8de4ac36f546706f7702157cc7e49c80b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159581
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-20 14:37:01 +01:00
Michael Meeks 2cbf54efab sc: perf: avoid construction of collector for empty note columns.
It is extremely common to have empty note columns; so shorten this
path profile in: cool#7334

Change-Id: Ibfd550be1a5e8e98df8b4ede0d018c4f85300648
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158158
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-20 17:17:54 +02:00
Michael Meeks 1fbf566ad0 lok: avoid forcing expensive re-layout of the calc input bar.
This occured on doc_setView and was unreasonably expensive - loading and
de-compressing new PNGs as multiple users typed, re-sizing and
re-rendering a toolbar that is not visible -> do nothing here.

cf. cool#6893.

Change-Id: I1980a3a4516fb2aa629da85de9d4628f29de5af7
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156270
2023-08-30 10:00:00 +02:00
Michael Meeks 6fc48879f8 trimMemory - fix crash modifying structure during clear.
Re-use existing code from shutdown, to avoid ~Bitmap mutating
maScaleCache while we're iterating it inside clear.

Change-Id: I021d9075cf5c449702af091c2c8a4de64887f2ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152769
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2023-06-09 16:33:40 +02:00
Michael Meeks b3768c69c2 perf: surprising to see getenv on a profile.
Change-Id: Id97c77d4c836e4f3c5a9eff6da07eb52d29248c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152105
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2023-05-23 23:15:27 +02:00
Michael Meeks 2a1e767179 perf: surprising to see PDF being vsprintf'd during JSDialog rendering.
Avoid some hundreds of these:

_cairo_pdf_surface_show_page
...
cairo_surface_destroy
CairoTextRender::CairoTextRender

via.

SvpCairoTextRender: :SvpCairoTextRender(SvpSalGraphics&)
SvpSalGraphics: :SvpSalGraphics()
Change-Id: Ieefb65138f7e685f09dbf4c36a2fccd39b4b05cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152173
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-23 22:13:34 +02:00
Michael Meeks 0f2581204a BinaryDataContainer swap out implementation.
We can easily accumulate a large number of in-memory graphic
objects, and swapping these as well as the un-compressed
images can become important.

For now we swap out the container when the image is swapped
out, however it seems unlikely it will ever need to be swapped
in again.

Despite the shared pImpl, we retained the reference counting
on the underling vector to keep this immutable while we hand
out a MemoryStream reference to it.

Change-Id: Ib7ca45afb8499460b1852461f7c11afca3f3cdfa
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151359
Tested-by: Jenkins
2023-05-05 18:47:03 +02:00
Michael Meeks c55d558630 BinaryDataContainer: hand out shared_ptr's to SvStreams.
Hide the SvMemoryStream implementation detail better - this
could be served from a file in future. Also couple lifecycle
of the SvMemoryStream to the vector backing it.

Change-Id: Ia9b28b57b8df4ce57286effd4d1753bf345fc10e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149917
Tested-by: Jenkins
2023-04-13 22:24:18 +02:00
Michael Meeks 689f0da67b BinaryDataContainer: pure re-factor - encapsulate cbegin/cend
Change-Id: Ic8dbf0afdb96a0f1be210eedfbd12ef6467dd29f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149916
Tested-by: Jenkins
2023-04-13 22:22:47 +02:00
Michael Meeks 15f0fd0634 lok: trim glibc allocator's pending heap when called.
Change-Id: I8d1bda01a0e6ccff0fa868013c67c0fbbf78a836
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150299
Tested-by: Jenkins
2023-04-13 10:45:38 +02:00
Michael Meeks 1ed50bb714 lok: avoid painting writer windows to a giant virtual-device.
When layout changes, we don't want to immediately redraw lots of
windows; we should be able to wait for tiles to be rendered
instead. Certainly we don't want to allocate a giant virtual
device.

Unfortunately we also believe that full document invalidations
are cheap - so warn about that.

Change-Id: Ib56320d4860c4b6f4e100b30cc6d3e490a1c7a90
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149601
Tested-by: Jenkins
2023-04-07 18:43:19 +02:00
Michael Meeks 0bd949f441 BinaryDataContainer: pure re-factor to encapsulate stream copying.
Change-Id: Iab24e8d18bf7badbca672fbdbf455f78d08f41a0
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149905
Tested-by: Jenkins
2023-04-03 10:30:10 +02:00
Michael Meeks 4a4602ad75 lok: add trimMemory capability, and expand dumpState to caches.
Being able to trigger some more aggressive memory saving is
useful in for both online and mobile.

Change-Id: I9b91c9fe9eecec06c75112595deac0bfeb94c144
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148624
Tested-by: Jenkins
2023-03-11 21:03:05 +00:00
Michael Meeks 950ad392c8 tilebench: allow save after rendering, and better load fail diagnostic.
Change-Id: I24df1a42b1d3e991a430cf0ca25e9dc53b4bbff2
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148674
2023-03-11 14:40:03 +00:00
Michael Meeks 5a41b0a42a Avoid running graphics tests when in lok mode.
Best to avoid allocating and freeing 64Mb of RAM, and
burning lots of CPU doing CPU rendering on an invisible
for each document loaded through lok API.

Change-Id: I656b400159b9d6a7a9f2c79d188e3aec9b3dd0e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148258
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2023-03-07 08:34:25 +00:00
Michael Meeks 50a08d1eb4 tdf#148434 - avoid strange OS/X deadlock around AnyInput.
Apparently calling AnyInput on Mac and filtering for just input, gives
you window creation / re-sizing events which then trigger idle paint
events which then deadlock if called with the scheduler lock.

Try having a little more inefficiency and a different race for
this case to handle the Mac world.

Change-Id: I9985eaf18f8d0ba4d44e83c03746510a6ba6d664
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-20 09:21:51 +00:00
Michael Meeks 39ffd24645 lok: protect sc from null ScViewData.
Working hypothesis is this happens after a failed spreadsheet
load, or from a race during load.

<crash>
ScModelObj::getPartInfo(int) sc/source/ui/unoobj/docuno.cxx:602
doc_getPartInfo desktop/source/lib/init.cxx:3531
...
KitSocketPoll::kitPoll(int)   coolforkit
SvpSalInstance::DoYield(bool, bool) vcl/headless/svpinst.cxx:492

Change-Id: I06870336d4e64ebfc69bce64e280821c25e1b1e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144308
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-12-16 16:55:21 +00:00
Michael Meeks 254e56c0c0 jsdialog: white-list calc group/un-group & row/col metric dialogs.
They're simple dialogs, and are testd.

Change-Id: I5a34314f57e058bc66a718c1e85ed52b265752e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143262
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-11-25 22:15:13 +01:00
Michael Meeks d4b5689c18 sc: make InsertCell and DeleteCell async.
Also enable them for use with jsdialogs.

Change-Id: I378f228e86959edb98ad691089af919330dcdcec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142144
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-11-02 15:19:00 +01:00
Michael Meeks da6a1a05b2 basic: s/helt/held/ and some cleanup.
Change-Id: Idebd2eef29230056caa605c79028e46d34891c44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141485
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-10-18 01:05:59 +02:00
Michael Meeks c0ce606701 basic: correct reference to method that doesn't exist.
Apparently not there in basic from prior to its open-sourcing.

Change-Id: I9b2da35abfc9971ee380c68f33e239fe63b381c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141483
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-10-18 00:55:50 +02:00
Michael Meeks a71a5cdb97 lok: add dumpState feature for better in-field diagnostics.
Always suspicious that some un-expected dialog / state can cause
strange behavior in a client. An initial cut at an API to make it
easier to unwind such problems by exposing the toolkit state.

Change-Id: If8f17943fa4837df4f9ca659a111dcdce5c23244
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137504
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-07-28 14:49:19 +02:00
Michael Meeks a4acae686c lok: skip app background rendering for lok case.
this is/was mis-placed and tends to make a mess of large sheets'
tiles close to the bottom at ~2^20 rows.

Change-Id: Iac0977d58428707ff56c0ac30a7740c0ed0b27c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136866
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-07-08 12:25:51 +02:00
Michael Meeks 170a2b9da7 tdf#90837 - clarify the error message re: over-writing readonly files.
Change-Id: I757b29574526882da6e307cef51dfa70f6a1c4bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136833
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-07-06 10:30:07 +02:00
Michael Meeks 4140154fe7 opencl: no need for unhelpful nullptr OUString * case.
Change-Id: I0b3cad2247706901e1a6b9c3df7fbbc9f23ff987
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136816
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-07-06 10:29:45 +02:00
Michael Meeks 92f5312096 fix build with disable-avmedia.
Change-Id: Ia57db9b2bcec4ff73e1332bb5b2197080343baa4
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136831
Tested-by: Jenkins
2022-07-05 18:04:31 +02:00
Michael Meeks 3d347d1e78 Avoid segv when co-editing around SvxColorTabPage.
vcl::Window::ImplCallDeactivateListeners(vcl::Window*)
		vcl/source/window/window.cxx:3403 (discriminator 2)
	vcl::Window::ImplCallDeactivateListeners(vcl::Window*)
		vcl/source/window/window.cxx:3404
	...
	vcl::Window::ImplCallDeactivateListeners(vcl::Window*)
		vcl/source/window/window.cxx:3404
	vcl::Window::ImplAsyncFocusHdl(void*)
		include/rtl/ref.hxx:112
	...
	Dialog::Execute()
		vcl/source/window/dialog.cxx:1056
	virtual thunk to SalInstanceDialog::run()
		vcl/source/app/salvtables.cxx:4924
	AbstractSvxNameDialog_Impl::Execute()
		cui/source/factory/dlgfact.cxx:222
	SvxColorTabPage::ClickAddHdl_Impl(weld::Button&)
		include/rtl/ref.hxx:192

Change-Id: I12a78d65a8e7b8b728dde84f7c51cc19005c9aa6
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131353
Tested-by: Jenkins
2022-03-15 10:41:19 +01:00
Michael Meeks 7b7ed248c4 boost: use utf-8 encoding for unknown locales.
More exotic locales like es-419 cannot be parsed by boost, so we
fall-back to the default encoding. This avoids an exception:
invalid_charset_error of the form:

"Invalid or unsupported charset:us-ascii or UTF-8"

for this case.

Change-Id: I6796dd893ec774b221956ea9febbcc19495d47b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130102
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-02-18 12:35:49 +01:00
Michael Meeks 1eab80a049 boost / gettext warning improvement.
std::runtime_exception of:
	"Invalid or unsupported charset:UTF-8 or UTF-8"

is less useful than it could be when spat out from the boost gettext
impl. Survive for the next (and probably more useful) exception.

Change-Id: Ibeb60b4a34f09f47051844c3e8048f38618d0e05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129566
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-02-07 19:44:50 +01:00
Michael Meeks 0d32a186d6 lok: avoid reundant progress bar messages.
Change-Id: I9e04f428dbfafd98d1b08a549bb2758b9cc60eff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128674
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-01-20 22:11:26 +01:00
Michael Meeks fc66855f1a sc: ubsan - initialize D&D pointers properly.
Change-Id: I95c6a9b55ed25cc6d51f9f4544cb9fc016bbec64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128672
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-01-20 20:19:09 +01:00
Michael Meeks 02634fb7c7 lok: avoid duplicate emission of statechanged: messages.
We tend to get many of these per keystroke, with the same state.

Change-Id: I9d759f54aee8d6dabcef094997e8f352dd608ec3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128539
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-01-20 12:06:32 +01:00
Michael Meeks 2584950681 lok: avoid duplicate notification of tab-stop and ruler changes.
We get far too many of these, one per key-stroke sometimes.

Change-Id: Ifecffe0a82c6eef6809e3a49883bb3f17cb4d170
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128535
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-01-19 15:09:34 +01:00
Michael Meeks 7ba99b8d6d lokit: double check for disposed windows & fix leak.
it seems we can get windows disposed before we get to the emission.

<segv>
vcl::Window::IsTracking() const vcl/source/window/window2.cxx:341
(anonymous namespace)::LOKPostAsyncEvent(void*, void*) sfx2/source/view/lokhelper.cxx:725
LokChartHelper::postMouseEvent(int, int, int, int, int, int, double, double) include/rtl/ref.hxx:112
SwXTextDocument::postMouseEvent(int, int, int, int, int, int) sw/source/uibase/uno/unotxdoc.cxx:3561

Change-Id: I93aea931dad1e7f43d3d610568424c53d2b22fbc
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127907
2022-01-04 15:44:38 +01:00
Michael Meeks 365b3f1f21 Crash around help-windows.
Seems a popular way to crash:
	vcl::Window::ImplCallMove()
		vcl/source/window/event.cxx:555
	vcl::Window::Show(bool, ShowFlags) [clone .localalias]
		/usr/include/c++/10/bits/unique_ptr.h:173
	vcl::Window::Show(bool, ShowFlags)
		vcl/source/window/window.cxx:2345
	HelpTextWindow::ImplShow()
		vcl/source/app/help.cxx:371
	Scheduler::ProcessTaskScheduling()
		vcl/source/app/scheduler.cxx:495

Change-Id: I33ca0059844395c41f4d76619cca22aec81df207
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125710
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-11-23 17:37:07 +01:00
Michael Meeks 4eb4057ab3 Crash when fetching clipboard data.
Seems like some unusual corner-case around HTML export.

	sw::DocumentContentOperationsManager::CopyImplImpl(SwPaM&, SwPosition&, bool, SwPaM*, bool) const
		/sw/source/core/doc/DocumentContentOperationsManager.cxx:5068
	sw::DocumentContentOperationsManager::CopyImpl(SwPaM&, SwPosition&, bool, SwPaM*, bool) const
		/sw/source/core/doc/DocumentContentOperationsManager.cxx:4609
	sw::DocumentContentOperationsManager::CopyRange(SwPaM&, SwPosition&, bool, bool, bool) const
		/sw/source/core/doc/DocumentContentOperationsManager.cxx:1936
	SwEditShell::CopySelToDoc(SwDoc*)
		/sw/inc/pam.hxx:193 (discriminator 2)
	SwFEShell::Copy(SwDoc*, rtl::OUString const*)
		/sw/source/core/frmedt/fecopy.cxx:224
	(anonymous namespace)::lclOverWriteDoc(SwWrtShell&, SwDoc&)
		/sw/source/uibase/dochdl/swdtflvr.cxx:413
	SwTransferable::GetData(com::sun::star::datatransfer::DataFlavor const&, rtl::OUString const&)
		/include/sfx2/objsh.hxx:866
	TransferableHelper::getTransferData2(com::sun::star::datatransfer::DataFlavor const&, rtl::OUString const&)
		/include/com/sun/star/uno/Type.h:121
	TransferableHelper::getTransferData(com::sun::star::datatransfer::DataFlavor const&)
		/include/rtl/ustring.hxx:438
	getFromTransferrable.isra.0
		/include/com/sun/star/uno/Any.hxx:151
	encodeImageAsHTML
		/desktop/source/lib/init.cxx:4382
	doc_getTextSelection

Change-Id: I1af52d827ebdc9bbc5278f56547d1b3fd1b87e7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125454
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-22 08:23:51 +01:00
Michael Meeks ab281c561f vcl: avoid native widget pieces for disposed BorderWindow.
Fixes crash around help windows:
	vcl::Window::IsCompoundControl() const
		vcl/source/window/window2.cxx:1200
	vcl::Window::Show(bool, ShowFlags)
		vcl/source/window/window.cxx:2243 (discriminator 3)
	vcl::Window::Show(bool, ShowFlags)
		vcl/source/window/window.cxx:2298
	HelpTextWindow::ImplShow()
		vcl/source/app/help.cxx:371
	Scheduler::ProcessTaskScheduling()
		vcl/source/app/scheduler.cxx:495

Change-Id: Ia0205813f3e9d306314577d59d6cdd1bdfa0ee71
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119854
Tested-by: Jenkins
2021-08-03 16:59:24 +02:00
Michael Meeks c7b9f477f6 vcl: check mpWindowImpl for nullptr.
Crash in calc's mouse capture / end tracking.

Change-Id: If5b4cded8ebfc04d1fcf645a7b74184532ab2338
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119034
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-07-16 16:55:00 +02:00
Michael Meeks 303c46e239 vcl: make get_id safe for disposed windows.
crash from:
	findChild(vcl::Window*, rtl::OUString const&, bool)      include/rtl/ustring.hxx:1744
	WindowUIObject::get_visible_child(rtl::OUString const&)  /vcl/source/uitest/uiobject.cxx:463
	lcl_sendDialogEvent ...

Change-Id: Ic1756c7b03f2dee9780fb1a735917f1d0fc11876
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118691
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-13 15:46:52 +02:00
Michael Meeks 4c267311ed pdf import: handle out of memory / failure to duplicate page.
Avoid some reported segv's from null pages.

Change-Id: Ic336b36fb57dc70fff183cd5aa5f3f3ef4562674
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117855
Tested-by: Jenkins
2021-06-25 16:11:41 +02:00
Michael Meeks 177167dcff lok: allow .uno:JumpToMark.
Change-Id: I0cd3173c94c6952bd5cf81474a7cc31b1585e50e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117646
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-23 18:23:33 +02:00
Michael Meeks ffc5d0fe1a lok: force writer web-view off.
A number of callers mutate this, so make the setting un-writable.

Change-Id: I0a3727020309b92543e42730c997168f076e7bfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114177
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-04-16 18:06:02 +02:00
Michael Meeks f960040962 lok: mark strings static after pre-init, not after the fork.
Change-Id: I1fbd4a9ef1e07ec87ca194128ed35de1dc429993
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113127
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-03-26 20:42:35 +01:00
Michael Meeks 40c58f6039 lok: avoid a set of invalidations per view on re-size.
Unfortunate to have N^2 invalidations in the number of views on
resize - particularly for calc, when you re-size/wrap-text on a
row during editing.

Change-Id: I93f75c4543ad072684e5575a2cbe0e8abcab0d80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109913
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112094
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-03-11 17:06:14 +01:00
Michael Meeks b1a5dd9f30 lok: sc - suppress LOK editengine events for the calc input bar.
The calc input uses an EditEngine - but it emits events as if it is
part of the document - as well as emitting events as if it is a dialog
window. This causes horrible jumping artifacts to the top of the
document with word auto-completion and typing in cells a few page down.

Also remove obsolete tweak to turn off autocorrect for LOK, since
it was contradicted by: 1f0943e5e9432f96daff9f3b006388d5bc7415b2

Change-Id: I7352cd3b5ca6d18645cfd9e18959b0e44ec969d7
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110422
Tested-by: Jenkins
2021-03-02 11:18:32 +01:00
Michael Meeks edf8d6ff10 lok: mark calc document as modified when adjusting split-panes.
Change-Id: I592ee4dc4317f27fae24141b2052475ef26e9fc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111582
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-02-26 14:50:51 +01:00