100 Commits
Author SHA1 Message Date
Karthik 8bca7a7c3f tdf#163115: Don't export hidden sheets to PDF
ScPrintFunc::InitParam decides per sheet whether that sheet contributes
pages. It checked IsVisible on a sheet with no print range, but a sheet
that has one was printed whatever its visibility, so a hidden sheet with
a print area landed in the PDF. Test visibility first, ahead of the
print-range branches. That also drops the duplicated check the other two
branches carried.

The "whole sheets as single pages" option does not go through
ScPrintFunc. It gave one page to every sheet in the document and drew
page N from sheet N, so hidden sheets came out too. Count only the
visible sheets and draw page N from the Nth visible one.

Signed-off-by: Karthik <karthik.godha@collabora.com>
Change-Id: Iee46c1dc1312789bac5aa82d47a17b76b12e651a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8660
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 7b538dabeb8a19519a55e47ad86a98c39fa24b30)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209252
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-18 15:55:02 +02:00
Karthik 82fbbed4c8 pdf: Cache images with alpha
`PDFWriterImpl::implWriteBitmapEx` only cached bitmaps without an alpha.
Update `m_aPDFBmpCache` to store alpha bitmaps with a alpha mask.

Also increase the cache size to 64.

Signed-off-by: Karthik <karthik.godha@collabora.com>
Change-Id: I9520f8efa7c4dced91e198d3675620a713f550d2
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6751
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209061
Tested-by: Jenkins
2026-08-13 10:55:46 +02:00
Karthik b7b2913bdc tdf#172730: Add a fast scanline paths for premultiplied 32-bit bitmaps
Since BitmapEx was unified into a single premultiplied 32-bit BGRA
Bitmap, converting such a bitmap runs a per-pixel loop that builds a
BitmapColor and dispatches through the `GetPixelFromData` /
`SetPixelOnData`, (un)premultiplying one channel at a time.

Add a fast scanline path for the common case, a premultiplied 32-bit
truecolor bitmap (ABGR/ARGB/BGRA/RGBA). It resolves each channel's
byte offset once and then moves the scanline bytes directly, using the
premultiply / unpremultiply lookup tables.

Signed-off-by: Karthik <karthik.godha@collabora.com>
Change-Id: Ie8ee47055bdffca9e06d48955fdc0b61b34e08ac
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6752
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 54c68922eaa2d2c4e20e10091ad4911e8d32aed2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208641
Tested-by: Jenkins
2026-07-30 18:08:49 +02:00
Karthik 81282ab6ea tdf#171657: Correctly position a centered table beside a floating table
A DOCX with a floating table, followed by a centered inline table narrow
enough to fit beside it could hang on load.

While formatting the inline table, `CalcFlyOffsets()` indents it to the
right of the floating table's fly, so `SwTabFrame::Format()` gets a
large left offset. In the CENTER orientation case the left spacing was
set to that offset while the right spacing kept the centred spacing.
Their sum exceeded the available width, which tripped the guard that
collapses both margins to zero

Once a surrounding fly forces the table off-centre it can no longer be
centred, give the opposite side the remaining space.

Signed-off-by: Karthik <karthik.godha@collabora.com>
Change-Id: I8545b89ffb7270e966e9a816ccd90b5282e4bc4e
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6204
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208644
Tested-by: Jenkins
2026-07-28 10:38:28 +02:00
Karthik fca86c4703 tdf#172504: Use localized table style names
This is a regression from 4fb31ea85f,
table style names were no longer localized.

Signed-off-by: Karthik <karthik.godha@collabora.com>
Change-Id: I02d0e9cbcce24a6a2747e43c4cf5fe4324e1ad3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207825
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2026-07-23 12:53:22 +02:00
Karthik bbf5cada29 sw: Handle negative spacing in paragraphs during import
Don't import a paragraph style containing negative spacing. `w:before`
and `w:after` are defined by ST_TwipsMeasure, which can't be negative
([22.9.2.14] ISO-IEC-29500-1 2016).

Signed-off-by: Karthik <karthik.godha@collabora.com>
Change-Id: I6512e4820f5ed5c11cfcaed5a773fa99811ba702
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6169
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 8f9af9a13dff2eeeeae6840de9ed92970f13b5e4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208010
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-13 12:01:49 +02:00
Karthik f86af27062 sw: Import character style of Data-binding in SDT
When importing data bindings in SDTs, character style of the data binds
are not being imported.

This is a regression from 1c45e1971c

Signed-off-by: Karthik <karthik.godha@collabora.com>
Change-Id: Ibf3a696a30425da1fbf3ef2547aa771025c00bca
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5647
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit d4fb0d00700e21316687533aac677decf21441eb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207625
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-06 10:00:15 +02:00
Karthik 337ed976d3 sw: First inserted table gets invalid table name
When a table is inserted without a autoformat selected, the table gets
"Default Style" as it's name instead of "Table1"

Change-Id: I31fb8d8734fa5f490553804a58ef40b19b78a9d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204258
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-06-26 08:12:44 +02:00
Karthik ebc96c15ff sc: When inserting a table if exists, reuse the existing DBData
If a DBData already exists on a selected range, instead of creating a
new DBData and overlaying it ontop of the existing DBData, reuse the
existing DBData to create a table.

Change-Id: I3bfbe911b3cf4720b6228e55ed94f2948261d8e2
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4200
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit efcbdb4567e12532c935be682081106470c74373)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206997
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-20 00:31:02 +02:00
Karthik 33134fabb1 sw: Headings with linked character style are not preserved in TOC
In Word part of a paragraph can be formatted as a heading style, only
that particular run contains the formatting through linked character
styles. When this run is at the start of the paragraph, it is shown in
TOC.

We did not do this. The paragraph itself is not an outline node (its
paragraph style carries no outline level), so neither UpdateOutline nor
UpdateTemplate collected it and the entry was missing from the ToC.

Add a collector `SwTOXBaseSection::UpdateLinkedCharStyles`, run for a
content index that is built from outline levels. It looks for a run that
starts at the beginning of the paragraph and whose character style is
linked to a paragraph style with an outline level. For such a paragraph
it emits a SwTOXPara of the new kind `SwTOXElement::LinkedCharStyle`.

