8658 Commits
Author SHA1 Message Date
Andreas Heinisch 720a6d856e tdf#171730 - Keep slider markers in sync in the Pick a Color dialog
The markers of the vertical color slider were only updated when the hex
field was changed. Switching the color component via the radio buttons
left the markers at their current position.

In addition, markers did not match the start color when the dialog was
opened.

The level will now be calculated on every color update and once the
slider is shown.

Change-Id: Ie31a6e93e2a6bbf10f0cdf3307b81b735662a3c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211962
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2026-10-07 21:14:59 +02:00
Michael Weghorn 016b2c1135 qt: Don't require to pass QtFrame to QtGraphicsBase::ImplGetResolution
Both callers in subclasses pass the own frame. Use it
directly instead of requiring that callers pass it explicitly.

Change-Id: I5e40e86a0f6b4e76838234aacc32de71aad8ef22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211746
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
2026-10-06 16:50:13 +02:00
Michael Weghorn 1caec31b97 qt: Move QtFrame* member down to QtGraphicsBase base class
All of the 3 QtGraphicsBase subclasses
(QtGraphicsBackend, QtGraphics, QtSvpGraphics)
have their own QtFrame* member.

Deduplicate by moving it to the shared QtGraphicsBase
base class and adding a protected getter.

This will also allow having more QtFrame-related
logic directly in the base class in the future.
(An upcoming commit will get rid of the need to
pass the frame to QtGraphicsBase::ImplGetResolution
and it might e.g. also help to centralize new logic for
QtGraphics and QtSvpGraphics suggested to be added in pending
Gerrit changes [1] and [2].)

[1] https://gerrit.libreoffice.org/c/core/+/210650/6
[2] https://gerrit.libreoffice.org/c/core/+/210651/8

Change-Id: Ie6775b7dae0f1c8a68169ddbd746d3244b01e200
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211745
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
2026-10-06 16:50:08 +02:00
Julien Nabet 8f2eee739d Related tdf#173496: fix regression from previous patch on Pages
The regression was when clicking on Pages, it was impossible to type a range.

But following https://bugs.documentfoundation.org/show_bug.cgi?id=173496#c17
from Heiko, if we use placeholder instead + keep what the user may typed,
it simplifies the pb.

So here are the changes:
- display placeholder when clicking "Pages" except if user typed something.
Also preserve what the user typed whatever it happens then (e.g. changing page
orientation)
=> change UI test to correspond to the whole change abovev

- add a delay mechanism for the preview when on Pages.
Indeed, when typing first character, placeholder was still in background for a brief time
+ there was a slight lag when typing a character

