Commit Graph
11569 Commits
Author SHA1 Message Date
Caolán McNamara dbe1604818 ofz#518230883 Integer-overflow
page margins shouldn't negative, so clamp them to >= 0 on import.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Idbc180c1e7d710f9b655a188d41a1c573c28fb14
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3568
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e79cf4ad2adc9ed5bafdec2c23630471cb789e19)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205869
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-01 16:00:54 +02:00
shark 789fa61602 tdf#168337 Set draw:escape-direction to auto for
drawing::EscapeDirection_SMART

Change-Id: I37028da7acabbbb80a71c18efa08f5e37d1eb569
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197456
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-25 08:58:42 +02:00
Devansh Varshney 0a99dee0ba chart2 qa: add ODF histogram roundtrip test
Add an ODS roundtrip test for histogram chart ODF import/export.

Change-Id: I37e6da4fc55dbff1fa0d310b3f74ee7e63a8012d
(cherry picked from commit 8a04469f2577c8a817dd4c9a9ee5c2d971157e4f)
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1881
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 74bb1558fdf2e418d1c4a556e5a69819e3696cdd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203893
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-23 00:09:54 +02:00
Devansh Varshney a83694c6ca xmloff: support histogram ODF import and export
Export histogram charts as chart:bar with coext:class="histogram"
and write histogram properties.

Import the histogram class and configuration again recreate the
HistogramChartType, and trigger the histogram template once chart
import is complete so calculated bins, categories, and frequencies
are rebuilt from the preserved raw values-y data.

Change-Id: I202d5666315d4f26da2bf4b3650b4388a9e4fb50
(cherry picked from commit 5fb2f5f2c2676743b823640dbaa02762308d6a54)
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1880
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit a54fc185d3d73f765bd37cc98df92cac81e01572)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203814
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-23 00:09:47 +02:00
Mike Kaganski a9026d4d17 xmloff, sc: ODS import/export of threaded comment data
Store the full threaded comment data as loext: extension elements inside
office:annotation: root text, GUID, person-id, datetime, resolved flag,
and replies. The person list is written as a separate loext:persons
element at the spreadsheet body level, referenced by person-id from
each annotation.

The loext:resolved attribute on office:annotation is not used for Calc
annotations, since resolving only applies to threaded comments; the
flag is an attribute on loext:threaded-comment instead.

Extend the libreoffice ODF schema with loext:threaded-comment,
loext:reply, loext:persons, and related attributes. Add xmloff tokens
for the new element and attribute names.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: Ibdb6cca545c853b196a8ec234b26542d392967bb
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/803
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 8cddb66d12942025e223d0d54f6bca03ac3b7f94)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205296
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-19 09:28:04 +02:00
Caolán McNamara 221bd9ee2a ofz#513256641 Null-dereference READ
Bail when the factory does not provide a Footnote/Endnote service, which
happens when a text:note element is seen while importing into
Calc/Impress.

Then extend the mbListContextPushed check to cover the whole
endFastElement body. Originally that was already the case at:

commit 530897d64b
Date:   Wed Oct 1 06:34:11 2008 +0000

    CWS-TOOLING: integrate CWS swlists02

but at:

commit 5f4938d89d
Date:   Wed Nov 15 10:03:54 2017 +0200

    loplugin:flatten in xmloff

the early return, left DeleteParagraph and SetCursor(xOldCursor)
reachable on the !xFactory.is() path

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ibcaa525e314833660aa90bcbfe66461d626718cd
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2678
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit e060ac2fcc65ebd7b308066a3fbc579782a494f4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205284
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-18 20:24:15 +02:00
Pranam Lashkari a226c37e40 Impress: replace InteropGrabBag with native SlideSections UNO property
Add "SlideSections" document property on SdXImpressDocument and
migrate all section import/export paths from InteropGrabBag to
use it directly. SlideSectionManager is now the authoritative
model, accessible from any module via standard UNO property access.