Change-Id: I67ab2497950fab00f3e0d9f2b2641c826adbb35c
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2744
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 73c4c838bbefc9283f668cbdb2c7473f89ada8ea)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206774
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-17 13:08:10 +02:00
Karthik a99249f88f tdf#170096: sw - Text overlapped with image in Header
A paragraph carrying <w:framePr> becomes a floating "text frame" that
MS Word lays at a fixed page position while the surrounding header text
wraps beside it. Writer instead disabled text wrapping for all
header/footer content, so the header text was laid out directly on top
of the framePr frame and overlapped it.

Change-Id: I1a5343672361a3675ae7daa258e843ce24f0d0aa
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3862
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 3b7493f2e4f97e3eb32fa4953c5f9131f1bfbe42)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206431
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-14 10:41:46 +02:00
Karthik 6efcca93a4 sd: Unit test to verify changes to paragraph with animations are saved
Extension of 9d21bff5c309d9afbbc3395403ec904d84b37ec1 commit

Change-Id: Iac8d76bda92f77e0d324fda0c2eb8487f68e8ea0
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3834
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 9851586746e89dfac7cbeaf1b5fb9f23dab5feb3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206300
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-10 23:00:18 +02:00
Karthik 0bf1c1bd52 editeng: don't freeze the UNO text selection during insert
Text object's selection should be dynamic (whole text),
`SvxUnoTextBase::insertString()` sets the text object's selection to the
current full extent after inserting.

A freshly created SvxUnoText does the same, initializes its selection to
the whole text.

Change-Id: Ie6b81f105162785c5aa990e77af729e1340faee8
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3596
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 9d21bff5c309d9afbbc3395403ec904d84b37ec1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206299
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-10 22:26:47 +02:00
Karthik 227aac0aa4 sw: Inline headings produce incorrect order in TOC
Inline headings are stored as flys anchored at the start of the
paragraph.

`SwTOXSortTabBase::sort_lt` is responsible for sorting the content of
Table of Contents. Inline headings are not properly handled, which
results in incorrect ordering of outline elements in TOC.

Navigation panel also suffers with the same problem, where fly nodes
are always assumed to render after the anchor paragraph. Handle as-char
fly nodes which are positioned at the start of the anchor paragraph.

Change-Id: Id3339b85fbae7731cfc5620477def1057ca15e31
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2596
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 745330e2d6f8c31193bdd10ba7e039a2aba6d6a8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205781
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 09:33:59 +02:00
Karthik a24b03d274 sw: Hide Prev/Next page fields in non ODF formats
Word doesn't have Prev/Next page fields feature, disable it in UI while
working on non ODF formats.

Change-Id: I5a23baea7d521bd549343449cbf9ba55578aea2c
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2894
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 32017444efd5db64a9aeed99f65acd896fc1947f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205783
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 09:33:54 +02:00
Karthik 57a66d43a9 sc: XLSX export renders double check-boxes in Excel
Form controls are described twice in XLSX export
(VML Shape and DrawingML shpae). Excel need to know these two entries
refer to the same checkbox. So, DrawingML shape's `hidden` attribute
should be set to true and we should export `a14:compatExt` element to
link the VML shape to the DrawingML shape.

Change-Id: Idb8473a10ae5c5961d34128f2142050c64341b97
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2795
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 13318fa9ea1d78b85eeab68334dcc533797d4c53)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205782
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 09:29:35 +02:00
Karthik 2e4112e55a svg: Correctly import "baseline-shift"
If the `baseline-shift` is a percentage it should be imported relative
to the font-size. Currently it's being imported relative to the parent's
`baseline-shift`

reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/baseline-shift

Change-Id: I5443e4ce748b423d074e0ca03bb4172607bd52ac
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3097
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 0e1af2c9f8e95f14deb0e4643bef90cf98065aa5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205780
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 09:28:05 +02:00
Karthik 7398fc4a0d sw: Fix positioning of inline text-boxes
This is a regression from 0d29394598
(https://gerrit.libreoffice.org/c/core/+/129627).

Word text-boxes are imported as dual-frame (SwFlyFrame inside a
SdrObject), for inline text-boxes the text (SwFlyFrame) is positioned
incorrectly.

While addressing a different problem the commit
0d29394598 changed how inline text-boxes
are positioned. Because of this there is a mismatch b/w the position of
shape (SdrObject) and text (SwFlyFrame) inside the shape.

SwFlyFrame should be positioned based on the SdrObject's position in
the document.

Change-Id: Ia902468f2a17a32aba928af022a1199345f21bcb
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2494
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 3d53aa0e171e72274831278234648f11641b55fe)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205510
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-22 16:13:03 +02:00
Karthik b8c5fb6d7b PPTX: Master slide background is not preserved
During PPTX import we are overriding master-slide background with the
layout's background.

Change-Id: I685fd8fbebc7f5a93258491590bbf920c928c5b1
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1982
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 2de1e56fe11b46c95985cf56cd7216f8e154afcb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205286
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-18 13:07:06 +02:00
Karthik 25ba87fd5f sw: Layout - avoid horizontal orientation check shifting down tables
This is an extension of 7b1c03ed87,
no need to check HoriOrient to shift down tables. Also handle flys
inside a split-table.

Change-Id: I315cd253258ee001451403bab977b8695125d55d
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1467
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 5d0765140507222dfa8a8275e6fc071b44b9614f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205157
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-13 13:21:00 +02:00
Karthik a28d3d2717 PPTX: Hidden property of group-shapes is not preserved
When exporting to PPTX, we are not writing "hidden" attribute for
group-shapes.

Change-Id: I888da834d05fb891bca9c1fe26d6fd958e62a994
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1903
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 9afa317ca6db7b112d6d457ac512664c5d71b041)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204852
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-06 17:27:55 +02:00
Karthik 360931133a XLSX: Valid data-validations are not being exported
This is a regression from 924c27b81f7f977c37668e57a298d199ab738268,
Excel only accepts either a defined name or a cell reference in
data-validation formulas.