These changes have been proposed by GPT 5.6 Luna but I could test them
and make UITest_calc_dialogs is ok for me (we'll see on Jenkins).

Change-Id: Ifa57a8d1fded24cc03ed8f0589828931e897d641
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211738
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-10-03 23:24:07 +02:00
Andrea Gelmini f0bc159124 Fix typos
Change-Id: I2f3539c4536a090ccb827e12a39f4718a73fe4fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211771
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-10-03 10:10:33 +02:00
Mike Kaganski eec52071ef tdf#157028 vcl: use object streams in an encrypted file too
Object streams and a cross-reference stream shrink a tagged PDF, but
I1e27dc3a8f43aa8b6c75ae930615c8d4b4645627 ("tdf#157028 vcl: write the
structure tree into object streams") left an encrypted export out of
both, so a password kept the whole structure tree uncompressed. The
spreadsheet reported in tdf#166233, attachment 171182, exported tagged
at 2368642 bytes, and at 13465120 with a password. The protected export
is 2389620 bytes now, and what it has over the plain tagged one is what
encryption itself costs.

This writer encrypts a string as it builds the object. ISO 32000-2 7.5.7
forbids encrypting a string in an object stream separately: the stream
that carries it is encrypted instead. So the strings of a stream-bound
object go in plain now, and the object stream is encrypted as a whole,
with the cipher set up for the stream's own object number rather than
for the objects inside. The stream's /Length counts what the cipher
adds. Only the structure elements and the ID tree put strings in a
stream, so only those two builders ask getStringEncryptor for one, and
it returns nothing while the file uses object streams.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: Ia6a063244baf456d7c7368a6bba7a8cbb96e31b0
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13370
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 59193295323917bd065ea3a235f7653ad7f9b04b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211655
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-10-01 15:43:44 +02:00
Mike Kaganski d00d192770 tdf#157028 vcl: write the structure tree into object streams
Turning Tagged PDF on added 2.4 MB to the reporter's document, 2.0 MB of that
its structure tree: 12562 elements, each its own top-level object,
uncompressed, and each costing a further 20 bytes in the cross-reference
table.

The elements go into /Type/ObjStm streams of 200 now, with the parent and ID
trees. The cross-reference has to become a /Type/XRef stream with them,
because a table cannot address an object inside another object. PDF 1.5
introduced both, so a PDF/A-1b file keeps the plain form. So does an encrypted
file, since a string in an object stream shall not be separately encrypted,
and this writer encrypts strings as it builds the object. So does a hybrid
file, because sdext reads the embedded original document out of a trailer.

The reporter's document exported 3157118 bytes tagged before the change and
1086230 after, against 769448 untagged either way. An 8300-row Writer table
exported 4017140 bytes tagged before and 500967 after, against 73183 untagged.

testTdf159066 and testTdf173162 grep the exported bytes for something the
structure tree carries, /Alt< and the /Namespaces array. They inflate the
object streams first now. testListLabelPDFExport counted its List element in
the token stream, and asks GetObjects() for it.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I1e27dc3a8f43aa8b6c75ae930615c8d4b4645627
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13209
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit ad4bb8ae080aba98080dfaabd688dfdb48cf7ade)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211556
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-09-30 13:25:11 +02:00
Michael Weghorn ec99b899d4 vcl: Pass SvLBoxItem::Paint's SvVieweDataEntry param by ref
... instead of by pointer.

This makes clear it's always non-null.

Change-Id: Iea22c33171572eec0533550293a793372d889ee9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211569
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-29 19:40:29 +02:00
Michael Weghorn 8937f0d490 vcl: Use ImplImageTree member instead of static variable
Introduce new ImplImageTree::mbPreferDark member to
replace the static variable introduced in

    commit 3a9ee3a2a7
    Date:   Sat Sep 26 12:14:17 2026 +0200

        Resolve tdf#173739 - Consider dark UI for icon fallback

, see also discussion in [1].

There's only a single ImageTree (and therefore) ImplImageTree
instance that can be retrieved using ImageTree::get.

While at it, also switch the formatting/indentation of the
`else if` in ImplImageTree::fallbackStyle to a more conventional
one.

[1] https://gerrit.libreoffice.org/c/core/+/211478/comments/d66b922c_086d381c

Change-Id: Ib5cbcd5ae0e227b4eecad256d69cbd07579d8c73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211553
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-29 14:00:08 +02:00
Julien Nabet aec77a1a64 tdf#173496: use current page for by default range
The patch concerns Writer but it should help for Calc and Impress/Draw later
for adding "Current sheet"/"Current slide" option since we change vcl part too.
I used the help from GPT 5.6 Luna to:
- find root cause (print mechanism is quite complicated)
- find the fix

I made several tests but can't pretend I tested everything (far from it)

There are 2 main parts in the patch:
1) UI : add STR_PRINTOPTUI_PRINTCURRENTPAGE in sw + modify ui file vcl

2) Mechanism
a) in sw part
- add the new choice in SwPrintUIOptions
- take it into account in CalculatePagesForPrinting
- in GetRenderDoc, in case of current page, the current mechanism which uses a temporary doc
for the preview doesn't work so we need to use the whole doc instead of creating a temporary doc

b) in vcl part
- add mnInitialPage to keep in memory the current page when opening the dialog.
I found no other way to have this information once the range has been changed
- initialize mnInitialPage in ctr
- modify PrintDialog::preparePreview to have the right range
- take into account the new choice in UIOption_RadioHdl
(this last one is for the preview, the rendering is ok even without it)

+ add some check on test_printDialog QA test to see if range is ok
when going back to Portrait.

Change-Id: Idff5622601d94c73e53e12af215d5c8ba3e1b04a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210643
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-09-28 09:22:10 +02:00
Heiko Tietze 3b602bc4fc Related tdf#173606 - Show an icon in combobox depending on msg type
Following the prototype of gtk3