Change-Id: I276cc968e3be9a5d3599e2d7e1c581e5b1d84c1c
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1030
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1615
Tested-by: Pranam Lashkari <lpranam@collabora.com>
Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
(cherry picked from commit 03ce4ec8b3d3752cbf5377a7f21f24affd73b9c4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205169
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-14 00:27:18 +02:00
Andrea Gelmini 1976368dbc Remove duplicated include
Change-Id: Iab2b2460f39bb6b87c756ee55909b850ac35e5cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205074
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-13 08:52:10 +02:00
Pranam Lashkari dc84af7885 PPTX/ODP export: fix section round-trip issues
PPTX export (pptx-epptooxml.cxx):
- Add xmlns:p14 namespace declaration on <p14:sectionLst>,
  required by Office 365 to parse the extension block
- Add position-based fallback when slide name lookup fails
  (e.g. after ODP round-trip where "Slide 1" becomes "page1")
- Make section extension URI a constexpr string

ODP export (sdxmlexp.cxx):
- Resolve grab bag slide names to current draw:page names by
  position, preventing stale name mismatch between
  <loext:section-slide loext:name="..."> and <draw:page draw:name="...">

Change-Id: Id816072838da1a8be4c638310ec252b2eaeaf041
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/895
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 78766729df864a2d46ed02e95fba7ab4ebf3f689)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205054
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-12 08:33:39 +02:00
Pranam Lashkari a95c2dfee5 ODP: export and import slide sections via loext:section-list
Store slide sections in ODP files using a new loext: extension
element, written only in ODFSVER_EXTENDED mode:

  <loext:section-list>
    <loext:section loext:name="Section Name"
                   loext:identifier="{GUID}">
      <loext:section-slide loext:name="Slide1"/>
    </loext:section>
  </loext:section-list>

Export (sdxmlexp.cxx):
  Add exportSections() method that reads OOXSectionList from
  InteropGrabBag and writes the loext elements. Section names,
  GUIDs, and slide page names are written directly since the
  grab bag already stores names.

Import (ximpbody.cxx):
  Add SdXMLSectionListContext and SdXMLSectionContext classes
  that parse the loext:section-list structure and store sections
  back into InteropGrabBag with slide names and optional GUIDs.
  Hook into SdXMLBodyContext::createFastChildContext.

This enables full PPTX -> ODP -> PPTX round-trip preservation
of slide sections including their GUIDs.

Change-Id: Ic1c040d06c8c890699b7dfa4974694a2ea204f90
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/713
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit b0c9f8bd70a96b2e3d432993260920d3739a2eda)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205050
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-11 20:54:57 +02:00
Pranam Lashkari b3bdd9e1a0 Add XML tokens for slide sections interop
Added 'section-list' and 'section-slide' tokens for storing
slide sections in ODP files

Change-Id: I24fb220c434c1a972fb50712d3285834698c0f68
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/710
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 839dd1b514cd2f8bdad036ef2b920d6fff261afd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205047
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-11 20:54:28 +02:00
Caolán McNamara ae59bf7e83 process loext:blank-width-char better
Change-Id: Iea005facd85443091c5144a0a0f8f15fa995dbf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203576
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-04-15 12:39:27 +02:00
László Németh 62aecba14c tdf#38159 cui sw offapi xmloff: add paragraph composer
Balance word spacing within the consecutive lines
to get uniform grayness and less rivers for better
readability, enabled by the new paragraph property

com::sun::star::text::ParaComposer

and the following developments:

* Add Paragraph Composer checkbox on Alignment pane of the
  paragraph formatting dialog window (not default yet);

* Implement paragraph composer: big word spacing of a
  line is decreased by shifting the last word from the
  previous line, only if the word spacing is better, than
  before, and the increased word spacing in the previous
  line doesn't exceed the Maximum word spacing (limited
  paragraph composer);

* When Maximum word spacing is not greater than the Desired
  word spacing, shifting of the last word is not limited
  by the Maximum word spacing (unlimited paragraph composer)

* Add loext:paragraph-composer attribute, as LibreOffice
  ODF extension;