There might be some edge cases, we should extend `isValidList` function
to cover those cases.

Change-Id: I57c479e99acb94d0b038b2ff5b55f83c9f5717ac
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1888
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 6b40ebc9e67b165e85212d92c861fc6844d24f42)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204853
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-06 14:29:05 +02:00
Karthik 4689aa184e DOCX: Incorrect import of inline paragraphs
During import inline paragraphs are converted to a text frame.
`finishParagraph` uses `xPreviousParagraph` while importing.
`xPreviousParagraph` is set by `xTextRange`, which contains a reference
to the paragraph. For inline paragraphs the paragraph is converted to a
frame and disposed by `convertToSwTextFrame`. So, `xTextRange` refers to
a disposed paragraph, this can lead to improper import of subsequent
paragraphs (loosing the paragraph break).

Don't assign `xTextRange` for inline paragraphs.

Change-Id: Iab6eac9616291065f2d03076886f177ba3d96694
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1893
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 2e9fe0f2428213c4c18d891c05bc382288fb8feb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204851
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-06 14:28:52 +02:00
Karthik 66da16cec0 XLSX: Preserve "stroked" attribute in VML shapes for check-boxes
We don't have a border property for check-boxes in our model. "stroke"
property of the shape is dropped from check-boxes during import. During
export we dont' write `stroked` attribute in vml shape <v:shape>, in
Excel by default the stroke property is true, becaue of this check-boxes
get a border with solid line in Excel.

Roundtrip the "stroked" property using a grabbag

Change-Id: I23a847e24195e17d65ea4337308ce47c99c1935f
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1468
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 84b32c649b350ea47256d1e451bbd038063987c4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204850
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-06 11:07:55 +02:00
Karthik 9cbc2fde79 sc: Error constants are parsed incorrectly
This is a regression from 2302e1d6e7ac1591266d14c7bb63724442003659,
before the commit, error constants were parsed as ocBad opcode which was
handled by the compiler. After the commit error constants parsed as
ocPush with `svError`, this was not handled in the compiler.

bug-document: forum-mso-en4-90234.xlsx
Change-Id: I7ce11644219c42dd4eae673b32d07880d7f7e926
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1302
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-by: Balázs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 3ede05ee4c0fa34b3fdc718d4f22714ea903d373)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204849
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-06 10:57:05 +02:00
Karthik 9a2fd1711d XLSX: External references of drawing-shape macros are not exported
Drawing-shape can contain a macro attribute, this might reference an
external defined name. The external link referenced by this reference
is not being exported.

bug-document: forum-mso-de-112942.xlsx
Change-Id: I55b7fee06a93b6f08b9df0803bce78bbd37e2efe
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1156
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 9d4d3f6fdc67ed43c472b8a4f75c12a66aeb46f0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204748
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-04 20:34:59 +02:00
Karthik 6007f05be2 sc: External links with xlStartup relationship type are not preserved
External links can have `xlStartup` relationship which is used to lookup
documents from Excel's Startup folder. These links are getting exported
as `externalLinkPath`.

This is similar to 9e075deee9138ab67c689b6b0d1fdd9d4d24a4be

bug-document: forum-mso-en4-31562.xls
Change-Id: I43efc144092ab7961fa486fcbd1e4d7676ddbbaa
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/908
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 805cfc8e75c968173494f5fc50ccc9dd66c27755)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204747
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-04 20:34:47 +02:00
Karthik eefcd2aea4 XLSX: Skip pivot formats referencing fields outside pivot cache range
When exporting to XLSX, pivot cache is updated but the pivot formats are
not updated, this might result is some formats referencing fields
outside the pivot cache range.

bug-document: forum-mso-de-106105.xlsx
Change-Id: Id78f0e90c8de68c4cbe749674b520eebb8ce27c4
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/817
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 126b890741ae74ee37edad44cd0759fa971a0d76)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204746
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-04 20:34:39 +02:00
Karthik 18d0b58804 tdf#171762: Font's charset property is never used
<w:font> element contains a child element <w:charset>, which denotes
the font's charset value, `<w:charset w:val="02"/>` indicates that its
a symbol font. This value is properly imported and stored in the
FontEntry.

But when processing the text runs, we do not use the charset property
of the font.

Change-Id: If791c52a3a3678be47a158b8e763d38e339b03fc
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1388
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 9fce988742260ef35024a6f4af60e662ef01eb55)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204570
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-29 22:11:20 +02:00
Karthik 29064dbd64 XLSX: External defined names with empty formulas are not preserved
If an external link contains a defined name without the `refersTo`
attribute, they are not being imported.

Change-Id: I352d972146952c4dda2393528574d0c6c10aedd1
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/906
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 7107895c9fe87941085ee66f9f7d13dd79ec0f36)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204495
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-29 10:37:01 +02:00
Karthik af11368710 sc: Use "#REF!" for invalid ocPush tokens
Invalid ocPush tokens are not handled in the FormulaCompiler

bug-document: forum-mso-de-103430.xlsx
Change-Id: I1e0cb7d5db7f0050c7d553ba30049737015f666b
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/747
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 0a8c627e725fb4c9666aa7307db15a5515958485)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204494
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-04-29 10:36:55 +02:00
Karthik Godha f5a2d3ef39 XLSX: Handle external references with missing path
External references with relationship type
"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing"
are not handled. Because of this formulas referencing this external
reference are not imported properly.

bug-document: forum-mso-de-100068.xlsx
Change-Id: I8032ea42a319ab0b5fd0ede3880469a3fe77cdfa
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/201
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 9e075deee9138ab67c689b6b0d1fdd9d4d24a4be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204476
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-28 09:47:08 +02:00
Karthik Godha d2ef7090de sc: Include error constants in OpCodeMap
When importing formulas of data validataion, we use a custom OpCodeMap
which doesn't include error constants. Because of this invalid
external references are not properly being imported which was fixed
with (e3d17e1abca66cb01f7420fb8003eefd573b00e9)

