Commit graph

500685 commits

Author SHA1 Message Date
László Németh
270c96e12c tdf#163575 sw smart justify: fix size resolution for SwBidiPortion
Negative space sizes (i.e. shrunk lines at image wrapping) stored
over LONG_MAX/2, and these values had no resolution in SwBidiPortion,
causing crash/assert in conversion of DOCX document containing e.g.
Arabic text wrapping around images.

Note: apply the resolution in SwDoubleLinePortion, too.

Regression since commit 1fb6de0270
"tdf#163149 sw smart justify: fix line shrinking at image wrapping".

Change-Id: I6e45592c4eed247871d35e1f02fd5a038baddf85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175419
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
2024-10-22 23:11:28 +02:00
Xisco Fauli
a07b4b432f tdf#163486: PVS: Expression is always true
V560 	A part of conditional expression is always true: pNumFormat.
V560 	A part of conditional expression is always true: pNumFormat != nullptr.

Change-Id: I6c780fa67bd65da06cfdde37d34eda93bb4ab13c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175445
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 23:04:55 +02:00
Bogdan Buzea
a9b36e7af4 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 341, 345, 348
V1037 Two or more case-branches perform the same actions. Check lines: 481, 487
V1037 Two or more case-branches perform the same actions. Check lines: 689, 700

Change-Id: Ib9f4b8047f7706667f79de0170a672818ffd9030
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175346
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 21:36:40 +02:00
Caolán McNamara
746f66f4b1 cid#1607748 Overflowed constant
Change-Id: Id077fdc914f461a3631c42c37b2d5be37632e0e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175374
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-22 20:37:17 +02:00
Bogdan Buzea
661aee7aac tdf#163486: PVS: Identical blocks
V760 Two identical blocks of text were found. The second block begins from line 325.

Change-Id: I5854337d4d1c0d946b096804b536433c48f0696f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175381
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-10-22 19:34:34 +02:00
Noel Grandin
686b968ec3 pass by reference for ShouldDownscaleIconsAtSurface
because the param is never null

Change-Id: I58660a9e4e6c25def2a70099bffce322b477b702
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175415
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-22 19:31:28 +02:00
Caolán McNamara
ee4554b0ac cid#1555259 COPY_INSTEAD_OF_MOVE
and

cid#1555264 COPY_INSTEAD_OF_MOVE
cid#1555280 COPY_INSTEAD_OF_MOVE
cid#1555303 COPY_INSTEAD_OF_MOVE
cid#1555313 COPY_INSTEAD_OF_MOVE
cid#1555314 COPY_INSTEAD_OF_MOVE
cid#1555323 COPY_INSTEAD_OF_MOVE
cid#1555333 COPY_INSTEAD_OF_MOVE
cid#1555338 COPY_INSTEAD_OF_MOVE
cid#1555349 COPY_INSTEAD_OF_MOVE
cid#1555364 COPY_INSTEAD_OF_MOVE
cid#1555379 COPY_INSTEAD_OF_MOVE
cid#1555398 COPY_INSTEAD_OF_MOVE
cid#1555410 COPY_INSTEAD_OF_MOVE
cid#1555411 COPY_INSTEAD_OF_MOVE
cid#1555416 COPY_INSTEAD_OF_MOVE
cid#1555429 COPY_INSTEAD_OF_MOVE
cid#1555434 COPY_INSTEAD_OF_MOVE
cid#1555441 COPY_INSTEAD_OF_MOVE
cid#1555446 COPY_INSTEAD_OF_MOVE
cid#1555480 COPY_INSTEAD_OF_MOVE
cid#1555490 COPY_INSTEAD_OF_MOVE
cid#1555524 COPY_INSTEAD_OF_MOVE
cid#1555527 COPY_INSTEAD_OF_MOVE
cid#1555531 COPY_INSTEAD_OF_MOVE
cid#1555578 COPY_INSTEAD_OF_MOVE
cid#1555581 COPY_INSTEAD_OF_MOVE
cid#1555591 COPY_INSTEAD_OF_MOVE
cid#1555614 COPY_INSTEAD_OF_MOVE
cid#1555619 COPY_INSTEAD_OF_MOVE
cid#1555633 COPY_INSTEAD_OF_MOVE
cid#1555654 COPY_INSTEAD_OF_MOVE
cid#1555707 COPY_INSTEAD_OF_MOVE
cid#1555712 COPY_INSTEAD_OF_MOVE
cid#1555746 COPY_INSTEAD_OF_MOVE
cid#1555763 COPY_INSTEAD_OF_MOVE

