Commit Graph
11590 Commits
Author SHA1 Message Date
Caolán McNamara 95045fb7d5 put links in form imagecontrols under link management
Change-Id: I265f889bcfdcf1b214cde02e9e5799081ec6aa42
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2396
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 01a314d398a497e01d0b9e4b575f3b7c842b8622)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206343
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-14 13:26:15 +02:00
Khaled Hosny ed9e0a730e tdf#172647: Respect when building embedded font URL
Without that, subfamilies that has the same weight and italic will get
the same file URL.

Change-Id: If698b137d0f9ce478bed99bbc091963b02b82619
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207553
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Khaled Hosny <khaled@libreoffice.org>
2026-07-14 00:16:00 +02:00
Caolán McNamara 0f40910170 chart import: avoid rescanning every style per data point
look up a point's data-label style through a map built once, rather
than searching the whole style vector for each point, which made
importing a chart with very many styled points take minutes.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I6e8ce35e2e6f7248f14d84c3c5a390bcde032929
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6573
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 962197f436444984d8679be269887b92cee8edf4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208006
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-13 13:53:33 +02:00
László Németh 5da16bdc79 tdf#172674 offapi cui sw xmloff: add hyphenation slider feature
To solve the trade-off between better spacing and less hyphenation,
support hyphenation level and its user interface, the hyphenation
slider, like DTP software do.

Add new paragraph property com::sun::star::text::ParaHyphenationLevel

The hyphenation slider is the basic interface of DTP software to adjust
single (or all) paragraphs using better word spacing (i.e. more
hyphenation) or less hyphenation (i.e. worse word spacing). It allows 1)
to choose the best from the near equally good layouts and 2) to solve an
extreme bad layout (caused by words without hyphenation or other corner
cases).

– 50% hyphenation level means disabled hyphenation, if minimum
  and maximum word spacing settings allow to break the line within
  words (default interoperability value).

– 100% hyphenation level means using extra hyphenation only if that
  results better word spacing in the line, than breaking within words.

– Between 50% and 100% hyphenation level, use extra hyphenation only if
  its weighted word spacing is better, than breaking the line between
  words (weighting grows with the hyphenation level).

– Between 0% and 50% hyphenation level it means disabled hyphenation
  with increased desired and maximum word spacing, depending on the
  hyphenation level. At %0, the desired word spacing is enlarged to the
  original maximum word spacing, while maximum word spacing is enlarged
  by a single space.

For example, the original 4-page unit test document with the default 50%
hyphenation level contains 14 hyphenations. 100% hyphenation level
results in 22 hyphenations, while 0% only results in 8 hyphenations.

– sw/qa/extras/layout/data/tdf167648_minimum.fodt,
  sw/qa/extras/layout/data/tdf169168_minimum.fodt: set maximum
  word-spacing to 100% from 101% to limit the original unit test only
  for minimum letter spacing.

More information: LO/COOL Book & Typography projects:

https://www.numbertext.org/typography/

https://www.numbertext.org/book/

Follow-up to commit cf104be5cb "tdf#119908
tdf#166113 cool#15973 sw smart justify: fix DOCX hyphenation",
commit d572576dd6
"tdf#119908 cool#15973 sw smart justify: fix "smart" hyphenation",
commit 529755f091
"tdf#166113 sw smart justify: adjust algorithm for interoperability" and
commit 7d08767b89 "tdf#130088 tdf#119908
smart justify: fix DOCX line count + compat opt."

Change-Id: I84b3893ea6c5cd4eff74a73514722285e7071392
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207545
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
2026-07-04 17:11:37 +02:00
Devansh Varshney 88550ce19c oox: xmloff: import/export histogram underflow and overflow bins
Read underflow and overflow attributes from the histogram chart
type properties.

Export the same properties back to <cx:binning> so chart roundtrip
preserves optional edge bins.

Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Change-Id: I963febac4987da23dce2571928982973f7ea67d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207153
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-29 14:41:12 +02:00
Tomaž Vajngerl 5286d91e80 sc: round-trip dynamic-array masters and @ through ODF
Import classifies each formula cell:
- Plain non-array, no coext:spill: the import-time walk over
  the freshly compiled RPN decides if the formula intends an
  array. If yes, prepend @ at the front of the parse and at
  the back of the RPN.