* Add ODF unit tests for the limited and not limited
  paragraph composer.

Note: "Smart justify" line breaking algorithm chooses
space shrinking (limited by Minimum word spacing)
only if shifting the last word isn't better based
on the desired word spacing. This was still a greedy
line breaking algorithm, resulting big word spacing
in the lines before a longer word.

The paragraph composer shifts the last word (or the
first part of the hyphenated last word) from the previous
line to decrease big word spacing in the actual line.

Note: balancing very big word spacing in narrow consecutive
lines can result vertical rivers. To avoid this, use limited
paragraph composer by setting maximum word spacing.

Follow-up to "smart justify", word spacing, letter spacing
and glyph scaling developments. Selected commits:
commit 529755f091 "tdf#166113
sw smart justify: adjust algorithm for interoperability",
commit 7d08767b89 "tdf#130088
"tdf#119908 smart justify: fix DOCX line count + compat opt.",
commit 7d6696757d "tdf#159923
sw cui offapi xmloff: add custom word spacing",
commit 5a48070f59 "tdf#126154
sw offapi xmloff cui: add min/max word spacing",
commit f83a04c510 "tdf#167648
cui offapi xmloff sw: add DTP-feature maximum letter spacing",
commit 3c53797210 "tdf#167648
sw letter spacing: implement minimum letter spacing",
commit 45ec7bd761 "tdf#168251
cui offapi xmloff sw glyph scaling: extend UNO/UX/ODF".

Change-Id: I727caad70536c86be524bc9d9b52bc71208c202a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203288
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
2026-04-09 14:42:07 +02:00
Aryan Mishra 759026f1f5 tdf#170270 Use std::ranges::copy_if instead of std::copy_if in xmloff
Replaces copy_if with ranges::copy_if in SchXMLExport.cxx and
SchXMLTableContext.cxx.

Change-Id: I3851a91f4c3c2d24fffefd3f5c355da153db9273
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202888
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2026-04-09 06:36:29 +02:00
Justin Luth eb4c2bf137 tdf#170215 chart import: finish calculation-settings before chart:chart
This fixes a longstanding problem
exposed by 25.8.0 commit 33f644074e
OOXML handling of 1904 null date for charts with internal data provider

The problem was that size attributes for chart:chart
were being collected before table:calculation-settings was written out.

So the size was lost during import
because it was written into table:calculation-settings
instead of chart:chart

make CppunitTest_chart2_export3 CPPUNIT_TEST_NAME=testTdf170215_nullDate

Change-Id: Ie28cfb09945734fac7a49e8eef52831d933b430a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203220
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2026-04-07 01:04:13 +02:00
Khaled Hosny 1345ac25f6 tdf#171624: Add loext:font-variation-settings ODF attribute
Add font-variation-settings under loext prefix. This is modelled after
the similarly named CSS attribute (with "initial" etc values ignored):
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-variation-settings

Change-Id: I3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203245
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-04-06 17:13:12 +02:00
Mike Kaganski e1ace8b26a tdf#163343: ignore smil:keyTimes when smil:values is empty/missing
This is safe to ignore both, when one of them empty, as opposed to a
case when both are non-empty, but have different number of elements.
Allows to read some broken real-life documents.

A possible TODO: maybe consider to warn about a broken package, and
only open in repair mode?

Change-Id: I0697dcc73933aa1761ba59a766a519965872a0ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202552
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2026-03-24 10:14:45 +01:00
Noel Grandin 6993d54041 std::lround is unnecessary here
because we are then casting to a type <=32 bits