Change-Id: Id25c0a61c3c38427e86525f58c6bb40b9cd257ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211476
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2026-09-26 11:19:15 +02:00
Michael Weghorn dc64548702 tdf#173418 vcl: Make ColorFieldControl RTL-aware
When in RTL mode (e.g. enabled via SAL_RTL_ENABLED=1),
translate/invert the X value as needed when retrieving/setting
it for the ColorFieldControl.

Otherwise, the position is horizontally inverted/mirrored
as described in tdf#173418 in the custom LO color chooser
dialog (e.g. clicking at the color at the right edge sets the
color that's at the left edge).

Change-Id: Ifd3e5b93aab4e8f3cf8ed72f0bedab652e9cb1e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211458
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-26 08:07:21 +02:00
Michael Weghorn 85d27f843c tdf#173578 vcl weld: Evaluate/Apply GtkIconView::item-padding
Instead of hard-coding the spacing for the vcl IconView
implementation to 5 pixels, use that as the default, but
override it with the GtkIconView::item-padding [1] property
if that one is set for an icon view in a .ui file.

Together with previous commit

    Change-Id: I703504b7e2ce0c4b5351a95616112950a33332dd
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Sep 23 11:00:24 2026 +0200

        tdf#173578 Reduce spacing between ColorIconView items

, this results in the spacing between ColorIconView items
now also being smaller than before when the vcl implementation
(SalInstanceIconView) is used.

[1] https://docs.gtk.org/gtk3/property.IconView.item-padding.html

Change-Id: If4997dd5ea40659532424c600bb74e185c69b102
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211359
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-23 14:19:01 +02:00
Mike Kaganski 5d6c85d78b vcl: a tagged PDF's lengths are in user space units
Indent a paragraph by half an inch, then File - Export As - Export as
PDF with Universal Accessibility (PDF/UA) on. Its element read

 /A <</O/Layout/Placement/Block
 /StartIndent 0.72

where half an inch is 36 points. Every length was a fiftieth of what
it names: a 64.8pt inline formula carried /Width 1.296 and a 481.9pt
table /Width 9.638. Writer passes twips, and the PDF writer prints
thousandths of a point. For an inline Formula the standard makes
Width the sole source of information about the element's extent
(ISO 32000-2 14.8.5.4.6), so the fiftieth is all a reader reflowing
the file has.

A bounding box was right all along, because SetStructureBoundingBox
converts one out of the current map mode. The nine lengths this
writer can set take the same conversion now. The counts and the
identifiers pass through untouched - RowSpan, ColSpan, Language and
the annotation ids.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I4da4d085de9da7e3773294756ff3205b9b1b38aa
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12997
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit ec0a83ea9cacd67b7842a4899e9996b2d0048ce0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211350
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-09-23 12:22:03 +02:00
Mike Kaganski d663a07822 sw,vcl: name the heading a TOC item lists
Insert - Table of Contents and Index, then export with File - Export
as PDF, Universal Accessibility (PDF/UA) on and PDF version 2.0. The
file fails ISO 14289-2 clause 8.2.5.8 once per entry, which veraPDF
reports as:

 Each TOCI in the table of contents shall identify the target of the
 reference using the Ref entry, either directly on the TOCI structure
 element itself or on one of its child structure elements

An item named no target at all:

 <</Type/StructElem/NS 2 0 R/S/TOCI /P 8 0 R /Pg 3 0 R /K[10 0 R ]>>

It names the heading now, in the /Ref entry PDF 2.0 added:

 <</Type/StructElem/NS 2 0 R/S/TOCI /P 8 0 R /Pg 3 0 R /Ref[ 15 0 R ] /K[10 0 R ]>>

Object 15 is the /S/H1 the entry links to, found from the mark its
URL names. An item that links to a table, a frame or an object, or
that has no link at all, still names nothing.

The document of testTdf173162 linked its entries to
bookmark alone now, as Writer writes them, and the document passes
the profile, so the test asks for PDF/UA instead of plain tagging
and the harness validates it.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I76e73684d2ab09f187f56cab093d13980150d737
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12750
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit ee49bf58e7d3eb3ff94677e9a51c73b76eb51a99)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211338
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-23 00:04:53 +02:00
Mike Kaganski 3e517fbfe9 vcl: give each style a structure name of its own
Write a paragraph in Writer's built-in Index paragraph style and
export with Tagged PDF switched on. The element comes out as
/S/Index, over a role map that reads

 /Index/P