- Plain non-array + coext:spill="true": a master saved while in
  spill state. Comes back at 1x1 with the dynamic flag, the
  position marked spilled. The next interpret re-checks the
  blockers.
- Array formula (matrix dims): static array master by default.
  coext:spill="true" promotes it to a dynamic-array master.
  Legacy Ctrl+Shift+Enter (CSE) arrays without the marker keep
  their static iteration-and-pad behaviour.

Export reverses:
- ODF always strips @ on save. The @ is an in-memory marker
  only. OOXML and the UI grammar keep it.
- Dynamic master: coext:spill="true" in extended ODF, matrix
  dims as before. In spill state, write as plain non-array with
  coext:spill="true".
- Static array master: matrix dims, no coext:spill.

GetFormula skips the {} wrapping for dynamic-array masters so
they read back as plain formulas. Static array masters keep {}.

XML_SPILL is added to the xmloff token machinery and the ODF
extension schema (OpenDocument-v1.4+libreoffice-schema.rng)
gains coext:spill on table-cell.

Tests cover each import shape, the FODS export of regular and
spilled masters, the @ insertion on CompileXML, and the @
stripping at the formula-compiler level. ArrayFormulasStatic.ods
is a legacy fixture whose B1 = AND(C4:C52) summarises 49 per-row
value checks. The test runs the grid on import and after an ODS
round trip and confirms plain bare-range cells gain @ while the
five matrix masters stay static, keep their {} wrapping, and
get no coext:spill in the saved XML.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Ib8ae345528185c824415ec5d039b6d5cf0d7eac8
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4663
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit a21f6a3a0eae72fef90576d249d96dc00beeb2c5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207171
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-24 00:04:16 +02:00
Samuel Mehrbrodt 28c7d0a4e1 Prevent warnings "special item not handled"
Seen warnings like this:
  warn:legacy.osl:1004123:1003943:xmloff/source/style/xmlexppr.cxx:854: special item not handled in xml
  export

Empty UserDefinedAttributes / ChartUserDefinedAttributes values (VOID Any
 or null XNameContainer) trigger the warning.

Treat both as "nothing to export" and skip silently.

Change-Id: I267b35d92096ad75d0ba87939cb0d17670b72763
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1184
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1452
(cherry picked from commit a92ab8433594d6010bdbbcf6771a49c2d23d1725)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207070
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-06-21 21:33:42 +02:00
Samuel Mehrbrodt 297cf4e138 Prevent warnings on attributes handled by base class
SdXMLNumberFormatImportContext iterated the attribute list a second time
after its SvXMLNumFormatContext base had already consumed it, emitting
XMLOFF_WARN_UNKNOWN for everything except number:automatic-order.

This prevents warnings like:

    warn:xmloff:...:XMLNumberStyles.cxx:595: unknown attribute urn:oasis:names:tc:opendocument:xmlns:style:1.0 style:name value=D6

for attributes the base class already handles correctly.

Change-Id: I9d99d9fa72f4a174a2c16fdc5cb8901377bd8d3f
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1183
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1451
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 7a06eb6187c252aae52c40ad9dc6a6b9f8c1a07c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207069
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-06-21 20:12:38 +02:00
Xisco Fauli 04ae2b1f12 Support coext namespace
After
commit e052641d460d8111d3333705aea03ad24822ebbb
Author: Michael Stahl <michael.stahl@collabora.com>
Date:   Thu Apr 16 14:55:25 2026 +0200

    xmloff,package,xmlsecurity,oox: add Collabora extension namespace

    For both ODF and OOXML export, add a new "coext" namespace.

New features saved in Collabora Office will not work in LibreOffice
Also add a test for it

Change-Id: I5626dbcf5e87e06ef94e33d1ce09a091c1557688
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206987
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-20 00:30:54 +02:00
Jonathan Clark 13d4e74e4f tdf#172442 xmloff: Fix Base ParagraphAdjust to awt::TextAlign conversion
When Base loads forms, it flattens ParagraphAdjust values into
GUI-specific awt::TextAlign values. The code that performed this
remapping was missing some recently-added values, causing apparent loss
of column alignment after save.

This change adds the missing values. In addition, this change adds unit
tests for the conversion code, and fixes a long-standing typo bug that
made values fail to round-trip.