Change-Id: Ibcc1a3649c5663328e60474c06e51902aa74db52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175407
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-22 17:53:07 +02:00
Miklos Vajna
4aa8d30c09 cool#9992 lok doc sign: never remember previous .uno:Signature params
Do this explicitly, so it can't happen that .uno:Signature with params
gets dispatched, then .uno:Signature without params still has the old
XCertificate.

Change-Id: I35c4d5e0e4545fb1aabb9050aa6b11cd10c3ca85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175414
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2024-10-22 17:21:27 +02:00
Julien Nabet
b2d35dfe19 tdf#163284: Diagonal/criss-cross borders for tables is only implemented in Calc
Change-Id: I645fd2a6fafb2607d94607599366d9442b4423fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175199
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2024-10-22 17:14:02 +02:00
Michael Weghorn
c8371b5f1a a11y: Return early in AccessibleFactory::createAccessibleContext
Return the XAccessibleContext reference right away, instead
of assigning it to a local variable and returning at the end
of the method.

Change-Id: Iec47f4158dd40c25482366c33ed4a4642709f641
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175405
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-22 15:42:52 +02:00
Michael Weghorn
51a482bc04 a11y: Return early in AccessibleTabBar::getAccessibleAtPoint
Just return `xAcc` right away instead of first assigning it to
a local variable.

Change-Id: If11c88266b4ec72b2d5d927e3f28a14bf0cdc304
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175404
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-22 15:42:46 +02:00
Bogdan Buzea
f85366c407 tdf#163486: PVS: Identical branches
Since
commit 97075a384a
Author: Michael Brauer <mib@openoffice.org>
Date:   Wed Oct 24 13:16:17 2001 +0000

    #91961#: Support of language

V1037 Two or more case-branches perform the same actions. Check lines: 1462, 1465

Change-Id: Ie27fb47ec7e22b9dbe9a2338c661c261bea8926b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175383
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 14:30:26 +02:00
folandidi
33ca469ee6 tdf#143148: Use pragma once instead of include guards
Change-Id: I798ffbdf9acd44ba45cebc0a5c41249fd53c49bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175035
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
2024-10-22 14:06:42 +02:00
Javiya Vivekkumar Dineshbhai
e4da2a54aa lok: fix repeat slideshow after duration issue
Change-Id: I0b84d003ab3345bc89482e9940a4f0d11f33e427
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175379
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-10-22 13:29:00 +02:00
Xisco Fauli
f558eb09dc tdf#163486: PVS: check stream read instead of EOF
V1024 	The 'aStream' stream is checked for EOF before reading from it, but is not checked after reading. Potential use of invalid data.

Change-Id: I4f7b10bc896d13a31a97ed0dbacd413de990eb89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175363
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-22 12:43:28 +02:00
Noel Grandin
75d6fd0913 tdf#163516 Draw fails to restore Layer data Title and Description
regression from
    commit c7b7153213
    Author: Noel Grandin <noelgrandin@gmail.com>
    Date:   Fri Nov 20 14:24:51 2020 +0200
    fastparser in SdXMLLayerContext

Change-Id: I0db381fbd383efd23bb254703bea103ca0d270d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175378
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-10-22 12:37:13 +02:00
Bogdan Buzea
993c872606 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 1241, 1244. Also, 1247 and 1251.

Change-Id: Ibf474d045ae52bc0d7f655143e72117c29736dfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175206
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 12:14:48 +02:00
Bogdan Buzea
14a3ed6149 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 1048, 1053

Change-Id: I24f2b4698ff8c0d57aa81b57b42a847caa6c1aeb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175360
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 12:14:06 +02:00
Bogdan Buzea
9bcd990d5a tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 628, 638

Change-Id: I0979a4c245c2b550ab85072f3925082845f0915a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175352
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 12:09:48 +02:00
Bogdan Buzea
6884f6cd61 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 692, 695