so the standard Index type means a paragraph, document-wide. veraPDF,
on the PDF/UA-1 profile:

 Standard tags defined in ISO 32000-1:2008, 14.8.4, shall not be
 remapped

A style called Artifact went further. Its paragraph reached the
content stream beside the marker for content that is not part of the
structure at all, the two being one name:

 /Artifact BMC
 /Artifact<</MCID 10>>BDC

Writer names a structure element after the style that produced it,
and the role map records what that name means, one entry per name.
Styles collide there with the standard types, with each other, being
separate families for paragraphs and characters, and with the names
Writer asks for itself, Source Text writing Code literally.

A name a standard type has, or another alias asked for, is now passed
over for the first indexed name beside it that is free, so the Index
style writes /S/Index-1 over /Index-1/P. PDF 2.0 has standard names
1.7 lacks: a style called H7 gives way there, while a heading at
outline level 7, which Writer asks for by that same name, keeps it
and needs no entry at all. The synthetic Div containers ask for no
name now, and carry the Div tag as before.

The test document remapped four standard tags at PDF 1.7 and six at
2.0; now none at either.

Found while reproducing tdf#165454.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I63e9116e5db17bdb554b508a864e313a77f40bc2
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12361
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 54e0207ff6bcf937187a395912f1ed57b60d90e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211314
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-22 20:49:36 +02:00
Mike Kaganski 32dec34df6 tdf#171022 sw,vcl: name the element a link points at
Exporting a document to PDF/UA-2 produced a file that fails
ISO 14289-2 clause 8.8, once per outline item and internal link.
veraPDF reports

 Destination in Outline item, OpenAction or Link annotation is not
 a structure destination

The destination named the page and an area on it, and that is all:
what was linked to could only be worked out by looking at what the
layout had put at that position.

A destination for a link or an outline item is now written as a GoTo
action carrying a structure destination beside the page one
(ISO 32000-2 12.3.2.3):

 /A<</Type/Action/S/GoTo/D[<page> 0 R/XYZ ...]/SD[<elem> 0 R/XYZ ...]>>

sw creates a destination before its target is tagged, so the node is
remembered while the cursor is on it, and matched against the tags in
the pass that already runs after the last page. Creating one and
remembering its node is a single call now, which every destination a
link or an outline item points at goes through: bibliography entries
and links in the text of a shape are named as well.

The cursor is not always on the target: a jump that selects a frame
or a drawing object, and one that finds nothing, move it nowhere, and
where it was left standing on the link, that link's own element must
not become the target. The pass over a shape's links can instead
start with the cursor on the target already, where a jump that did
reach it shows no move either, so there the mark names its own node.
Those keep writing /Dest, as do a target that was never tagged and
one whose element was never emitted.

The element carries its role and its content, not a name of its own:
a heading becomes /S/H1 with no /Alt or /T. veraPDF does not check
what a structure destination points at, so the test does.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: Ic76d80d46f130d549ebaacf175393a3d6ec77998
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12300
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit a6502c6e96d13425bcb4a3bf5731a998982d5957)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211150
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-18 19:07:01 +02:00
Dan Williams e80f162935 vcl/osx: add support for Continuity Sketch, Camera, and Scan Documents
Once there's a NSServicesMenuRequestor in the responder chain and we use
NSMenu's popUpContextMenu then we get Continuity items in the right-click
menu. The resulting image comes in via private pasteboard which we then
have to route through the Aqua clipboard code. Since there's no good way
to just insert things into a document (partly because we have no idea what
document it is) we simulate a Paste command with a fake key event to let
each shell variant handle the Continuity image as clipboard content.

To get the Continuity items added to the right-click menu we need to
use [NSMenu popUpContextMenu]. Popping up the menu with the current
NSPopUpMenuButton doesn't trigger those additions. It's not clear
why the original code from 2008 (via 5c43975d73) used the button
mechanism, but popUpContextMenu appears to work fine instead.

The 9px offset from the original commit also is no longer required,
as using no offset much more closely matches where native OS X apps
position the menu relative to the mouse pointer.