bug-document: forum-de2-6391.xlsx
Change-Id: I3a79910d7dad95009ea4de6a36f181d76680d320
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/59
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Balázs Varga <balazs.varga@collabora.com>
(cherry picked from commit 2302e1d6e7ac1591266d14c7bb63724442003659)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204475
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-28 09:46:39 +02:00
Karthik de35dc3a6a XLSX: Correctly export autofilter button for merged cells
This is an extension of 7f33c325e7985013767ab8c541db6b169569fc78,
properly handle autofilter dropdown button in XLSX export so that Excel
correctly renders these buttons

Change-Id: I89aecdf3c60fd39fcb9b4c0efe4bb16cba7b8e13
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/671
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit f35ebcd98f88b9f679fd4d2810e9690bea2f62ff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204404
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-27 18:36:37 +02:00
Karthik Godha c1ab7ab723 DOCX: Create new rel IDs for duplicate OLEs
This is a regression from 711f6aff699a46d661bc1285be712e158d05b7c2,
a single OLE can be used in multiple header/footer files, in those cases
we were using same rel ID across all files for the same OLE, we need
to create a new rel ID for every new file.

bug-doc: fdo44257-1.docx
Change-Id: I03c675802951f3c057d05733776197e516b4a07f
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/57
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 163927cb5a745b35597d01372ffd8a9d879425b4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204403
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-04-27 16:44:54 +02:00
Karthik Godha 66081b8f71 XLSX: Importing tables with power query connections
If a table type is "queryTable", Excel might remove table data from the
sheet based on `removeDataOnSave` attribute. In those cases, when we
export the table to XLSX, we write empty column headers, which Excel
doesn't accept.

bug-doc: forum-es-7685.xlsx
Change-Id: Ia05dda91c0806271e1846e1512328950a048ff28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203050
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit fa2cbdb84ad571379c183f76e66c12920e787f4d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204433
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-27 13:25:55 +02:00
Karthik Godha b3ccb6dd3a DOCX: Skip exporting duplicate OLEs
OLEs inside a frame are exported using `mc:AlternateContent`. The same
OLE is exported twice, once in DML and once in VML.

Change-Id: I3cdda222e8d320e0e1599e94dc00f831a3a4fafb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202133
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 711f6aff699a46d661bc1285be712e158d05b7c2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202644
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204226
Tested-by: Jenkins
2026-04-27 08:55:25 +02:00
Karthik Godha e727898837 XLSX: Export of empty comments
Every comment should have a corresponding `v:shape` in vmlDrawings. We
are not exporting `v:shape` for empty comments.

bug-document: fdo74442-1.xlsx
Change-Id: Id4959d2af3a785c036416e2e02564f8411b5bf67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202977
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204265
Tested-by: Jenkins
2026-04-27 01:11:00 +02:00
Karthik Godha 1bb6615eb3 XLSX: Handle "#REF!" in external double references
This is a regression from e3d17e1abca66cb01f7420fb8003eefd573b00e9,
Use "#REF! if any one of the reference in a double reference is invalid.

ex: "Data!A1:#REF!" should be exported as "Data!#REF!"

bug-document: forum-mso-de-19736.xls
Change-Id: I9f17c3a42844a5fcd00a7d94eef8e9a7bafc6bd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202657
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 0518e9457eae3563836299a76a973deca7f73136)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202974
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204264
Tested-by: Jenkins
2026-04-27 01:10:54 +02:00
Karthik Godha 045a3b12a5 XLSX: Handle import of empty formula
Empty formula element is not handled during XLSX import

bug-document: fdo68425-2.xlsx
Change-Id: Ie05ae6d85f518f8f5ff803d4bc163cab0e5dba6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202956
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204263
Tested-by: Jenkins
2026-04-27 01:10:47 +02:00
Karthik Godha d6a52488e4 XLSX: Export of PivotTable field flags with invalid dates
This is an extension of d223775e011ac1d8253b4488ec2d941b2dd3e8a9,
invalid dates in pivot table are properly handled but the flages of the
fields are not handled.

bug-document: ooo72278-2.xls
Change-Id: I12469386fb07c4d4922fc0853c6d4d246b97b310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202868
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204262
Tested-by: Jenkins
2026-04-25 10:19:31 +02:00
Karthik Godha 75a6ac7059 XLSX: Export external refs of Conditional formats in <extLst>
This is an extension of 64414578751993d48eb5f806ec85bc9f60b5f269,
external references of conditional formats in <extLst> are not being
exported.

bug-document: forum-mso-de-108610.xls
Change-Id: I748bd229123ec987c68ecdd20aebfdbf14fa4fb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202811
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204261
Tested-by: Jenkins
2026-04-25 10:19:13 +02:00
Karthik Godha 0ff5e85c73 XLSX: Use "#REF!" for invalid user-defined functions
This is a regression from bce84f279755171addf29b61f4e8b09e89026c44,
for empty user-defined functions use "#REF!"

bug-document: forum-mso-de-49320.xls
Change-Id: I67d43b8adaf53c1d54aaf91db58dfff3b005310d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201983
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 66e7fb01de87ad8cb15fe56539549eca158e7ab6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202812
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204260
Tested-by: Jenkins
2026-04-25 10:19:05 +02:00
Karthik Godha 30d4e1add8 XLS: Grouping is not preserved for PivotTable with external source
Data of pivot table with external source is imported as string items.
When grouping is done in `ScDPSaveGroupDimension::AddToCache`,
`ScDPSaveGroupItem::ConvertElementsToItems` converts string numbers to
double items, but the source contains string item for the same data.
Because of this mismatch grouping is not preserved.

bug-document: forum-mso-en4-58929.xls
Change-Id: If32311204eca4009ec2a00e37271f7bd5cc2d45c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202734
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204229
Tested-by: Jenkins
2026-04-24 14:19:46 +02:00
Karthik Godha e60a3cb6d7 XLSX: Excel needs atleast 4 arguments in ACCRINTM function
In LO, ACCRINTM function is valid with just 3 argumnets, but Excel needs
atleast 4 arguments.