Change-Id: Ief4a93724ccbae8d697edbd40e4085389d74473f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202156
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-19 15:27:43 +01:00
Xisco Fauli 1ed8bf0011 UnoApiTest: factor out common code for setting LO_IMPORT_USE_PDFIUM
Change-Id: I1b3c66b9098163ce17b6a4c812cc448cc5cd594c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201366
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-03-11 10:47:57 +01:00
Noel Grandin 4b10710e09 loplugin:passstuffbyref
Change-Id: I559d246b25c99e5cb7a28ba94e04a2acedd3e720
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200943
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-04 19:22:19 +01:00
Noel Grandin 5505d3bc4d loplugin:constparams
Change-Id: I33c701be5a441c1121b797f1eb5a8bda6fc3f89b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200927
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2026-03-04 11:29:39 +01:00
Khaled Hosny 331e2c3b89 tdf#153368: Support optical size for variable fonts, part 3
Add loext:font-optical-sizing attribute with two values, "auto" and
"none", modeled after CSS font-optical-sizing:
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-optical-sizing

Change-Id: I05396f084dc81d0a797be0e7c0cd57991a6876e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200502
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-03-02 21:45:18 +01:00
Caolán McNamara ba2fb4af99 ofz#421997573 Timeout
clip nNumDisplayLevels import like export does in
SvxXMLNumRuleExport::exportLevelStyle

Change-Id: I1ddc49a9c70155b9ac6f218cc9d453c36302302f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200732
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2026-03-02 09:12:01 +01:00
Caolán McNamara ae6ce55091 tdf#156707 always write fo:border for form control shapes on export
On export, always write ControlBorder and ControlBorderColor to the
auto style for control shapes, even when the property state is
DEFAULT_VALUE.

On import, when fo:border is absent, apply the control model's default
border to the shape.

a) New document, user sets flat (2) border:
    The constructor default is 2 (flat) but getPropertyDefaultByHandle
    returns 1 (3D). Property state is DIRECT_VALUE and the filter exports
    fo:border as before. On reimport fo:border is present and applied.
    No change in behavior.

b) New document, user sets no (0) border:
    Same as flat, DIRECT_VALUE, exported by the filter. No change.

c) New document, user sets 3D (1) border:
    1 matches getPropertyDefaultByHandle so property state is
    DEFAULT_VALUE and the export filter would previously skip it.
    Now export always adds adds ControlBorder explicitly, so fo:border
    is written. On reimport fo:border is present so applied.

d) Old document (pre tdf#152974) with no fo:border:
    These documents never wrote fo:border for 3D because that was the
    real default. Now on import the importer detects the missing
    fo:border and queries getPropertyDefault("Border") for the control
    which returns 1 (3D) for text controls, restoring the original
    border. On reexport the exporter writes an explicit fo:border.

e) Label controls (tdf#167358):
    Labels default to no (0) border. Their getPropertyDefault
    returns 0, so the importer applies no border when fo:border is
    absent, so this fix effort shouldn't cause that problem again.

Change-Id: I365adf84e9d26ae3231331230178381d31bfa829
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200685
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2026-03-01 20:15:09 +01:00
Caolán McNamara bb68797ab1 extract an SdXMLShapeContext::FindAutoStyle
Change-Id: I54eee36b97e8baa3d8fb6d07f345853b04f20305
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200684
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2026-03-01 01:07:35 +01:00
Samuel Mehrbrodt 4041cdbadc Check if entry exists in storage before accessing it
Prevents warnings like
  warn:xmloff.core:1530244:1530244:xmloff/source/core/xmlimp.cxx:579: DBG_UNHANDLED_EXCEPTION in load
    when: exception getting BuildId exception: com.sun.star.container.NoSuchElementException message: "at package/source/xstor/xstorage.cxx:2688"

Change-Id: I4bdb4d10bf96a9b4d24a928114b2f8351b46148e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200057
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@collabora.com>
2026-02-26 07:46:01 +01:00
Karthik Godha aac70c14c9 tdf#170771: Export only edited table styles
Instead of exporting all table styles, export only the ones which were
edited. Note that this will export the edited table style even when it
is not used in the document, this is intentional.

6fc9264fd9 was the original commit, but
got reverted because of a failing test

Change-Id: I3fcc5948a401e1ff4b2c620f21ae265476c89f0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200028
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins
2026-02-23 12:08:21 +01:00
Gabor Kelemen 0a42ddbdf1 tdf#146619 Use more forward declarations in include/xmloff
Change-Id: I49e39d669ba77a99b77322275d2e54e211da5b11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199386
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-02-22 10:42:36 +01:00
Xisco Fauli ba3fb9026c merge UnoApiText and UnoApiXmlTest
in preparation for a follow-up commit

Change-Id: I3449c031696fe3ab13d4832e2671da08eb483cdb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199552
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-02-18 21:17:13 +01:00
Heiko Tietze f6c642672d Revert "tdf#170771: Export only edited table styles"
This reverts commit 6fc9264fd9.

Reason for revert: PythonTest_sw_python fails

Change-Id: Id15fca158e6395d9960bb272ab131f81419dfdfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199596
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-02-18 11:05:27 +01:00
karthik 6fc9264fd9 tdf#170771: Export only edited table styles
Instead of exporting all table styles, export only the ones which were
edited. Note that this will export the edited table style even when it
is not used in the document, this is intentional.

Change-Id: I3ad0587352defc81828e7de7015ee7cb5cb3af76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199514
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2026-02-17 14:26:05 +01:00
Laurent Balland fb07ca38af tdf#170670 NumberFormat: fix blank width string treatment
In case of 2 characters string text,
with a delimiter as text and a blank width string like
"-"_)
the delimiter is now treated as text