Change-Id: I80266ecac7094bd82e90e43995afc7b47d3e04d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211014
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2026-09-18 13:28:16 +02:00
Mike Kaganski 79b06ca748 tdf#163240 vcl,sw: keep one Link tag for a wrapped link
Regression after commit a71da3b7a8
(tdf#156565 sw: PDF/UA export: split Link SE at line break,
2023-11-01), which closed the tag at each line break so that every
annotation had a tag to nest in.

A structure element could reference one annotation only, the
LinkAnnotation attribute being a value in a std::map; give it a vector
and emit an OBJR kid and a parent tree entry per annotation, so each
StructParent resolves to that tag. A page or column break still ends
the tag.

Language, baseline shift and decoration now come from the link's first
portion, at a line break as much as within a line - splitting the tag
at a break would only make the result depend on where the line ends.
LATER: subdivide the Link by Spans, which covers both.

testTdf157816Link and testTdf142806 expected a tag per annotation.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I493439a33b2cbc0eecf1af6b300859cd78ee87ba
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/11541
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit ade287e6a4edf7476e667f48082261deeddd96d5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211077
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-18 08:45:00 +02:00
Christopher Sherlock 96c038a059 vcl: add custom MapRes overloads for ViewSubPixelToLogicInt()
This commit refactors OutputDevice::PixelToLogic(Point, MapMode) to use
new CoordinateMapper wrappers that accept custom mapping resolutions.

Key changes:
- Added ViewSubPixelToLogicIntX/Y() overloads to CoordinateMapper that
  accept an explicit ImplMapRes.
- These wrappers maintain the "Round-then-Shift" logic required for
  test parity: rounding the scaled distance first, then stripping
  the custom mapping offset, and finally stripping the internal
  logical offset (mnOutOffLogic).
- Simplified map.cxx by removing manual scaling and multi-offset
  subtraction logic, further centralizing coordinate math within the
  mapper.

Change-Id: I9615b234766d8b6ac9d0afb1a0d892762c738252
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203674
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
2026-09-17 15:57:41 +02:00
Mike Kaganski fd583f101a tdf#166963 vcl: reparent the children whose kids a split moves
A document with a table of more than 8191 rows, exported to tagged
PDF, failed PAC with 1393 of

 Structure element refers to a different parent than the actual parent

The kid list is split into generated Div containers. But m_aChildren
and m_aKids aren't parallel: a non-structure element gets a child
entry and no kid, and marked content adds a kid with no child.
Advancing both by the same count moved the wrong children. Cut the
child list where the moved kids end instead.

addInternalStructureContainer also held a reference into m_aStructure
across an emplace_back on it, so a split that reallocated left it
dangling. It takes an index now.

The test needs a document past that threshold. It takes about two
minutes locally, most of it in the PDF parser it reads the result back
with. Disable the test if that costs CI too much.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I37cb4f3e187b8a836b26e7c3da802bd12147904e
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12187
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 901e5afec874f0b16959038425365198dfbac7e7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211066
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-17 13:51:51 +02:00
Christopher Sherlock 5970e72c67 vcl: introduce ViewSubPixelToLogicInt() wrappers to CoordinateMapper
This commit completes the inverse sub-pixel pipeline by adding the
ViewSubPixelToLogicIntX/Y() master wrappers and their corresponding
LogicUnits pipeline stages.

Unit testing revealed that the order of operations in SubPixelToLogic
is mathematically sensitive: the floating-point View distance must
be rounded to an integer (llround) BEFORE any integer offsets
(mnMapOfs or mnOutOffLogic) are subtracted. Shifting the rounding
boundary by applying offsets in floating-point space leads to
off-by-one errors for fractional coordinates near zero-crossing points.

Key changes:
- Added ViewSubPixelToLogicUnitsIntX/Y(): Pipeline stages that round
  scaled distances to tools::Long before stripping the mapping offset.
- Added ViewSubPixelToLogicIntX/Y(): Master wrappers that provide the
  full "Round-then-Shift" journey from View sub-pixels to Absolute
  Logic integers.
- Refactored OutputDevice::SubPixelToLogic() in map.cxx to use these
  new wrappers, successfully encapsulating the manual offset
  arithmetic while maintaining exact legacy rounding behavior.

Change-Id: Icecd9a2f5f75cb5353e6c7d9431be22c0889e968
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203671
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Tested-by: Jenkins
2026-09-16 19:00:46 +02:00
Michael Weghorn 8c8c17c57f vcl a11y: Use concrete type for AccessibleIconChoiceCtrlEntry::m_xParent
Use the concrete AccessibleIconChoiceCtrl type for that
member as the parent is always of that type.