https://support.microsoft.com/en-us/office/accrintm-function-f62f01f9-5754-4cc4-805b-0e70199328a7

bug-document: ooo70041-3.xls
Change-Id: Ib1eb9dc30e407c33f8044dfef621edb7480e28ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202856
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204228
Tested-by: Jenkins
2026-04-24 14:16:33 +02:00
Karthik Godha 848614ffd1 XLS: PivotTable external source fields are not properly imported
Excel can produce pivot table cache for an external source without the
flags `HASITEMS` and `POSTPONE`. This case is not handled when importing
external pivot table cache.

bug-document: forum-mso-en4-243595.xls
Change-Id: If08f0a4c28b604c4ad4eb7e796b9ab1fef0f2af7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202639
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204227
Tested-by: Jenkins
2026-04-24 13:29:22 +02:00
Karthik Godha a70e3dbfc6 XLSX: Skip export of Data Validations with invalid formulas
bug-document: forum-mso-en4-83006.xls
Change-Id: I92f0f4c374bf86ef5a8b5897777f377282352a0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201130
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204180
Tested-by: Jenkins
2026-04-24 10:21:14 +02:00
Karthik Godha e9f276ebd8 XLSX: Handle "#" in formulas with special characters
This is a follow-up of (https://gerrit.libreoffice.org/c/core/+/201533),
formulas like `'[1]foo bar'!#REF!` are not imported properly. "#" is
not handled in formulas.

bug-document: fdo54757-1.xlsx
Change-Id: I41ed217ec26b62785cea67b6e141b3071df9a12e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201601
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204181
Tested-by: Jenkins
2026-04-24 10:21:07 +02:00
Karthik Godha 3c16f8c196 XLS: Import OLE objects with empty cache matrix
Add support to import newer version of Excel OLEs "Excel.Sheet.12" and
remove the check to discard OLEs with empty cache matrix.

bug-document: forum-mso-en4-507913.xls
Change-Id: Iab4aab4ad52471114f993599a87e9978ae0d8e80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201026
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204178
Tested-by: Jenkins
2026-04-23 22:08:16 +02:00
Karthik Godha 9678b37547 XLSX: Handle empty name for Named Ranges in export
bug-document: forum-mso-en4-59396.xls
Change-Id: Icd7c5ab51c88ea1c1830b610b243c7cf0d66b1cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200938
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204179
Tested-by: Jenkins
2026-04-23 20:39:15 +02:00
Karthik Godha a33bd0dadc XLSX: Import external references with "#REF!"
Valid external references with "#REF!" are imported as `ocBad`

Change-Id: Iaf1d70a0a3e30d45ea8ce9be8e263d9fe4953bab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201533
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204177
Tested-by: Jenkins
2026-04-23 20:38:57 +02:00
Karthik Godha 1764ed1df3 XLS: Import invalid external OLEs as ocErrRef
Instead of importing invalid external OLEs as `ocNoName`, use `ocErrRef`
for Excel compatibility.

bug-document: ooo34686-1.xls
Change-Id: Idf8c163d5dd5a9b43b7db992e045f764b4592e07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201244
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204176
Tested-by: Jenkins
2026-04-23 20:38:52 +02:00
Karthik Godha 8b89de7c68 XLSX: Round decimal values to 15 digits in PivotTable
In PivotTable "containsInteger" attribute in not properly exported.
Number values are exported using `OString::number(double)` which rounds
the number to 15 digits, but the flag which is used to export
"containsInteger" attribute doesn't round the number to 15 digits.

bug-document: forum-mso-en4-258680.xls
Change-Id: I463527af95cd527223ce1b2c1743dc6cb2dbeea5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200808
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204175
Tested-by: Jenkins
2026-04-23 20:38:41 +02:00
Karthik Godha 773f70860e XLS: Import label errors as ocErrName
Instead of importing label errors as ocBad, import them as ocErrName for
compatability with Excel

bug-document: forum-mso-en4-404603.xls
Change-Id: I384c6f844c8645ffcce81af42f433cf9a236158d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200925
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204160
Tested-by: Jenkins
2026-04-23 15:57:03 +02:00
Karthik Godha 4235e1ea1b XLSX: UserDefined function name can't have spaces
Replace all space characters in user-defined function with underscore

bug-document: forum-mso-en4-435371.xls
Change-Id: I1c6d7232736afdb5987f123dc1956af32ddad020
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201025
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204163
Tested-by: Jenkins
2026-04-23 15:47:56 +02:00
Karthik Godha 922bfef520 XLSX: Export only non-default font styles in Header/Footer
When exporting <headerFooter> element, only export non-default style
name. Excel discards the element if the style name is "Regular".

bug-document: forum-mso-en4-282841.xls
Change-Id: Ie532edb02b3e7a60334428e784cc437fc615b4d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200874
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204162
Tested-by: Jenkins
2026-04-23 15:44:16 +02:00
Karthik Godha 721b2d55b3 XLSX: Quote sheet names matching "TRUE/FALSE"
Sheet name could be "TRUE" or "FALSE", these should be quoted when
exported to XLSX

bug-document: forum-mso-en4-460757.xls
Change-Id: I0f87920f0dc5c9039f47ebf12f82b2537ea752da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200939
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204161
Tested-by: Jenkins
2026-04-23 15:44:08 +02:00
Karthik Godha 51a7c406ad XLSX: Export external NamedRange functions as user-defined functions
Excel expects user-defined flag in front of external named range
functions

bug-document: forum-mso-de-56989.xls
Change-Id: I27f0cd4107ac7868abb3d2540ad60abfbd18326f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200479
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204131
Tested-by: Jenkins
2026-04-23 12:44:55 +02:00
Karthik Godha 1f5c17cc84 sc: Add new ocUDExternal token for user-defined functions
Excel uses "_xludf." prefix for formulas containing unkown external
functions. A new token ocUDExternal is created to handle unknown
external functions

bug-document: forum-mso-en4-352508.xls
Change-Id: If08469e496ff76bb8b912211bd82c67363711d74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199631
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204130
Tested-by: Jenkins
2026-04-23 12:44:43 +02:00
Karthik Godha 8359e9974a PPTX: Use correct shape-id for connector shapes
This is a regression from be36f4c40bb7b0c1b8ceb974c932a687f5c488be

bug-document: forum-mso-de-136509.pptx
Change-Id: If1f4280459245c1cb30cbe5559d22d22d91c558c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200003
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204123
Tested-by: Jenkins
2026-04-23 09:00:39 +02:00
Karthik Godha 3fecafa693 XLSX: Infinte loop during formula creation
This is related to b58f026ebd91a9eda62cccb188b559bd4f2d70cf, condition
for invalid external refs is not handled properly.

Change-Id: I597a02fdee967f170b09ffe2b529dc114491291a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199632
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 5465c05150db3ff476bed27f573571c38d7ba249)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200609
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204121
Tested-by: Jenkins
2026-04-22 20:03:58 +02:00
Karthik Godha 3cde2e72e0 XLS: Import 3D references with invalid sheet
Instead of dropping entire 3D reference with invalid sheet, just drop
the sheet name in the reference.