Change-Id: I7a7b321b10437897b285c31403aee908da8cd929
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175343
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 12:09:01 +02:00
Bogdan Buzea
35e2aa6204 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 717, 733

Change-Id: I57fc125abb8c9a4c9dea197945f45b95b90e41b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175320
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-22 12:08:25 +02:00
Bogdan Buzea
eff1137fd2 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 627, 632, 636

Change-Id: If0f4f4da0d51389c12607770af58f4e34f3caafc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175353
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 12:05:35 +02:00
Bogdan Buzea
c91b61da00 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 674, 677
V1037 Two or more case-branches perform the same actions. Check lines: 690, 693

Change-Id: I7d9ac7ed40c6eaec4d8c6b5df0ed4299beae2f7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175345
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 12:02:29 +02:00
Bogdan Buzea
a66a69795b tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 50, 53

Change-Id: I909c0b5b219d5868a1a0197314f499e0253b3293
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175388
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 11:59:59 +02:00
Bogdan Buzea
b5b2291366 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 465, 472
V1037 Two or more case-branches perform the same actions. Check lines: 497, 505

Change-Id: I826e2236100727f19bb60662dc7145e8e4814421
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175389
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-22 11:59:32 +02:00
Bogdan Buzea
92bc85c422 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 1413, 1553

Change-Id: I6b28e9d7055bdf120759dff38d869d1cb1e70cc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175271
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-22 11:57:36 +02:00
Miklos Vajna
47fd29a318 cool#9992 lok doc sign: allow late-init of the sign cert
The current setup is that doc_initializeForRendering() gets the signing
key/cert earlier, even if no signing will be performed for this
document.

This has the downside that we needlessly share sensitive info.

Add an alternative way so to only share the sign key/cert when the
.uno:Signature command gets dispatched. This works similarly well for
the signing, but this way the private info is only shared when we
actually use it.

The .uno:Signature UNO command brings up the interactive dialog on
success, so it's not easy to cover this from CppunitTest_sfx2_doc.
Anyhow, the format for these two parameters is PEM, i.e. base64 dump of
the data, with the usual markers to show which one is the key and the
cert.

Change-Id: Ib424a1a490a3eb4aab35bc70a50791fc0d400920
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175373
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2024-10-22 11:56:52 +02:00
Caolán McNamara
2bafc7384b cid#1545605 COPY_INSTEAD_OF_MOVE
and

cid#1545841 COPY_INSTEAD_OF_MOVE
cid#1554682 COPY_INSTEAD_OF_MOVE
cid#1554686 COPY_INSTEAD_OF_MOVE
cid#1554715 COPY_INSTEAD_OF_MOVE
cid#1554750 COPY_INSTEAD_OF_MOVE
cid#1554759 COPY_INSTEAD_OF_MOVE
cid#1554770 COPY_INSTEAD_OF_MOVE
cid#1554779 COPY_INSTEAD_OF_MOVE
cid#1554794 COPY_INSTEAD_OF_MOVE
cid#1554800 COPY_INSTEAD_OF_MOVE
cid#1554826 COPY_INSTEAD_OF_MOVE
cid#1554836 COPY_INSTEAD_OF_MOVE
cid#1554862 COPY_INSTEAD_OF_MOVE
cid#1554865 COPY_INSTEAD_OF_MOVE
cid#1554872 COPY_INSTEAD_OF_MOVE
cid#1554883 COPY_INSTEAD_OF_MOVE
cid#1554906 COPY_INSTEAD_OF_MOVE
cid#1554921 COPY_INSTEAD_OF_MOVE
cid#1554926 COPY_INSTEAD_OF_MOVE
cid#1554946 COPY_INSTEAD_OF_MOVE
cid#1554956 COPY_INSTEAD_OF_MOVE
cid#1554970 COPY_INSTEAD_OF_MOVE
cid#1554986 COPY_INSTEAD_OF_MOVE
cid#1554991 COPY_INSTEAD_OF_MOVE
cid#1555013 COPY_INSTEAD_OF_MOVE
cid#1555037 COPY_INSTEAD_OF_MOVE
cid#1555050 COPY_INSTEAD_OF_MOVE
cid#1555057 COPY_INSTEAD_OF_MOVE
cid#1555066 COPY_INSTEAD_OF_MOVE
cid#1555067 COPY_INSTEAD_OF_MOVE
cid#1555083 COPY_INSTEAD_OF_MOVE
cid#1555097 COPY_INSTEAD_OF_MOVE
cid#1555135 COPY_INSTEAD_OF_MOVE
cid#1555140 COPY_INSTEAD_OF_MOVE
cid#1555146 COPY_INSTEAD_OF_MOVE
cid#1555148 COPY_INSTEAD_OF_MOVE
cid#1555149 COPY_INSTEAD_OF_MOVE
cid#1555155 COPY_INSTEAD_OF_MOVE
cid#1555157 COPY_INSTEAD_OF_MOVE
cid#1555168 COPY_INSTEAD_OF_MOVE
cid#1555195 COPY_INSTEAD_OF_MOVE
cid#1555196 COPY_INSTEAD_OF_MOVE
cid#1555237 COPY_INSTEAD_OF_MOVE