Drop now redundant method calls and UNO querying to
get the XAccessibleContext and XAccessibleComponent
and XComponent interfaces for the parent, as
AccessibleIconChoiceCtrl implements these interfaces
itself (via its OAccessible base class).

Change-Id: Id33943b0458506542798f7f333fb416820b89ec2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210970
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-16 18:38:08 +02:00
Michael Weghorn c1967a3bb4 vcl a11y: Pass AccessibleIconChoiceCtrl as parent for its entries
The accessible parent of an AccessibleIconChoiceCtrlEntry
is always a AccessibleIconChoiceCtrlEntry.

Pass that concrete type instead of the abstract XAccessible
UNO interface to the AccessibleIconChoiceCtrl ctor to make
that clear.

Change-Id: I31836925ac631922adeb320ff77d84ae915f1432
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210969
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-16 18:38:01 +02:00
Michael Weghorn 6a023bacb9 Return std::unique_ptr in Application::CreateMessageDialog
The caller of Application::CreateMessageDialog owns the
returned message dialog.

So far, it was returned by a plain weld::MessageDialog*.

Return a unique_ptr instead, to make clear the ownership
semantics. (Also adjust SalInstance::CreateMessageDialog
accordingly, which is called by Application::CreateMessageDialog
and implements the actual logic to create a message dialog.)

Adjust callers where needed.
Most callers were already using a smart pointer for the
returned message dialog anyway.

Change-Id: I7c06bb24b611bd67f5af89800adb13bf22dcc6fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211013
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-16 10:35:19 +02:00
Michael Weghorn e0a1759c8d vcl a11y: Make VCLXAccessibleBox::BoxType an enum class
Change-Id: If744c0f105050285646bdbe02a1092dd16da6230
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210965
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-16 09:25:26 +02:00
Michael Weghorn 0aaf2b7f3a vcl a11y: Switch VCLXAccessibleBox::m_xText to OAccessible
Switch that member from the abstract XAccessible UNO interface
to the more concrete OAccessible.
This makes clear that only subclasses of OAccessible are
used for it and allows further simplification in upcoming commits.

Change-Id: I1f8ab48edbd6290c7a35d8c209f14fb66d2cbbd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210964
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-16 09:25:19 +02:00
Julien Nabet 6379b5ff46 Following 02083e4a5d
Try to fix in WASM Jenkins:
In file included from /home/tdf/jenkins/workspace/lo_gerrit/tb/src_wasm/vcl/source/app/salplug.cxx:78:
/home/tdf/jenkins/workspace/lo_gerrit/tb/src_wasm/vcl/inc/headless/svpinst.hxx:100:36: error: non-virtual member function marked 'override' hides virtual member function
  100 |     bool DoExecute(int &nExitCode) override;
      |                                    ^
/home/tdf/jenkins/workspace/lo_gerrit/tb/src_wasm/vcl/inc/salinst.hxx:237:18: note: hidden overloaded virtual function 'SalInstance::DoExecute' declared here: different number of parameters (0 vs 1)
  237 |     virtual bool DoExecute();
      |                  ^