bug-document: forum-mso-de-64377
Change-Id: I85dac5b1fdfbb8d226356cf37062f41c2e2440df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200690
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 45e82bb8962f7f99fbd5a6aada22fb4ae3ce7c75)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201985
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204122
Tested-by: Jenkins
2026-04-22 19:59:32 +02:00
Karthik Godha 58a890589d tdf#168964: OLEs inside a frame can't have absolute positioning
When exporting to DOCX, OLEs inside a frame are using
"position:absolute" in the style attribute. When a frame is exported to
DOCX, it becomes a text-box. Child objects of a text box can't have
absolute positioning, they can only be positioned relative to the
text-box.

bug-document: fdo31183-1.odt
Change-Id: Ifddf80dbd2402b6182b27467239bb6a2bf4dd71b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201999
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit a8aef3915f7479f9b6b478971e7f1f7bdf756ab7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204106
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-22 19:23:37 +02:00
Karthik 2544fe7f13 tdf#169332: Images with editAs attribute are not properly imported
All `twoCellAnchor` images are anchored to `from` and `to` cells
regardless of what `editAs` attribute specifies.

Images should be positined and sized according to `editAs` attribute
(ISO-IEC-29500-1 2016 [20.5.3.2])

Change-Id: Iecc648c6d51355dd9bc0cbe52f84edcf1f765dd2
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/557
Reviewed-by: Balázs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 1387a15ecc32b18374c0826fa3b94f6141b6f1c3)
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/907
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 1173381c763579d4b6dc3231e521fe571c5ccb44)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203806
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-22 17:58:26 +02:00
Karthik Godha 5080749500 sc: XLS - Import external Named-Range functions
External Named-Range could be a function, these are not handled during
XLS import.

bug-document: forum-mso-en4-31562.xls
Change-Id: I75bea0a595b717b7af8f555dedfe582752a3db7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199240
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 086bc31ef7058c91a2003aa00dcb6563e5562308)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200405
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204090
Tested-by: Jenkins
2026-04-22 17:16:27 +02:00
Karthik Godha 8dd70e5292 XLS: Import unknown external references
For older XLS files, only the external references which contain their
source file in the systerm are getting imported.
Import all external references even if the source file is not present
in the system.

bug-document: forum-mso-en4-366513.xls
Change-Id: I33c919f1a8f5bd4cbf621fc3fd8ccb7105429f16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199817
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 5c916f08714bde7f10c88869b8e9e8da89caaa9c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200411
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204093
Tested-by: Jenkins
2026-04-22 17:16:23 +02:00
Karthik Godha ae6a829e04 XLSX: Invalid cell link in Form Controls
Cell links of Form Controls contains tab names, they should be checked
for quotes. Also escape characters are not escaped.

bug-document: forum-mso-en4-356971.xls
Change-Id: I6ca8abed209171c7e78a99a27edaee05d0f221b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199719
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 30a127e54390aeaad12f51eaa6323863fa04b3b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200409
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204092
Tested-by: Jenkins
2026-04-22 17:16:19 +02:00
Karthik Godha 634ef3b31d sc: Invalid external refs in conditional formatting
Use "#REF!" for invalid external refs in formulas. The bug-file contains
invalid external ref in it's conditional formatting.

bug-document: forum-mso-en4-335846.xls
Change-Id: I19f179e0b4cff8ca6db3de8678e01d287fbbe61b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199444
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit b58f026ebd91a9eda62cccb188b559bd4f2d70cf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200408
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204094
Tested-by: Jenkins
2026-04-22 17:16:04 +02:00
Karthik Godha 2737b4f8c9 XLSX: Single cell R1C1 address in defined name
R1C1 style single cell reference is not handled in SanitizeDefinedName

bug-document: forum-mso-en4-31668.xls
Change-Id: I53ca52065e45029b7293248eb6996736044fccde
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199445
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit a04fecfdd2de8db0244bbcef1bf7daca5b7a3e83)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200407
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204091
Tested-by: Jenkins
2026-04-22 12:19:14 +02:00
Karthik f093e31c36 tdf#169363: AutoFilter button properties are not properly imported
When importing autofilters from XLSX, we assumed that every column in
the autofilter range would have `filterColumn` element, which is not the
case.

Also dropdown button display on merged cells is incorrectly imported.

Change-Id: I052b5ea8c813f3ecad13e4dc5d6b0512079d94df
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/581
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203608
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-16 17:13:42 +02:00
Karthik Godha 5a53c874fa tdf#171133: Discrete grouping of dates
When discrete grouping is done on pivot table with dates the grouping is
not preserved

This is an extension of ed44cb66a32a42e00a86998d677537c044f40643

bug-doc: forum-mso-en4-214525.xls
Change-Id: I2872be5aa28598b9d2963e3714d77dc05e642f93
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/218
Reviewed-by: Balázs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203585
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
2026-04-15 15:46:27 +02:00
Karthik Godha 343601b11f tdf#171133: PivotTable grouping with string numbers
When pivot table data contains numbers formatted as string, discrete
grouping of this data is not preserved.