Change-Id: I90531c19c28dca77fe99c72efdfc0972c311da98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175377
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-22 11:56:02 +02:00
Caolán McNamara
28c187c8f9 cid#1606773 Check of thread-shared field evades lock acquisition
Change-Id: Ia1d9d91f1ca76e5fcf311c51fc560a41e72338d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175376
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-22 11:55:53 +02:00
Caolán McNamara
7c76f39129 cid#1607845 silence Overflowed constant
Change-Id: I97af2c10eab0ecc3c00416e1e7263b779964def8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175375
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-22 11:55:20 +02:00
Noel Grandin
ce27c72729 no need to cache GraphicAttr in SdrGrafObj
just retrieve the data when we need it, avoids marking
this object dirty unnecessarily

Change-Id: Ic3455e782365e8f2d3b89d8e5052da9d7bdaba2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175371
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-22 11:44:10 +02:00
Jaume Pujantell
02d1b4923a sc: change how .uno:FreezePanesColumn/Row get the index
On commit "sc: fix freeze row/column panes"
44362e5886 the type of FreezePanesColumn and FreezePanesRow was changed from Int32 to Point. Since then, calls
trying to set the frozen panes with this commands sending an index fail,
setting the index to 1.

This change allows again a way to set them passing only an index of type
Int32.

Change-Id: I9de12af5ec7dbb4e49b057c7c19c063424265581
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174825
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 3eec1925788387c7c5996052388f3fcac518dfe7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174956
Tested-by: Jenkins
2024-10-22 10:33:42 +02:00
Caolán McNamara
235c230cd3 We don't need a virtual here
Only known SdPages need this

Change-Id: Id504cd1ec318fa8cce43d11f03c628e7457f7634
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175369
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-22 09:17:02 +02:00
Caolán McNamara
030cca8864 drop newly unused Broadcast argument
Change-Id: I80b4689bb6fe48e37217d5eb45007326672303fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175362
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-22 09:16:52 +02:00
Noel Grandin
19bc8856c4 move vcl::DeleteOnDeinit to tools
so we can fix a shutdown use-after-free in sot.

Change-Id: I32f83bd94627d72d7bee7ea2ebd6ab77a7f78435
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175335
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-22 08:01:19 +02:00
Noel Grandin
76319347a8 set stylesheet parent at creation time
avoids a bunch of broadcasting.

a similar mega-master-page scenario as reported in tdf#158773

9.1 - 7.0s

Some re-ordering of SVG output occurs, which means
tweaking some unit tests.

Change-Id: I447a4639a96c12c627a074f7e0f1ede8b3cbaf72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175299
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-22 08:01:03 +02:00
Michael Weghorn
620b293808 tdf#152534 Win 11 Dark: Draw toolbar button bg + frame manually
When using the dark theme on Windows 11, the background
color for toolbar buttons is light blue as with the light
theme, which results in insufficient contrast.

According to the comments in tdf#152534, this is
is a in the Windows dark theme which can also be seen in
other apps or has been worked around there, like in
Notepad++ [1].

Work around the issue by not letting the theme draw the
background (using Win API function `DrawThemeBackground`)
when on Windows 11 and using dark theme, but manually draw
the background and a frame instead for now.

For the background color, use a color that's a bit
lighter than the background color for non-highlighted
items.