1 error generated.
make[1]: *** [/home/tdf/jenkins/workspace/lo_gerrit/tb/src_wasm/solenv/gbuild/LinkTarget.mk:338: /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/build_master/workdir/CxxObject/vcl/source/app/salplug.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /home/tdf/jenkins/workspace/lo_gerrit/tb/src_wasm/vcl/headless/svpprn.cxx:33:

Change-Id: Id1ae3ae246fb86516ee6b9b383a3ee23180bc277
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210987
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-09-15 13:01:06 +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
Andrea Gelmini 1406e27b4c Fix typos
Change-Id: Ife5bb699c12cc02575ab9313b2a70d85c75e61b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210577
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-09-10 20:37:30 +02:00
Michael Weghorn a2ad4fc380 vcl a11y: Pass OAccessible to VCLXAccessibleToolBoxItem::NotifyChildEvent
Switch the param from the abstract XAccessible UNO interface to
the more OAccessible class.

Change-Id: Ib2ed2535d2d65042f34c7852734779c9d3e91c7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210613
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-10 18:31:36 +02:00
Michael Weghorn 543ffb1e42 vcl: Drop unused SalInstance::BeforeAbort params
Only WinSalInstance overrides that virtual method
and it doesn't use the params. Drop them.

Change-Id: If3fd1130d1b678a253079672586401d48fa9a1c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210593
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-09 21:21:00 +02:00
Michael Weghorn 02083e4a5d vcl: Drop unused SalInstance::DoExecute param
The out param is unused in the only caller,
Application::Execute. Drop it.

Change-Id: I559e7e529300caffbb9d213c3387378dcbd4b8fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210595
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-09 21:20:50 +02:00
Dan Williams a7dbde8b02 vcl/qt: implement margins for widgets and layouts
Change-Id: Icbe7423754905f1b22be88eb5234625c2cec9b93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210226
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-08 13:43:05 +02:00
Dan Williams 54604e9b1d vcl/qt: honor row-spacing/column-spacing for QGridLayout
Use the GtkBuilder internal spacing properties.

Change-Id: Ibb26505e343801cca2dc5f728a91821983f5aa4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206478
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-08 13:42:48 +02:00
Dan Williams da86a85994 vcl/qt: set MessageBox/Dialog button role for correct platform button order
Button response IDs are parsed late in the process of building a widget layout
from .ui files because they have their own section at the end. They show up
via QtBuilder::set_response() long after the button has been added to its
QDialogButtonBox. There appears to be no API to set a button's response after
it's already been added, so we need to re-add the button when we finally know
its response ID. The button box will then remove and re-add the button in
the right platform-specific order based on the response ID.

Pull out the button box adding logic to a separate function so we can do
the same thing from the two places it's required.

Change-Id: I29527eabcf68105b5e8c6fbffd4ca3822b7a5acb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206476
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
2026-09-08 13:41:56 +02:00
Dan Williams 3e5e13abcf vcl/qt: honor GtkLabel font-weight, font-style, and underline properties
Change-Id: Ie6a060ff2bd7248584583cdeae44db75602fbbb5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206483
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
2026-09-04 20:42:31 +02:00
Dan Williams 38df30595f vcl/qt: implement alignment for widgets and layouts
Change-Id: I49a145bfbe1ef9b972e8853349b211165aea3686
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206475
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
2026-09-04 20:39:50 +02:00
Michael Weghorn 753c9c6689 a11y: Drop unused XServiceInfo includes
basctl/source/basicide/baside3.cxx actually needs the
include and now no longer gets it transitively, so
add the include there directly.

Change-Id: Iff9eca9f7a8c9585522a783f63f77a5ab1555333
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210409
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-03 09:22:50 +02:00
Michael Weghorn 3c2d789a75 vcl a11y: Stop declaring support for "com.sun.star.awt.AccessibleHeaderBarItem"
There is no "com.sun.star.awt.AccessibleHeaderBarItem" UNO service.

Stop declaring support for that non-existing service in
VCLXAccessibleHeaderBarItem.

Change-Id: I2ad0301484915548b4f51db805c6d52de257ce58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210407
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-03 09:22:33 +02:00
Michael Weghorn 01a21a3501 vcl a11y: Stop declaring support for AccessibleContext service
The com.sun.star.accessibility.AccessibleContext UNO service
is unnecessary and not really used for implementing a11y support,
apart from some a11y implementations declaring support for it.
What is relevant is the com.sun.star.accessibility.XAccessibleContext
interface instead.

Stop declaring support for the com.sun.star.accessibility.AccessibleContext
service in vcl a11y implementations, in preparation
of dropping the service altogether in an upcoming
commit.

Change-Id: Ib008df81a22a23239be369605b790c86a92c743d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210402
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-03 09:21:00 +02:00
Michael Weghorn f4b5869832 a11y: Stop declaring AccessibleContext support in AccessibleBrowseBoxBase
The com.sun.star.accessibility.AccessibleContext UNO service
is unnecessary and not really used for implementing a11y support,
apart from some a11y implementations declaring support for it.
What is relevant is the com.sun.star.accessibility.XAccessibleContext
interface instead.

Stop declaring support for the com.sun.star.accessibility.AccessibleContext
service in AccessibleBrowseBoxBase (and drop related
XServiceInfo::getImplementationName overrides in subclasses),
in preparation of dropping the service altogether in an upcoming
commit.

Change-Id: Id6072c6ca066c9eda8e682ccfd6240e74d7307ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210401
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-03 09:20:46 +02:00
Andrea Gelmini 0974df2160 Fix typos
Change-Id: Icd5b8ad9f175c85ac1d8df644679fab945c0de0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210373
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-09-02 15:33:22 +02:00
Michael Weghorn 1f4257b2d9 a11y: Don't claim implementing "com.sun.star.awt.AccessibleHeaderBar"
There is no "com.sun.star.awt.AccessibleHeaderBar" service,
so don't claim implementing it in VCLXAccessibleHeaderBar.

Also drop VCLXAccessibleHeaderBar::getImplementationName because
there is no need to use a different implementation name than the
base class.

Change-Id: I3fde8be90d503435a27dd5581986a5fa256d43f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210356
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-02 14:31:25 +02:00
Michael Weghorn ce1e8ab1a9 a11y: Don't claim implementing "com.sun.star.awt.AccessibleFixedHyperlink"
There is no "com.sun.star.awt.AccessibleFixedHyperlink" service,
so don't claim implementing it in VCLXAccessibleFixedHyperlink.

Also drop VCLXAccessibleFixedHyperlink::getImplementationName because
there is no need to use a different implementation name than the
base class.

Change-Id: I20c48f4972be810636f1a662ed925bc53d2b0ab8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210355
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-02 14:31:15 +02:00
Michael Weghorn 9b3a7b3385 [API CHANGE] a11y: Drop com.sun.star.awt.AccessibleButton
Drop the unpublished service
"com.sun.star.awt.AccessibleButton"
because it's unused. (The IDL file only documents some
internal implementation details of the a11y class
implementing the service.)