Regression due to the following commit:
 commit 5d1b2baaa9
 Author: Jonathan Clark <jonathan@libreoffice.org>
 Date:   Tue Oct 21 02:14:26 2025 -0600

     tdf#118350 [API CHANGE] Implement start and end paragraph alignment

Change-Id: Ica27870a952c6ec77360f416e112724b4943a016
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206816
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
Tested-by: Jenkins
2026-06-18 13:57:18 +02:00
Michael Stahl a50e3188a3 svx,sw,xmloff: split no-first-page-header-flag in 2
In Word only the first-page-shared flag is shared between header and
footer, while the existence of header and footer is independent.

Split into core flags `DisableFirstHeader` / `DisableFirstFooter`,
properties `HeaderNoFirst` / `FooterNoFirst` (which allows removing some
special checks as the name prefix checks now cover these).

`SectionPropertyMap::setHeaderFooterProperties()` had some special code
to turn off a header but not a footer, add that to do it consistently.

Also rename the ODF attributes, `is-first-page-header-enabled` better
describes the values than `is-first-page-header-shared`.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ieee9cb7a8f7b4fb7e66352c95142d8ccb06f9cb5
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4383
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit a443891f1a6480421fa08c311526c1a9d4bdd642)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206703
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-18 12:17:26 +02:00
Michael Stahl de4a472a86 sw,xmloff: DOCX: improve Word page margin compatibility
The problem with not having some but not all headers enabled on a page
style is that Word does page margins differently than Writer, and this
causes `testTdf116486` and `testFdo44176` to fail.

In Writer, it's always additive: page `fo:margin-top` + header
`fo:margin-bottom` gives the spacing from the top of the page to the
body text.

In Word, there is a `w:header` (from top of page to header) and `w:top`
(from top of page to body text) and the problem is, they're not
additive, both are measured from top of page.

If all headers are enabled,
`SectionPropertyMap::PrepareHeaderFooterProperties()` can map this to
`HeaderHeight` and `HeaderBodyDistance` properties, but of course those
won't be used if there's no header on the page.

So import `w:top` as a new property "MinTopBodyDistance" (and also
"MinBottomBodyDistance") implemented as new item
`RES_FRMATR_PAGE_MIN_TOP` (and also `RES_FRMATR_PAGE_MIN_BOTTOM`).

Use it in `SwLayoutFrame::Format()` to set the page frame margins, but
only if there is no header; else rely on the existing header properties.

Export this to ODF as
`coext:min-page-margin-top` and `coext:min-page-margin-bottom`.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I9d98bbf7138c9ef04d4ab1ddcb4c3183a12d9b11
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4310
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e065ba01c029cd01c9128afccdc953e2e3a49e65)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206702
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-18 12:17:15 +02:00
Oliver Specht 5dd328effe Support of page styles without header/footer on first page
Import/export to/from docx/rtf supported.
Unit test available.

Change-Id: I12065ba4fb050d7dfc013eda704ebe2acb53c88e
Signed-off-by: Oliver Specht <oliver.specht@cib.de>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3580
Tested-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit b8af8f046a098c67d7caf44dc70d1db5cabf24e2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206698
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-18 12:17:01 +02:00
Méven Car 0b27b1bc69 xmloff: recover missing draw:fill-image from style:background-image on import
A broken ODF document may have draw:fill-image-name on the page layout
or drawing-page properties referencing a name with no matching
<draw:fill-image> element in <office:styles>. When the same page layout
also has a style:background-image with actual image data (the old
mechanism), recover the missing bitmap table entry from it.

This is done before deactivateOldFillStyleDefinitions so the
BackGraphic property indices are still valid. The recovered bitmap is
inserted into the BitmapTable so the draw:fill-image-name reference
resolves correctly, making the background image visible in the page
setup dialog (Area tab) and in Collabora Online.

Change-Id: I5c1b658621f288af026c57e69d13363fbc1fe45a
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1142
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit b370baba6ac0daa31395f47b80bc5c11cc561b1e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206429
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-17 16:29:17 +02:00
Xisco Fauli 3542592a5b Revert "tdf#162563 Drop AppletShape import-export support from xmloff"
This reverts commit 3fcdf7093c.

it breaks the published API