[1] 5d086f93a8

Change-Id: Ie35937fde2e8c7078c4979a2ef60c28fc4679574
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175334
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-10-22 07:20:34 +02:00
Michael Weghorn
162ef484df tdf#161625 Use SolarMutex instead of std::mutex in ExtMgrDialog
Instead of using a custom (non-recursive) std::mutex in the
extension manager dialog, hold the (recursive) SolarMutex instead.

As the backtrace in attachment 197155 in tdf#161625 (s.a. below)
shows, a recursive mutex is needed:

dp_gui::ExtMgrDialog::TimeOutHdl (frame 17) locks the mutex, then
dp_gui::ExtMgrDialog::startProgress (frame 6) wants to lock it
again, causing a deadlock.

(Switching ExtMgrDialog::m_aMutex to be a std::recursive_mutex
could be an alternative, but follow the common pattern of holding
the SolarMutex while doing UI stuff instead.)

Somewhat similar commit:

    commit 406a7e9d45
    Date:   Wed Jul 10 12:46:50 2024 +0200

        fix locking in UpdateRequiredDialog

Backtrace of deadlock:

    #0  0x00007f883f6adc70 in ?? () from /usr/lib/libc.so.6
    #1  0x00007f883f6b4b01 in pthread_mutex_lock () from /usr/lib/libc.so.6
    #2  0x00007f87f3ea068e in __gthread_mutex_lock (__mutex=0x5782aab26e48) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/x86_64-pc-linux-gnu/bits/gthr-default.h:762
    #3  std::mutex::lock (this=0x5782aab26e48) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/std_mutex.h:113
    #4  std::unique_lock<std::mutex>::lock (this=<optimized out>) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_lock.h:147
    #5  std::unique_lock<std::mutex>::unique_lock (__m=..., this=<optimized out>) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_lock.h:73
    #6  dp_gui::ExtMgrDialog::startProgress (this=0x5782aab26de0, _bLockInterface=0x80) at /home/user/libreofficetwo/desktop/source/deployment/gui/dp_gui_dialog2.cxx:779
    #7  0x00007f883b4080a1 in Link<void*, void>::Call (this=0x7f86b0000c08, data=0x80) at include/tools/link.hxx:111
    #8  ImplHandleUserEvent (pSVEvent=pSVEvent@entry=0x7f86b0000c00) at /home/user/libreofficetwo/vcl/source/window/winproc.cxx:2285
    #9  0x00007f883b40616a in ImplWindowFrameProc (_pWindow=0x5782a76df9f0, nEvent=SalEvent::UserEvent, pEvent=0x7f86b0000c00) at /home/user/libreofficetwo/vcl/source/window/winproc.cxx:2849
    #10 0x00007f883b6c711e in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=<optimized out>) at /home/user/libreofficetwo/vcl/source/app/salusereventlist.cxx:119
    #11 SalUserEventList::DispatchUserEvents (this=0x5782a62edb08, bHandleAllCurrentEvents=false) at /home/user/libreofficetwo/vcl/source/app/salusereventlist.cxx:120
    #12 0x00007f8833fb7827 in QtInstance::ImplYield (this=this@entry=0x5782a62edad0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:447
    #13 0x00007f8833fb9e11 in QtInstance::DoYield (this=0x5782a62edad0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:469
    #14 0x00007f883b70fc72 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:385
    #15 Application::Yield () at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:473
    #16 0x00007f883b486415 in ProgressBar::SetValue (this=<optimized out>, nNewPercent=<optimized out>) at /home/user/libreofficetwo/vcl/source/control/prgsbar.cxx:199
    #17 0x00007f87f3ea14ca in dp_gui::ExtMgrDialog::TimeOutHdl (this=0x5782aab26de0) at /home/user/libreofficetwo/desktop/source/deployment/gui/dp_gui_dialog2.cxx:976
    #18 0x00007f883b6ff8c7 in Scheduler::CallbackTaskScheduling () at /home/user/libreofficetwo/vcl/source/app/scheduler.cxx:509
    #19 0x00007f8833fd4013 in SalTimer::CallCallback (this=0x5782a77b83d0) at vcl/inc/saltimer.hxx:53
    #20 QtTimer::timeoutActivated (this=0x5782a77b83c0) at vcl/qt6/../qt5/QtTimer.cxx:51
    #21 0x00007f88341a3397 in ?? () from /usr/lib/libQt6Core.so.6
    #22 0x00007f88341ab5e5 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/libQt6Core.so.6
    #23 0x00007f883418d859 in QObject::event(QEvent*) () from /usr/lib/libQt6Core.so.6
    #24 0x00007f8832efc8cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt6Widgets.so.6
    #25 0x00007f8834145aa8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt6Core.so.6
    #26 0x00007f88342c7658 in QTimerInfoList::activateTimers() () from /usr/lib/libQt6Core.so.6
    #27 0x00007f88343a9f99 in ?? () from /usr/lib/libQt6Core.so.6
    #28 0x00007f8837877299 in ?? () from /usr/lib/libglib-2.0.so.0
    #29 0x00007f88378d9ec7 in ?? () from /usr/lib/libglib-2.0.so.0
    #30 0x00007f8837876795 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
    #31 0x00007f88343a82bd in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt6Core.so.6
    #32 0x00007f8833fb789d in QtInstance::ImplYield (this=this@entry=0x5782a62edad0, bWait=<optimized out>, bHandleAllCurrentEvents=<optimized out>) at vcl/qt6/../qt5/QtInstance.cxx:458
    #33 0x00007f8833fb9e11 in QtInstance::DoYield (this=0x5782a62edad0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:469
    #34 0x00007f883b70fc72 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:385
    #35 Application::Yield () at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:473
    #36 0x00007f883b70fb90 in Application::Execute () at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:360
    #37 0x00007f883f8e1770 in desktop::Desktop::Main (this=0x7ffc2a5b0d28) at /home/user/libreofficetwo/desktop/source/app/app.cxx:1691
    #38 0x00007f883b717e1e in ImplSVMain () at /home/user/libreofficetwo/vcl/source/app/svmain.cxx:228
    #39 0x00007f883f90ef8a in soffice_main () at /home/user/libreofficetwo/desktop/source/app/sofficemain.cxx:121
    #40 0x000057829d6f683b in sal_main () at /home/user/libreofficetwo/desktop/source/app/main.c:51
    #41 main (argc=<optimized out>, argv=<optimized out>) at /home/user/libreofficetwo/desktop/source/app/main.c:49