Change-Id: If2b119a63cfcc67767bc6a07df68da4b060fd94b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210354
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-02 14:30:55 +02:00
Michael Weghorn c185e260e9 [API CHANGE] a11y: Drop com.sun.star.awt.AccessibleComboBox
Drop the unpublished service
"com.sun.star.awt.AccessibleComboBox"
because it's unused. (The IDL file only documents some
internal implementation details of the a11y class
implementing the service.)

In addition, VCLXAccessibleListBox::getSupportedServiceNames
was actually reporting a different service name:
"com.sun.star.accessibility.AccessibleComboBox"" instead of
"com.sun.star.awt.AccessibleComboBox".

Change-Id: I5b53dae6c6546ad9f8f641a64970389d308bc219
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210353
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-02 14:30:46 +02:00
Michael Weghorn e73e93e0e7 [API CHANGE] a11y: Drop com.sun.star.awt.AccessibleCheckBox
Drop the unpublished service
"com.sun.star.awt.AccessibleCheckBox"
because it's unused. (The IDL file only documents some
internal implementation details of the a11y class
implementing the service.)

Change-Id: I3dcf76edac0af2419a60c5be466783b9bc48a4b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210352
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-02 14:30:37 +02:00
Michael Weghorn c602a9b9e2 [API CHANGE] a11y: Drop com.sun.star.awt.AccessibleList
Drop the unpublished service
"com.sun.star.awt.AccessibleList"
because it's unused. (The IDL file only documents some
internal implementation details of the a11y class
implementing the service.)

In addition, VCLXAccessibleListBox::getSupportedServiceNames
was actually reporting a different service name:
"com.sun.star.accessibility.AccessibleList" instead of
"com.sun.star.awt.AccessibleList".

Change-Id: Ie9fd59ce9078797baad4bd41c77350c0cdbe9ad4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210351
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-02 14:30:23 +02:00
Michael Weghorn 46fbfa859d [API CHANGE] a11y: Drop com.sun.star.awt.AccessibleListBox
Drop the unpublished service
"com.sun.star.awt.AccessibleListBox"
because it's unused. (The IDL file only documents some
internal implementation details of the a11y class
implementing the service.)

In addition, VCLXAccessibleListBox::getSupportedServiceNames
was actually reporting a different service name:
"com.sun.star.accessibility.AccessibleListBox" instead of
"com.sun.star.awt.AccessibleListBox".

Change-Id: I786e92d017cb3b28779c54f2a9cd01fc2501784d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210350
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-02 14:30:14 +02:00