Change-Id: Ic7063a46db3e838a83addf612a2ef305ba0e985e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206706
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-17 08:53:21 +02:00
Balazs Varga fefe7c3101 tdf#117074 store SVM metafile graphics zip-compressed again
Since commit 3da86d8987 ("tdf#114488
Rank multiple images also for flat odf") GetMimeTypeForExtension()
resolves the "svm" extension to the "image/x-svm" media type. As a
side effect SvXMLGraphicHelper::implSaveGraphic() now stamps that
non-empty media type on the Pictures/*.svm package stream.

ZipPackageStream treats every non-text media type as an
already-compressed format and stores the stream without deflate
(ZipPackageStream::setPropertyValue, "MediaType"). Before the above
commit the svm media type was empty, so the stream kept being
zip-compressed.

But SVM, like EMF/WMF, is an *uncompressed* metafile and must be
zip-compressed. The aCompressiblePics allowlist already contained its
sibling metafile formats (image/x-emf, image/x-wmf) but was missing
image/x-svm, based on the wrong assumption that the ZBITMAP stream
option compresses it -- ZBITMAP only compresses embedded bitmap
actions, not the vector action stream.

Add image/x-svm to the allowlist. A vector SVM that was stored
uncompressed at 8 MB now deflates to ~0.6 MB again (92%), so files
with SVM graphics -- and "Tools > Minimize Presentation" on them --
shrink as expected, losslessly.

Change-Id: I4b67f9a87e4a54c03f16b7babaf2d0ede1202754
Signed-off-by: Balazs Varga <balazs.varga@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4337
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 2364fc9aeb36ea5edbb38f3fde9e391b481839e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206689
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-16 15:19:20 +02:00
Vissarion Fisikopoulos 367fdac5ab tdf#87012: Fix charts without content in report-builder
In report builder if the charts contain date or time
then the generated chart appear without content.
This is fixed by adding appropriate handling of date
and time value cases.

Change-Id: Idfa0e03645e1e8130707fc541b155fd53311572d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206232
Tested-by: Jenkins
Reviewed-by: Vissarion Fisikopoulos <vfisikop@libreoffice.org>
2026-06-12 09:10:33 +02:00
Tomaž Vajngerl e0cab5b416 xmloff: skip PNG fallback for SVG primaries for ODF 1.4+ documents
The replacement raster image written next to an SVG primary was a
backwards-compatibility fallback for older ODF readers that could
not decode SVG. SVG has been in ODF long enough that current readers
handle it, so the PNG fallback is no longer worth carrying. To stay
cautious, only skip it when the document is written as ODF 1.4 or
newer.

Add testSvgPngFallbackOdf14 and testSvgPngFallbackOdf13 covering
the new behaviour. Both load odp/SvgImageTest.odp, which already
has an SVG primary with a PNG fallback. The ODF 1.4 case must
round-trip with no PNG file under Pictures/, while the ODF 1.3
case must still emit one.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Ic3a54f46dd21db0d54f07d410243b885f8905a94
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4164
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 0dec43976c4410cb237b421813e5352ab94195d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206353
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-12 08:51:50 +02:00
Devansh Varshney 1c88202d58 chart2: fix histogram ODF/XLSX roundtrip
ODF import applied the histogram template before series data existed, so
bins were not rebuilt on reload. Apply it again after series import.

For XLSX import, preserve generated histogram bin labels during axis
conversion instead of replacing them with generic category labels.

For XLSX export, write the direct values-y source range for new
histograms instead of generating an _xlchart.v1.N alias without a
guaranteed matching workbook definedName.

(cherry picked from commit d346a0edcaa200720b8ce5716a84427b5fce10d8)
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3302
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>

Change-Id: I6c9d2aa5c70e0340331cde159499f3c4992828a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205843
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-11 01:59:34 +02:00
Gabor Kelemen 3fcdf7093c tdf#162563 Drop AppletShape import-export support from xmloff
Change-Id: I9fc94cf361bb8df706c4a8a289b36c541edac5d4
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3207
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 89887378e63cb33a4d675817e39fd30d59580ff2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206301
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-10 16:21:04 +02:00
Vissarion Fisikopoulos 9c96f32fd6 Format SchXMLTableContext.cxx using clang-format
Change-Id: I84fbf31cae2a72c2cd22f9afb67aa431a44917e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206231
Reviewed-by: Vissarion Fisikopoulos <vfisikop@libreoffice.org>
Tested-by: Jenkins
2026-06-09 16:08:19 +02:00
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