Change-Id: I96d746eb1493aaf5b56d50664c9d1817699f21bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175298
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-10-22 07:17:26 +02:00
Michael Weghorn
0cfa901448 tdf#130857 qt weld: Declare support for "Word count" dialog
Add .ui file of Writer's "Tools" -> "Word Count" dialog
to the list of files supported by QtInstanceBuilder.

This means that native Qt widgets are used for that dialog now
by the qt5/qt6 VCL plugins, unless environment variable
SAL_VCL_QT_NO_WELDED_WIDGETS=1 is set.

Change-Id: Id25d0de657dfa9acbc0d71cc3a851b2eb17c6059
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175367
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-22 07:16:26 +02:00
Michael Weghorn
5794432281 tdf#130857 qt weld: Evaluate grid positions
Implement handling for the "left-attach" and
"top-attach" packing properties of "GtkGrid"
children, which describe the column and row
of these children within the grid.

Introduce a new static helper method
QtBuilder::applyGridPackingProperties that
implements the handling for QWidget children
for now.

(Support for QLayout items within a grid
will have to be added later in order to
supported cases where e.g. a "GtkBox" is
located inside of a "GtkGrid" in a .ui file.)

In order to move the item to the proper position
within the grid, first locate it to determine
it's current row and column index, remove the item
from the layout, and re-insert it at the new
position.

While this might not be the most efficient
way of doing this, it is fairly easy to
implement, without having to change the
overall approach that QtBuilder, VclBuilder and the
WidgetBuilder base currently process .ui
files.

This is sufficient for Writer's "Word Count"
dialog, for which support will be declared
in an upcoming commit.

Change-Id: Ia296373c408e6cd84ffcc29b9d9a03d3c2441816
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175366
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-10-22 07:16:20 +02:00
Michael Weghorn
afb980283a tdf#130857 qt weld: Create QGridLayout for "GtkGrid"
Create a QGridLayout [1] when encountering a "GtkGrid"
object in a .ui file.