Change-Id: I00866c37048aa545d3707b27451e615e248f8ba2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202953
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203583
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
2026-04-15 15:45:44 +02:00
Karthik f162fd2763 tdf#171713: Invalid accessibility names in table styles dialog
Change-Id: Ic55f77e262601fb5d2df2be5f27d1c2f06534b90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203584
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-04-15 06:47:49 +02:00
Karthik Godha 92317927cd tdf#171221: Import Named Ranges from older XLS files
Scoped named ranges are not imported from older XLS files.

bug-document: ooo44019-1.xls
Change-Id: Ie80fc3a410fbbdd91222412926f5d9eb0a7af9df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201267
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 719667451fef4e2692edfab774e7d9bc3738d96f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202126
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-03-19 10:59:52 +01:00
Karthik Godha a72bf83bef tdf#171084: Invalid filename used for external references
bug-document: forum-mso-en4-109719.xls
Change-Id: I52bac59b9930f65f43dd9b354309d6ce57fcddd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200692
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit a8a694f065d26039457fda5a1e5de1aae1daaf7a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202127
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-03-19 09:44:11 +01:00
Karthik Godha 2daf0f2f81 tdf#171083: Export external refs in Conditional Formats
External references used in conditional formats are not exported. To
export external references they should be registered with
XclExpLinkManager.

Add explicit function call to XclExpFormulaCompiler::CreateFormula,
this will eventually call XclExpLinkManager::FindExtSheet, which is used
to register external refs.

bug-document: forum-mso-en4-142073.xls
Change-Id: Ie9bc6df8cd881c4f42cb96f6538972aa6ae70461
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200691
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 64414578751993d48eb5f806ec85bc9f60b5f269)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201987
Tested-by: Jenkins
2026-03-19 06:37:58 +01:00
Karthik Godha 16a9d96773 XLSX: Extra ocStop token was added to table formulas
When importing tables from XLSX, an extra ocStop token was added to the
token array.

bug-document: fdo84819-1.xlsx
Change-Id: I5f13468127f13e0b7964ff536e269246f3afb8b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201354
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
(cherry picked from commit 2181bf05e087ecf8589f7d855ecbe00e90fb0832)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201540
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
2026-03-12 19:06:52 +01:00
Karthik Godha 80ca8fed80 XLSX: Fix empty font-name of charts in export
This is related to 582ccfd0ad277acdcc8ecb28ccbca48c0ed8af89. Use default
font for charts without fontdata.

bug-document: tdf104392-1.ods
Change-Id: Ie27ac52d57a02bfdf8d65fd8a14dac3318d0e17e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201347
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2026-03-10 12:18:34 +01:00
Karthik Godha 34340809cd XLSX: Properly handle macros in array formulas
This is a regression from 108f4aa94b98ca6deffdc169068c175605d5ba67,
XML_f element of array formulas containing macros was not closed in
XLSX export.

Change-Id: Iffd482ec23797bc64647a07e991220f373986d95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199539
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201008
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2026-03-05 17:15:40 +01:00
Karthik Godha 0ab1fda0d8 XLSX: Handle invalid Dates in PivotTable
In Excel, Date can't be later than 9999-12-31.

bug-document: forum-mso-en4-213374.xls
Change-Id: Ice06439386abd64384e2b5255054b08d610e42a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198546
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit d223775e011ac1d8253b4488ec2d941b2dd3e8a9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200487
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-03-01 04:40:35 +01:00
Karthik Godha e1c468014d XLSX: Handle invalid SheetName in ExternalLink
bug-document: forum-mso-de-79957.xls
Change-Id: I62aee260a64bcf512bf92f985bdbe796796b52a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198511
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 7f7ac179e8f5194a1e8da34737a21ea1fbe65409)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200489
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-27 10:57:39 +01:00
Karthik Godha c83b79b0bd XLSX: Discard formulas with invalid external reference
A formula can contain `ocExternal` token without a valid external
reference. Discard them in OOXML export

bug-document: forum-mso-en4-31562.xls
Change-Id: I7049ad2966c8d14d12b7845b32616ad262a25f99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199154
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit ea98a7cf6ed8c97993f60e9f8a07b09d1cc57ffc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200495
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-27 07:45:49 +01:00
Karthik Godha 87b12b54cd XLSX: Properly handle quotes in 3D references
This is related to 472f17d203.

bug-document: forum-mso-en4-254252.xls
Change-Id: I748ea3aa920d560085398aab08cd35deeb2818d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198963
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 6868442d97773bccabeb50b12b0f373a262933d0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200493
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins
2026-02-27 07:45:12 +01:00
Karthik Godha a6c53af56c XLSX: Quote sheet-names containing cell references
If a cell reference (ex: "a1") is used as a sheet name then it should be
quoted

bug-document: forum-mso-en4-242275.xls
Change-Id: I67ade8629644a97d0d0308715df04a8a1ac206ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198940
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 9fd870f301fe546dd79eb7e26b021e7fd770c831)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200494
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-27 02:53:44 +01:00
Karthik Godha c8a50ea125 XLSX: "#Name!" is being exported in formulas
ocNoName token of type `svExternal` or `svString` would result in
"#name!{token_string}". In XLSX a valid formula can't contain "#name!".

bug-document: forum-mso-en4-29202.xls
Change-Id: I9dcc25f2b14948385573657c562768ff3d598d97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198941
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit a8f540c06a0572560aa75427a1884d8ecf1a1f44)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200492
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins
2026-02-27 02:53:07 +01:00
Karthik Godha aaa451ad65 XLSX: Use "#REF!" for invalid arguments in functions
When importing from an XLS file, invalid function arguments can be
imported as `ocStop` token. During XLSX export this token is not handled.

bug-document: forum-mso-en4-274422.xls
Change-Id: I88e50b3da1bda18da37640594a8c59fd5ee20c30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198980
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 03ec841be2e25e4497c9ee301427f5573b734c9b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200491
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins
2026-02-27 02:52:53 +01:00
Karthik Godha 51d0ba7ddd tdf#170677: DataTable is not properly imported
When opening an XLSX file containing DataTable, values of the cells in
the DataTable are missing. We have to manually reapply the formula to
see the values.