Add qa test with format of bug report:
[>0]#,##0_);[<0](#,##0);"-"_)

Change-Id: Idd4542bd186c6b6b348f6716bee2fd5055f2c83f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199314
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2026-02-15 18:22:33 +01:00
Xisco Fauli cec5d6f1c8 xmloff: fix two tests saving to the wrong format
Change-Id: I699bdb262cf608dfdb1ebfdb1706b06e3cf6c3d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199371
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-02-14 17:10:45 +01:00
Mike Kaganski 5a0d14eb62 tdf#168109: Ignore draw:page-number attribute for notes' thumbnails
ODF 1.4 Part 3 sect. 19.203 draw:page-number tells:

> For thumbnails on notes pages, the value of this attribute is fixed
> to the drawing page of a notes page.

As further clarified in OASIS ODF TC call from 2025-11-24 for issue
OFFICE-4178, that wording shall be improved to unambiguously point to
exactly the drawing page of the respective notes page. This means,
that for thumbnail of DrawingPage's notes page, the actual value of
the attribute is unimportant. As the bugdoc shows, the attribute may
be missing. It may also possibly have wrong number. In any case, we
should not break the default correct reference established between
the thumbnail object and respective DrawingPage, when thumbnail was
created.

This change implements just that. For SdXMLPageShapeContext, it adds
a new method ignorePageNumber, which sets mnPageNumber to -1. Given
that this value corresponds to draw:page-number, having XML type
positiveInteger, this special value is safe and cannot coincide with
any valid value there. Its meaning is "do not set the shape's page
number", which will keep the mentioned original reference.

ignorePageNumber is only called in the context of DrawingPage/notes
page: the "ignore" flag is passed through SdXMLNotesContext from
SdXMLDrawPageContext::createFastChildContext. For notes of master
page, handled in SdXMLMasterPageContext::createFastChildContext, no
change is done.

Change-Id: I39ef16d4e0ceda89b38ee994c908157e93c119a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199283
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-02-12 18:45:46 +01:00
Xisco Fauli a9491be1f1 filter, xmloff, svx, oox: only load one document per test
Change-Id: Ibb07c8069e6ce8965739c7ccef52c41bb1f04422
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198968
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-02-09 17:02:24 +01:00
Andrea Gelmini 61d5b3dc6b Fix "is build"->"is built"
Change-Id: I9ea2f76ac79601cc812004508e64eba12a9f8058
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198922
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-02-09 12:07:11 +01:00
Andrea Gelmini 6a4a4a8f44 Fix "is build"->"is built"
Change-Id: Ic85f6bd9a152eeaf5cef15570899d491e864d8d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198921
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-02-09 12:06:38 +01:00
Jonathan Clark 7fa77b9072 tdf#72640 sw: Make list label alignment account for para writing mode
This change updates Writer to better conform with the ODF standard
wording for the fo:text-align attribute when used in
style:list-level-properties.