This will be needed e.g. by Writer's "Tools" -> "Word Count"
dialog.

With this commit in place, adding "modules/swriter/ui/wordcount.ui"
to the list of supported .ui files in
QtInstanceBuilder::IsUIFileSupported would already result in each of
the labels in the dialog showing up, but each one as a single row rather
than they being properly arranged in rows and columns.
(That will be handled in an upcoming commit.)

[1] https://doc.qt.io/qt-6/qgridlayout.html

Change-Id: Ib9a9de4aa2820ac7e6771acf884072768508fe59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175365
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-22 07:16:13 +02:00
Mike Kaganski
7a7b1f9cbd Simplify a bit
Change-Id: I224602738ce41529cc5eca681f09db31241a5cac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175385
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-22 06:43:53 +02:00
Caolán McNamara
dd18703696 don't need to const_cast away constness for SdPage
Change-Id: I44fd36841319eeb3deda7becaf04ec3188586788
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175368
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-21 22:20:46 +02:00
Mike Kaganski
7b2ea917ce Optimize JsonToPropertyValues a bit
1. Make it take string view: helps to avoid extra string allocation
e.g. in desktop::jsonToPropertyValuesVector, and will help more,
when C++26 stringstream ctor taking string view is available.

2. Factor out a function taking boost::property_tree::ptree, making
implementation simpler for [][]com.sun.star.beans.PropertyValue and
[]com.sun.star.beans.PropertyValue, without writing a child node to
a JSON string, and parsing it again.

Change-Id: I16ac2641633ea67a7c9c054c9df09a790500e6fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175361
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-21 20:28:43 +02:00
Xisco Fauli
aa963e6273 tdf#163486 PVS: deprecated function
https://stackoverflow.com/questions/20711740/gtk2-g-thread-init-deprecated

V1109 	The 'g_thread_init' function is deprecated. Consider switching to an equivalent newer function.

Change-Id: Idb3cdf277d9be0bcf73b4329d3504f6355a8001c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175339
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-21 20:25:38 +02:00
Xisco Fauli
c796878e6a tdf#163543: check GetDocShell()
Similar to
commit c5f4fe1058
Author: Caolán McNamara <caolan.mcnamara@collabora.com>
Date:   Thu Oct 3 15:14:05 2024 +0100

    check for null DocShell before deref

Change-Id: I910fb934a36b0e68fd8bda59516c21aa9d27d09a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175338
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-21 17:42:04 +02:00
Noel Grandin
6c2f827697 improve style searching in SvXMLStylesContext
We can searching without needing a std::map by sorting
the style list. Which also allows to do prefix
searching. Which we can use to dramatically reduce
the number of styles we need to loop through in
SdXMLStylesContext::ImpSetGraphicStyles.

a similar mega-master-page scenario as reported in tdf#158773

13.5 - 9.1s

Needed to adjust some unit tests because
the order of iteration through styles is
now different, which affects some file output.

Change-Id: Ia7240fe520b70839d2519eba1fb70819a3c3bf81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175281
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-21 17:23:58 +02:00
Xisco Fauli
141b79e7c4 starmath: prefix members of SmSymbolDialog
Change-Id: I36430aa29665fea575633be6ab9e05aeede0c70a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175333
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-21 17:01:28 +02:00
Xisco Fauli
6b4d1e003c tdf#163486 sw: PVS: identical sub-expressions
Since
commit 47889e229c
Author: Thomas Lange <tl@openoffice.org>
Date:   Mon Sep 28 10:46:54 2009 +0000

    158766 avoid duplicating symbols in the catalog

V501 	There are identical sub-expressions to the left and to the right of the '==' operator: aSymSetName == aSymSetName

Change-Id: If204238eb0fca958e075ebb2ff4f3ad13a55630f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175332
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-21 17:01:17 +02:00
Noel Grandin
a61fa94f70 tdf#163484 Treeview not maximized in the StyleList
regression from
    commit 7f42f031ed
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Thu Oct 10 09:39:14 2024 +0200
    tdf#100894 speed up style tree creation

Change-Id: I953c2765090cfa56c7926c4cc10534f6ce60237b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175330
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-10-21 16:57:18 +02:00