Change-Id: I1777a3aea2c82632575f1365fe1b7cdde9ae3bad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198939
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit a2305e02114c203bc58f4a174debd3bbb00a9d6b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200490
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins
2026-02-27 02:52:09 +01:00
Karthik Godha e2f2290a13 XLSX: Use ',' as Union operator
Excel uses ',' insteal of `~` as union operator

support page: https://support.microsoft.com/en-us/office/using-calculation-operators-in-excel-formulas-78be92ad-563c-4d62-b081-ae6da5c2ca69

bug-document: forum-mso-de-50772.xls
Change-Id: I0dcf563d0a75dd4e3f5a573519eeb9ace525bc14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198510
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 88cf867bf80475c9e3f04a09c938608d1cd1f0bd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200488
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-27 02:51:12 +01:00
Karthik Godha 5ee40c578c XLSX: Use Excel compatible errors in PivotTable
Excel doesn't support all LO internal errors, replace them with Excel
compatible errors
Ex: #ADDIN?

bug-document: forum-mso-en3-16864.xls
Change-Id: Id6d4f9e2d36e16f859c08a9bf2a0f96fea87d3b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198509
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit fb138143df479e2f742ed194fdeb55606e032c77)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200480
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-27 02:49:05 +01:00
Karthik Godha 8ea0c3678f tdf#170565: Handle empty aggregate functions in XLSX
This is an extension of 3cbf4957d3,
handle AVERAGE, COUNT and PRODUCT functions without parameters in XLSX

Change-Id: I6c669e58f4d1ca87b557d11cd16cfd284531360f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199345
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200162
Tested-by: Jenkins
2026-02-24 23:35:56 +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
Karthik Godha 12c5d81816 XLSX: Completely discard formulas containing macros
Change-Id: I8f2b034d83c14cf62f74ee3be1ed23663d5dfdad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199153
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 108f4aa94b98ca6deffdc169068c175605d5ba67)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199607
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins
2026-02-18 17:00:29 +01:00
Karthik Godha 4efce48d6a sc: XLSX - Sanitize Defined Name
Sanitize defined name in XLSX export, it can't have any special
characters ex:- ('[',']','.',' '). Also it can't contain any valid cell
references

bug-document: forum-mso-de-35646.xls
Change-Id: Id64cd529c10801f182afa6cda165edf9e7d4ab30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197817
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 0a3ee4978e90a68d1e22c36d4e41f5208b854389)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199425
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins
2026-02-16 05:43:26 +01:00
Karthik Godha 52a14d417a tdf#170292: R1C1 reference style in defined names
Defined names can't contian R1C1 references as name

bug-document: forum-mso-de-23552.xls

Change-Id: I4798b783cc1e1d84c04d236a11710bd778c6af49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197762
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit d7c06bd82504c66aad79edc2193827b23ba47481)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199421
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins
2026-02-16 04:47:58 +01:00
Karthik Godha d6956b843d XLSX: DataValidation - Handle double quotes in list
Data Validation List containing double quotes are not handled during
XLSX export

bug-document: forum-mso-de-54556.xls
Change-Id: Ib77d7030f6c2a75a48d3a3bbd00d1618ba84051c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198404
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 1c0df6304c57ae1896701e85fe77bfb9a9ba9f2b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199431
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-16 03:41:26 +01:00
Karthik Godha fbc4e2db2a tdf#170452: Export external refs of Data Validation
External references used in data validation are not exported. To export
External references they should be registered with XclExpLinkManager.

Add explicit function call to XclExpFormulaCompiler::CreateFormula,
this will eventually call XclExpLinkManager::FindExtSheet, which is used
to register external refs.

bug-document: forum-mso-de-39647.xls

Change-Id: I0f010f0b5e990ba098361996598d7363647b05ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197954
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 97c290624f6e0d992ea5a075f316405dcfca8d38)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199427
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-16 03:18:58 +01:00
Karthik Godha 6ddb73687f sc: Accept larger values in TRUNC function
If the second argument in TRUNC function is greater than int16 then
the function returns an error. Accept larger values for 2nd argument to
make it interoperable with Excel.

bug-document: forum-mso-de-11803

Change-Id: I9de5c1a2ed71831d4b1c0cf16ea0902c4e1de628
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198279
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 24d79a75d4e9e419e0d66d22ddaff6353fd83f80)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199429
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-16 03:18:16 +01:00
Karthik Godha 17478407d9 sc: XLSX - Use correct index in svExternalName
This is related to f85d860ccb, for
`svExternalName` use the index calculated during export.

bug-document: forum-mso-de-38936.xls

Change-Id: I4a75a2432ab9bd6f46d36c46fe985bbc33252154
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197917
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit b14a56012663adfe529b32fb78033a98af1b3847)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199424
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-16 02:25:07 +01:00
Karthik Godha b1d9ef708d sc: Export TIME cell formats as DATE type in PivotTable
In PivotCacheDefinition TIME cell formats are exported as Numerics,
along side with `fieldGroup` element. `fieldGroup` can only be
associated with DATE/TIME cells not Numerics.

bug-document: forum-mso-de-38288.xls

Change-Id: I677fedcd4d50ed5bea3aaf7a2a9d99d2ae0407e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198319
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 4dc8ff5919adb540c2ffa0e2ea30f785fc003dc8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199430
Tested-by: Jenkins
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
2026-02-16 01:15:33 +01:00
Karthik Godha f133be3207 XLS -> XLSX: Skip writing macros in formulas
During XLS import, formulas containing named references which are not in
ScRangeList are imported as macros. These are not handled during XLSX
export.

bug document: forum-en-1357.xls

Change-Id: I6584117c4956ca1e0166bb0a15b19cee404154b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197200
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 973d218475a071407cf3593ef9ab6243bc9c595c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199418
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
Tested-by: Jenkins
2026-02-16 01:15:18 +01:00