Previously, Writer interpreted list label alignments while ignoring
paragraph direction, always behaving as if the list label is always
left-to-right. This change updates Writer to instead apply label
direction correctly, treating start and end label alignment in a manner
similar to how we treat start and end paragraph alignment.

The list style dialog has been updated to reflect the new behavior as
start/end alignment, rather than left/right alignment.

This change also adds the LIST_LABEL_ALIGNMENT_IGNORES_DIRECTION
compatibility flag. In order to preserve the layout of existing
documents, this flag is enabled automatically when loading an ODF
created with earlier versions of LibreOffice.

Change-Id: I56cd37fa83487b010369b99570f7bb4750c07595
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198857
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2026-02-06 20:01:06 +01:00
Gabor Kelemen 0bdcfc2900 tdf#146619 Use more forward declarations in include/unotools/
This shaves off some 40M of input

Change-Id: I12e10deb87ceea1f7a23f3de4ea624befe187c3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198238
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-02-05 17:35:46 +01:00
Karthik 4fb31ea85f tdf#105933 GSoC: New Dialog to Edit Table Styles
- Introduce 'SvxAutoFormat' which combines the common funtionality of
Writer and Calc Autoformats.
- Replace module specific 'AutoFormat' dialog and preview with shared
dialog and preview in 'svx'.
- tdf#49437: Load and Save Autoformats through XML instead of
'autotbl.fmt'.
- New Dialog to edit and create table styles shared b/w Writer and Calc.

Change-Id: I7fa108e527141c05703e0e14298eea818fd10378
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190024
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2026-02-04 14:02:33 +01:00
Karthik 513bfbd476 Writer: Adapt 'SvxAutoFormat'
Adapt Writer to use new 'SvxAutoFormat' and retire Writer specific
'AutoFormat' dialog and preview.

Change-Id: I272ff0d4415d9f13402374c8ad7b6721ed749931
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190027
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2026-02-04 14:02:26 +01:00
Mike Kaganski d0e23db89a Drop MacrosTest::Resetter, and use comphelper::ScopeGuard
Change-Id: I2214724567a58174b175a17fbabec7a5249e4df8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198482
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2026-02-01 19:38:44 +01:00
shlok3640 19f943f134 tdf#163738: Use insert() instead of push_back loops
Change-Id: If5bbf0fde172c0fd0a21e44141d7e53e0ae09cab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198445
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2026-01-31 12:30:33 +01:00
Stephan Bergmann 3e9763c0ae -Werror=maybe-uninitialized
> xmloff/source/text/txtimppr.cxx:615:9: error: ‘nVertOrient’ may be used uninitialized [-Werror=maybe-uninitialized]
>   615 |         switch( nVertOrient )
>       |         ^~~~~~

So use the same approach for nVertOrient as was already used for nVertOrientRel
in 7ab4c76e73 "INTEGRATION: CWS warningfixes02
(1.18.10); FILE MERGED", initializing it to 0 aka css.text.VertOrientation.NONE.

Change-Id: Ibf9b259f87fb030e426664bc3bbd63fc1bfb0797
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197832
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-22 22:49:46 +01:00
Michael Stahl 4ca7291c93 xmloff: ODF import: fix z-index rotation in header/footer
ShapeGroupContext::popGroupAndPostProcess() is called 2 times when
importing an ODF package file, once at the end of styles.xml, then at
the end of content.xml; in the 2nd case, all shapes of styles.xml end up
in maUnsortedList.

There are 2 problems with it:

1. in the XShapes3 branch, once maZOrderList is empty, any remaining
   elements in maUnsortedList are ignored and thus the aNewOrder
   contains duplicate 0s at the end which will cause sort() to throw

2. the XShapes3 branch removes elements from maUnsortedList, hence when
   the exception is caught and the fallback path runs, it only moves
   the elements that happened to remain in maUnsortedList

   Effectively, what happens is that the z-order of everything in
   headers/footers is rotated so that the last (topmost) N elements go
   to the start (background).

3. In case the objects in content.xml happen to be sorted correctly
   wrt each other, but there was an object with higher z-index in
   styles.xml, sorting is skipped.
   Turns out that testTdf159158_zOrder_headerBehind already tests this.

(regression from commit a8b1699ca9)

Change-Id: Ifdde6fc43af4c655b430d723b875dfd46e8533f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197475
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 66a1ad2163d5799a79b23554b22e08a07f693225)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197730
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
2026-01-22 10:11:23 +01:00
Gabor Kelemen 1ebbe671ec Fix some non self contained headers in module toolkit, ucb, xmloff
Change-Id: Icedeb3f714e6da21d256f5ee26638b327e2c09d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196639
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-01-21 22:50:37 +01:00
Michael Stahl 9e0d4c693c sw: fix setting mbIsTextBox on shapes' text boxes
SetTextBoxes(true) is never called because it checks the shape's
SdrObject, while previously this code was in
SwFrameFormat::SetOtherTextBoxFormat() where it would be called a second
time for the text box SwFrameFormat which has the SwFlyDrawObj.

SwTextBoxHelper::getCount() can't ignore the text boxes if the flag is
never set; this ends up confusing
ShapeGroupContext::popGroupAndPostProcess() (and causes tests like
testTdf84695 to fail with the fixes in the next commit).

Because shapes with text boxes are sorted again with this, testTdf146272
and testTextBoxLoss need adapting.

(regression from commit 504d78acb8)

Change-Id: I80c375d900a10f1956cd112d60c3f25332c485ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197594
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 327e92c78603e011e7ddf8b57749dfd9e690addf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197729
Tested-by: Jenkins
2026-01-21 19:52:23 +01:00
Michael Stahl c455986626 xmloff,svx,sw: ODF export: prevent spurious z-index="0"
Currently any object anchored in a Writer header / footer which isn't
actually used in the document isn't put on the SdrPage and thus doesn't
have a ZOrder; this results in a spurious z-index="0" attribute, where 0
is a perfectly valid value that is typically already used by a visible
shape and is thus duplicated, which is invalid.

Fix SvxShape::getPropertyValueImpl() and SwXFrame::getPropertyValue() to
check that it has a parent, and
XMLTextParagraphExport::addTextFrameAttributes() to properly check that
the property has a valid value.

There is one possible use case for producing a z-index for something
that isn't visible: when it's anchored in a delete tracked change, and
we want to preserve the order relative to other shapes in the document.

However, it turns out that in SdXMLShapeContext::AddShape() and
XMLTextFrameContext_Impl::Create() the z-index of anything anchored in a
delete redline is already explicitly ignored, so it's a non-issue.

Change-Id: I37e461ebcd3e4546c60f421054ee39c053919267
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197474
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 7ffd4f7a27b9b2bc55ac3ddb7333dbaf3d48109c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197622
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2026-01-20 11:36:37 +01:00
Gabor Kelemen 47fe1cce1b tdf#146619 Use more forward declarations in include/vcl/[h-p]*
Found after running bin/find-unneeded-includes --headersfwd include/vcl/[n-p]*

Change-Id: If6436f3ef8300693c3869c2521e2fa2aa8a4edc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196397
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-01-14 10:19:31 +01:00
Mohit Marathe da71ff1bea xmloff: svx: handle import of page shapes that are inside canvas page
Since the canvas page is the first page, the reference page of the page
shapes are not properly set during import as the other pages does
not exist yet.

Hence, store the corresponding page number in SdXMLImport, and resolve it
in SdXMLImport::endDocument()

This went unnoticed as the canvas page got repaired during import.

Signed-off-by: Mohit Marathe <mohit.marathe@collabora.com>
Change-Id: Ice966768eafaaaad3a65c3148e3573d20fec8026
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195076
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196816
Tested-by: Jenkins
2026-01-13 09:04:44 +01:00