553 Commits
Author SHA1 Message Date
Justin Luth 5778c8ee6c tdf#173384 Revert "tdf#173164 oox: Export document thumbnail" as png
This reverts 27.2 commit 0a03f797bb.

Microsoft Office was unable to open any of the documents we produced
when the thumbnail was in PNG format.
It complains about corrupt content.

Change-Id: I9975374830459007bcf8cbda37ca9e0115eb74a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210471
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2026-09-03 22:21:41 +02:00
Andrea Gelmini d9621d3d34 Fix typos
Change-Id: I0319c3f278a56a9062636dbf978ab857b70c5449
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210172
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-08-28 08:46:00 +02:00
Ramil Nurmanov 0a03f797bb tdf#173164 oox: Export document thumbnail when saving OOXML
At the moment, LibreOffice supports creating thumbnails for documents in ODT format, but it does not create thumbnails for documents in OOXML format, even though this format supports this type.

I have transferred all the logic for creating thumbnails from ODT, namely from the functions sfx2/source/doc/objstor.cxx GenerateAndStoreThumbnail WriteThumbnail. Additionally,  bEncrypted was added and transferred for encryption.

To study the code and add encryption, as in ODT, Claude Sonnet 5 (Anthropic) was used.

Change-Id: I4d6fe178a5324ee3b43bd8a71f585413c0e4465b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209306
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2026-08-24 09:32:03 +02:00
Tomaž Vajngerl 4efc11357b sc: round-trip dynamic array spill state through XLSX
Make the spill state of a dynamic array survive a saveAndReload
to XLSX and make the XLSX be properly accepted by MSO. There is a
special way, with dynamic array extension to the format, which
must be written to the file.

Export:
- Emit xl/metadata.xml with an XLDAPR dynamicArrayProperties block,
  and register it in [Content_Types].xml and workbook rels.
- Mark the master cell with cm="1" and write aca="1" + ca="1" on f.
  A 1x1 collapsed master is written as a single cell reference.
- Map the SPILL cell error to "#VALUE!", since OOXML has no #SPILL!
  literal. Recalc on reload reclassifies it back to SPILL.

Import:
- Remember "cm" on the cell. A cached "#VALUE!" on an array master
  with "cm" set is treated as a SPILL hint so the blocker survives.

Extend the XLSX round-trip tests in subsequent_export_test2.

Change-Id: I9209e43f3a398e23fc7ca46daf58a88546687dba
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2865
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit eb85edc75e5100beb7802381175de914f4102a81)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205803
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 20:09:47 +02:00
Tomaž Vajngerl 2b8fedb4ec sc: add elements and parsing of namedSheetView*.xml files
This adds parsing of elements (namedSheetView) and sub-elements
contained in namedSheetView*.xml files. The data is contained in
NamedSheetViewData, but for now we don't do anything with this
data yet.

Change-Id: I9757bc4e7001a338e7e746ebc663eb3b9837519f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197706
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201947
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 7135df7768579bef1655923a125de2f440caf463)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205287
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-21 18:07:35 +02:00
Mike Kaganski d6611c3ccc oox, sc: import xlsx threaded comments and persons
Register the threadedcomments namespace and tokens in oox. Add
PersonsFragment (workbook-level) to import xl/persons/person.xml and
ThreadedCommentsFragment (worksheet-level) to import
xl/threadedComments/threadedComment*.xml. The fragment runs after
CommentsBuffer::finalizeImport() so that ScPostIt objects already exist;
it attaches ScThreadedCommentData with root text, reply chain, and
resolved flag to matching notes. Both the legacy fallback text and the
actual threaded comment text are preserved in the document model.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I0a47c74dc31ae8bb008d2a8da76a97ae3957dcc0
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/801
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 205ea7e4fb13b18b1940f287f4cbad60c8aee9cc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205294
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-19 09:27:46 +02:00
Andras Timar 6284d6d8ca tdf#114443 pptx export: write correct content type for PPSX/PPSM
When saving as PPSX (PowerPoint Show), the export always wrote the
content type as presentationml.presentation.main+xml (PPTX) instead
of presentationml.slideshow.main+xml (PPSX). This caused:
- Impress not auto-playing its own PPSX files on re-open
- PowerPoint rejecting PPSX files created by Impress
- Re-saved PPSX files from other apps losing their autoplay ability

Propagate the STARTPRESENTATION filter flag through the export chain
(FilterBase -> PowerPointImport -> PowerPointExport) and use it to
select the correct slideshow content type, following the same pattern
already used for template export.

Change-Id: Idcf6222d3855c587d0dabffe3a345c9ef2bfdcf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199884
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204105
Tested-by: Jenkins
2026-04-22 18:02:33 +02:00
Aron Budea dfc25ee0ca oox: exported customXml item relations must exist on part level
This patch only deals with main part relationship.

See 15.2.5 Custom XML Data Storage Part of ECMA-376-1:2016 specs

Change-Id: I0b529d8e7e4e0ea95f37cd8421a09c673c907298
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/602
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 758f1fd82dee30b2ab21272fd9739c1e5fcfb768)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204058
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-22 17:11:55 +02:00
Aron Budea 513b033c24 oox: Fix typo in DOCM filter name during detection
Otherwise affected files eg. fdo83844-1.doc fail to open.

Regression from 0f7cf56ca10e8b6cf34767d25281d783b416fbeb.

Change-Id: I55ba367b43e1ecdf586522ac1e47bb322bf12702
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202943
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
(cherry picked from commit 026bd8e1f3be8c2d7c9fd64f7ff03833313d2d30)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202982
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2026-03-30 19:51:16 +02:00
Aron Budea 835d45e005 tdf#171360 OOXML custom properties must be unique case insensitive
Otherwise Word fails to open the exported file.

Export of custom properties was implemented
in 47c5454ea6.

Change-Id: If35077d8cd3b2c3f52b6cd8b4d381769c0040f4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201909
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
2026-03-20 06:32:32 +01:00
Noel Grandin be2e9bf77e tdf#170595 reduce the number of times we open and parse the zip..
file container from 851 to 8.

This shaves 30% off the opening time.

This requires that we

(a) share the same instance of ShapeFilterBase in the child OODocumentImpl objects we create

(b) and re-use the mxPackage in the FilterBase class,
instead of re-opening the stream with a new OStorage object.

Change-Id: I058bddd04e93e7200bf446f00b5a1c24201b9041
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199269
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit eb318cfcc1c9c5bbad22c53af41fff615c984cca)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199266
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-02-13 19:49:56 +01:00
Gabor Kelemen 0bdcfc2900 tdf#146619 Use more forward declarations in include/unotools/
This shaves off some 40M of input

Change-Id: I12e10deb87ceea1f7a23f3de4ea624befe187c3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198238
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-02-05 17:35:46 +01:00
Simon Chenery 20839e4cd0 tdf#168771 Convert enum to enum class in filterbase.cxx
Change-Id: I7436bf80bcd970e43af63550935560cf3a9de90e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197533
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
2026-01-23 23:41:11 +01:00
Justin Luth df7e61358b tdf#170261: introduce DOCM 2010 (VBA) filters
This patch primarily allows exporting as an DOCM file
without forcing compatibilityMode = 12 (2007)
Other than that, I don't think there will be any other impact
(although that simple fact has lots of layout implications).

With this patch, the Word 2010-365 (macro-enabled) filter
will be the default for:
- --convert-to (command line) docm
- GUI (save-as) docm
- LOKit download as docm
- TestFilter::DOCM unit tests

Change-Id: Iabc9820096a100774157996b54e325c76d2440c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196789
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2026-01-10 16:34:57 +01:00
Justin Luth b5b2413db6 tdf#170261: introduce XLSM 2010 (VBA) filters
This patch primarily allows exporting as an XLSM file
without forcing lowestEdited = 4 (2007)
Other than that, I don't think there will be any other impact
(and at this point we don't even know of lowestEdited impacts).

With this patch, the Excel 2010-365 (macro-enabled) filter
will be the default for:
- --convert-to (command line) xlsm
- GUI (save-as) xlsm
- LOKit download as xlsm
- TestFilter::XLSM unit tests

Change-Id: I5c5fac221b6a454a98df9034f59aba0a7d97880d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196788
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2026-01-10 16:33:57 +01:00
Kurt Nordback 2dba43e317 tdf#165742 Step 5.1: Support basic I/O for additional chartex types
Previous work on this project added support for Funnel charts, one of the
chartex types. This commit expands that to all the other chartex types,
including RegionMap. Largely this is parallel to what was done for Funnel,
but there are some namespace differences, and ParetoLine requires some special
handling because Microsoft Office seems to encode it as a combination of
clusteredColumn type and paretoLine type. ParetoLine support is incomplete,
especially on the export side.

Change-Id: Ib751632ec05f3fbf248e0f194f7a6f36f2fa6a88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194933
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2026-01-09 07:21:24 +01:00
Justin Luth df28319667 tdf#165180: improve documentation of lowestEdited
Office 2013 with SP1 is 6, with a rupBuild of 14420
Office 2016 is also 6, with a rupBuild of 14420 also (surprisingly).

Change-Id: Ib9b5906e97d8e39838ecda04bdc23fdf47d197a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195601
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2025-12-13 17:02:44 +01:00
Justin Luth ee0e7b2b78 tdf#165180 xlsx import: detect lowestEdited > 4 as 2010+ filter
WARNING: this patch instantly flips LO
to importing/exporting most xlsx documents with the Excel 2010 filter.
Prior to this, everything used Excel 2007 filter for import or export.

xl/workbook.xml contains a fileVersion element
that has a lowestEdited value (similar to DOCX's compatibilityMode).

Although undocumented, lowestEdited in practice seems to mean:
- 4 is Excel 2007
- 5 is Excel 2010
- 6 is (probably) Excel 2013
- 7 is Excel 2019 (probably also 2016)

My Excel 2024 produced this:
<fileVersion appName="xl" lastEdited="7" lowestEdited="7"
             rupBuild="27928"/>

If there is no lowestEdited, then just use lastEdited.
There apparently is no default value for lowestEdited or lastEdited
(unlike compatibilityMode - which is treated as 12 when not specified).

make CppunitTest_sc_subsequent_export_test2 \
    CPPUNIT_TEST_NAME=testGroupShape

Change-Id: I83b093279949214cbf819d0597cb923347cfb04d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195118
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2025-12-12 00:43:48 +01:00
Mike Kaganski 7f198b27f4 Drop class utl::MediaDescriptor, and use comphelper::SequenceAsHashMap
utl::MediaDescriptor was just a SequenceAsHashMap with a few added
methods. It made it more difficult to assign a SequenceAsHashMap to
MediaDescriptor, without real upsides. In many places, the class was
used not as media descriptor, but just as helper to create sequences.

This change puts the string constants and the former methods into a
namespace utl::MediaDescriptor.

It would be also good to drop comphelper::NamedValueCollection, which
is basically a twin of comphelper::SequenceAsHashMap (TODO).

Change-Id: Ia9b69c5a2ad153ecc654944c419c1880252ed86e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195163
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-12-06 18:18:32 +01:00
Justin Luth ef5846a1ea tdf#169072 ms export: valid date years are 1601 - 9999 #2
The dates in core.xml must fall in the range of 1601 - 9999.

This applies to all MS files, not just DOCX.
Plus, the entire concept of ISOIEC_29500_2008
was wrongly implemented...

make CppunitTest_sc_subsequent_export_test2 \
    CPPUNIT_TEST_NAME=testTdf169072_illegalDates

Change-Id: I06ddc69ff79f1c8d744d97782617f8be257021a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195139
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2025-12-06 12:22:28 +01:00
Justin Luth de25c6c546 tdf#165207 xlsx/pptx: always use errata uri in docProps/core.xml
This fixes a longstanding bug that has gone unnoticed
since nobody saves to the "Office Open XML" filters
and the problem is only seen in MS Office.

So what does this patch fix?
Basically, all of the meta-data was not being read by MS Office,
which primarily means no create/modify dates, subject, title etc.
Every time we saved to OOXML formats (except OOXML 2007),
we caused MS Office to be incapable
of understanding anything in docProps/core.xml.
Telltale sign: when MS Office round-trips
with an added docProps/core0.xml.

The spec says that ISO 29500 formats should be using
    officedocuments/2006/relationships/metadata/core-properties
and thus our untouched 2010-era coding
specified all of that for export (and more recently for import).

> 2.1.33 Part 1 Section 15.2.11.1, Core File Properties Part
> The standard specifies a source relationship
> for the Core File Properties part as follows:
> .../officedocument/.../core-properties.
> HOWEVER: Office uses the following source relationship
> for the Core File Properties part:
> .../package/.../core-properties.

Thus reality is much different than the spec,
so throw the spec out the window and always write
    package/2006/relationships/metadata/core-properties

Bug 165207 doesn't affect LO in any way - it only affect MSOffice.
If there was already a unit test writing out to _rels/.rels
I would have added a test for this, but since there isn't
I won't bother since I don't see any value in doing so.

Change-Id: I582448adb568ecb630f2fd64712ce372875f71df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195014
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2025-12-05 23:30:13 +01:00
Karthik Godha a547efb681 tdf#169781: PPTX legacy VML files are not imported
Change-Id: Id6eeeab193ac0ed6ff60991508466ffd58005ea7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194875
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 76e2b197bd7b01c2af7f7ed780e8624c7c40e1fd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195048
Tested-by: Jenkins
2025-12-05 14:15:18 +01:00
Noel Grandin 5a9e966b32 mso-test: invalid datetime in props
This is using the test document from tdf119234-3.odt.
When importing and exporting to DOCX, we generate an invalid entry in
  docprops/custom.xml
because we dont know how to handle a DateTimeWithTimezone value..

Change-Id: I79981f8a09db432730a9b0c1cf186305b0055923
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193400
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 97cf170c20c7ff1e1b3820a769cd3167a57d0c46)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193600
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-11-08 13:11:38 +01:00
Justin Luth 63bac9055e tdf#169072 ms export: valid date years are 1601 - 9999
The dates in core.xml must fall in the range of 1601 - 9999.

This applies to all docx files,
and ECMA_376_1ST_EDITION (2007) versions of the other formats.

No existing unit tests had ANY dates outside of that range.

make CppunitTest_sw_ooxmlexport21 \
    CPPUNIT_TEST_NAME=testTdf169072_illegalDates

Change-Id: Ic2c81d13a1a8ed9d2ce29f7fea761900aa2f2d20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193552
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2025-11-08 00:27:06 +01:00
Bayram Çiçek 2034abc1bb tdf#167689: sc: export x15 namespace for xl/connections.xml
- add support for x15 namespace.
- add a unittest.
- add support for <x15:connection> and <x15:rangePr> elements.
  - support model and sourceName attributes.

<extLst>
  <ext xmlns:x15="..." >
    <x15:connection id="..." model="...">
      <x15:rangePr sourceName="..."/>
    </x15:connection>
  </ext>
</extLst>

Signed-off-by: Bayram Çiçek <bayram.cicek@collabora.com>
Change-Id: I3b3e380ddd07f251b23333fe9d3959961dd5c19c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190924
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-09-15 09:40:36 +02:00
Kurt Nordback 33bbf0bd20 tdf#167941 - Chart style file is not supported in OOXML
Parse the style*.xml file in the OOXML package, and store the imported
styles in XChartDocument via a new XChartStyle. Some areas are yet to be
fleshed out, but the intent here is to get a review of the general approach
and architecture. This includes no work on the export side (or the UI and
application of styles to a chart, which is a separate but related project).

Change-Id: I9d5b9f5aa44fb7944b2d971edc26e04dc2256c7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189531
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-09-03 16:54:45 +02:00
Mike Kaganski 5a130d91b2 Drop unused FilterBaseImpl::mxInteractionHandler
Change-Id: I01695c01d88dedcf38fe2d0788563fc845c67e94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188816
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-02 12:46:50 +02:00
Noel Grandin c8d2e22e54 construct UNOMemoryStream directly
no need to go via UNO context manager

Change-Id: I4e6695cb361d3420224dda6df21af557da92d222
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186490
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-06-14 14:45:07 +02:00
Aron Budea 37e4623bfa tdf#166511 sw: unify export of DrawingML object IDs
Both docPr and cNvPr have IDs referring to DrawingML objects,
and are supposed to be unique within the document.

These IDs were handled in different parts of the code during export.
7460e4f4a7 added a workaround,
likely to keep them unique, but together with
4b0fa253a4 this caused a clash
sometimes, and the result couldn't be opened in Word afterwards.

Use the same counter for both IDs. It needs to start from 1, as 0
ID makes at least grouped shapes invalid.

Change-Id: I5e7b9855bc88a61841dfcd3d41599a4ce444eb40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185190
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
2025-05-14 16:44:05 +02:00
knordback 95b2c8b82e tdf#165742 Step 4.3: Establish a narrow export path for chartex
This is a subtask of tdf#165742: Chartex charts are lost on input from OOXML
and re-export.

Fix various aspects of input and output for chartex (and specifically
for funnel charts). This now allows for loading and re-exporting a
very basic funnel chart, with the result that MS Office successfully
loads the exported chart, and it looks similar (though not quite
identical) to the original.

Change-Id: I6eeb277e31250031604f7cdd21b80848a9c642ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184758
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-05-09 14:41:45 +02:00
Balazs Varga e275a6e6a0 tdf#166379 - Add export config option to remove "Total editing time"
separately from all private info files during save.

The new expert config option name is: RemoveEditingTimeOnSaving
(There wasn't any UI element added for this expert config option.)

Change-Id: Iab69d062d161ef6aee1c3eb87ada1c16f8b4fd41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184789
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2025-04-30 15:57:51 +02:00
knordback abc8ea2da2 tdf#165742 Step 2: Create a ChartType derived class for chartex funnel chart.
This is a subtask of tdf#165742: Chartex charts are lost on input from OOXML and re-export.

Create ChartType and ChartTypeTemplate derived classes for funnel chart.

Change-Id: I6019412c59e0228bf37a893ced7617a4e3056add
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183461
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-04-17 11:01:09 +02:00
knordback a0dd9ce966 tdf#165742 Step 1: Introduce chartex namespace in parser and export
This is a subtask of tdf#165742: Chartex charts are lost on input from OOXML and re-export.

Add the chartex namespace to the list of supported schemas

Change-Id: Ie98d316c6c8b15053ae58c474d7552352af1b0d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183457
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-04-02 06:25:07 +02:00
Justin Luth e4b629c1ee tdf#165207 tdf#164201 docx: always use errata uri in docProps/core.xml
This patch effectively replaces (and thus contains a revert of)
25.8 commit d97085cc6c.

This fixes a longstanding bug that became more prominent in 7.6
when mstahl renamed docx filters to promote Word 2010,
and then again in 25.2 when my bug 164201 patches
told command-line convert-to to export using Word 2010 filter,
and finally in 25.8 for interactive round-tripping of existing files.

So what does this patch fix?
Basically, all of the meta-data was not being read by MS Word,
which primarily means no create/modify dates, subject, title etc.
Every time we saved to DOCX format (except DOCX 2007), we caused Word
to be incapable of understanding anything in docProps/core.xml.
Telltale sign: when MS Word round-trips with added docProps/core0.xml.

The spec says that DOCX 2010 should be using
    officedocuments/2006/relationships/metadata/core-properties
and thus our untouched 2010-era coding
specified all of that for import and export.

But reality seems to be much different than the spec,
(and some errata-sounding documentation agrees),
so throw the spec out the window and always write
    package/2006/relationships/metadata/core-properties
(but only for DOCX - Excel and Powerpoint follow the spec...)

That meant that I also had to rewrite our import logic,
but that was already suggested by mstahl in
https://gerrit.libreoffice.org/c/core/+/178048

Bug 165207 doesn't affect LO in any way.
If there was already a unit test writing out to _rels/.rels
I would have added a test for this, but since there isn't
I won't bother since I don't see any value in doing so.
Plus, we already have validity checks to cover this kind of stuff.

The retained the unit test ensures import logic is still correct:
make CppunitTest_sw_ooxmlexport20 CPPUNIT_TEST_NAME=testTdf158855

A uiwriter4 test depends on the previous patch in this bug report.
(See earlier versions of my patchset for details)

officeotron sounds like they WANT to report invalidation errors
based only on spec, so no point in trying to "submit a patch".

Change-Id: Ib76803bf0c9f3791f9078846f00c118099ef67cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181463
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2025-02-22 18:42:40 +01:00
Noel Grandin 5155e21bf1 loplugin:unusedfields
Change-Id: Iac4a64af74c92cbd76335faa62e51fa80ef21789
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177718
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-12-04 10:22:09 +01:00
Caolán McNamara b5c5b51e75 use TOOLS_WARN_EXCEPTION to get exception details
Change-Id: I68f45585878b323e44ce9ca2d660c72ebb7be174
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176791
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-20 09:33:28 +01:00
Noel Grandin e27fd62bd8 clang-tidy: performance-unnecessary-copy-initialization in oox
Change-Id: I9964087880efcf24b5748130cffa2bd85adf1965
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176418
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-12 07:26:07 +01:00
Mike Kaganski 3a37d8320c Optimize TokenMap and AttributeList in oox and xo
Shaves lots of string allocations, and uses optimized code paths

Change-Id: I8e33e2aecdc7e0d2f2c31b774daa36304b3973ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173179
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-12 23:09:23 +02:00
Mike Kaganski 976567aee3 Simplify a bit
Change-Id: Id46a5029ce86f20ffae34aa6495d7311044999a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173177
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-12 10:09:36 +02:00
Mike Kaganski 7cfff4751b Related: tdf#129061 Avoid formula import and use fallback for now
Until we support the correct inline formulas, their import fails badly
in Impress, because we completely lose them in boxes with other content,
and even where they are the sole content, they stretch to the size of
the box incorrectly.

Commit 4038d6c393 (tdf#117658 PPTX import:
fix duplicated math object handling, 2019-11-13) opted to enable the
Choice variant from the AlternateContent representing formula boxes.
This change switches to Fallback graphic, losing the option to edit
standalone imported formulas, but instead, allowing to see the formulas
as they were created in PowerPoint.

Unit test in sd/qa/unit/export-tests-ooxml2.cxx, created in commit
331a0a347e (starmath: fix OOXML export
of non-BMP Unicode, 2016-01-21) was changed, because it depended on
importing the formula from PPTX, which is disabled here. Since it
was fixing the export part, the FODP source seems to be a reasonable
replacement.

Change-Id: Ibd0e2bcd68296020c3bc057cb6a563918926cf2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173163
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-11 15:50:01 +02:00
Bayram Çiçek 045ebdb369 tdf#158857: [Power Query] export connections.xml
- import&export connections stream
- insert xl/connections.xml reference to [Content_Types].xml
- add Relationship::CONNECTIONS
- add support for xr16 namespace
- add ../customXml/item1.xml relationship to xl/_rels/workbook.xml.rels
- add import&export support for following xml elements in xl/connections.xml:

<connections>
  <connection>

    <dbPr />

    <olapPr />

    <webPr> (Web Query Properties)
      <tables>
        <m />
	<s />
	<x />
      </tables>
    </webPr>

    <textPr>
      <textFields>
        <textField />
      </textFields>
    </textPr>

    <parameters>
      <parameter />
    </parameters>

    <extLst>
      <ext>
        (Any element in any namespace) <- TODO/LATER
      </ext>
    </extLst>

  </connection>
</connections>

Change-Id: I1d1c10675b3fe5ffd6a35f1b91d4b83401be2cae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164290
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-09 10:17:16 +02:00
Andrea Gelmini 52afd5d267 Fix typo
Change-Id: Ic7b080780a924e0d824b3163487c21b6515844b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169513
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-06-25 13:53:52 +02:00
Noel Grandin 239ceb3155 loplugin:ostr in oox
Change-Id: I08124ce2da1facbe2e84aa4a7a8e25fec24fa962
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167428
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-10 09:51:34 +02:00
Gabor Kelemen 9a4eead995 tdf#146619 Drop unused 'using namespace' in: oox/
Change-Id: I4e8aa7443e71a7cb629f762b08d86dd1fa5b7f0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165690
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-04-09 08:45:48 +02:00
Julien Nabet 2887ffbf24 tdf#160192: fix crash when trying to overwrite file in RO dir+lock file
Bug exposed with:
5259ab8104
sfx2 store: create temp files next to local files

bt:
6  0x00007faac67ad9b5 in sax_fastparser::FastSaxSerializer::FastSaxSerializer(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&) (this=0x559f316f0e70, xOutputStream=empty uno::Reference)
    at sax/source/tools/fastserializer.cxx:68
7  0x00007faac67c46e0 in sax_fastparser::FastSerializerHelper::FastSerializerHelper(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&, bool)
    (this=0x559f31721400, xOutputStream=empty uno::Reference, bWriteHeader=true) at sax/source/tools/fshelper.cxx:30
8  0x00007fa9bfa1b4cc in std::_Construct<sax_fastparser::FastSerializerHelper, com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>, bool const&>(sax_fastparser::FastSerializerHelper*, com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>&&, bool const&) (__p=0x559f31721400, __args=..., __args=@0x7ffecd609207: true)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:119
...
15 0x00007fa9bfa04087 in oox::core::XmlFilterBase::openFragmentStreamWithSerializer(rtl::OUString const&, rtl::OUString const&)
    (this=0x559f318ed5f0, rStreamName="docProps/core.xml", rMediaType="application/vnd.openxmlformats-package.core-properties+xml") at oox/source/core/xmlfilterbase.cxx:511
16 0x00007fa9bfa04999 in oox::core::writeCoreProperties(oox::core::XmlFilterBase&, com::sun::star::uno::Reference<com::sun::star::document::XDocumentProperties> const&)
    (rSelf=..., xProperties=uno::Reference to ((anonymous namespace)::SfxDocumentMetaData *) 0x559f2d673e28) at oox/source/core/xmlfilterbase.cxx:645
17 0x00007fa9bfa047c2 in oox::core::XmlFilterBase::exportDocumentProperties(com::sun::star::uno::Reference<com::sun::star::document::XDocumentProperties> const&, bool)
    (this=0x559f318ed5f0, xProperties=uno::Reference to ((anonymous namespace)::SfxDocumentMetaData *) 0x559f2d673e28, bSecurityOptOpenReadOnly=false) at oox/source/core/xmlfilterbase.cxx:981
18 0x00007fa9bee21bd4 in DocxExport::WriteProperties() (this=0x7ffecd609d78) at sw/source/filter/ww8/docxexport.cxx:952
19 0x00007fa9bee24b0b in DocxExport::DocxExport(DocxExportFilter&, SwDoc&, std::shared_ptr<SwUnoCursor>&, SwPaM&, bool, bool)
    (this=0x7ffecd609d78, rFilter=..., rDocument=..., pCurrentPam=std::shared_ptr<SwUnoCursor> (use count 1, weak count 1) = {...}, rOriginalPam=SwPaM = {...}, bDocm=false, bTemplate=false)
    at sw/source/filter/ww8/docxexport.cxx:2149
20 0x00007fa9bee4438e in DocxExportFilter::exportDocument() (this=0x559f318ed5f0) at sw/source/filter/ww8/docxexportfilter.cxx:112
21 0x00007fa9bf9d6b8b in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x559f318ed5f0, rMediaDescSeq=uno::Sequence of length 12 = {...})
    at oox/source/core/filterbase.cxx:494

full bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=193113

Patch prevents LO from crashing + make LO displays error message:
Error saving the document <filename>:
Write Error.
The file could not be written

Change-Id: I41a94eeb17bb6568b586d89755bce330154d1dad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164808
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-03-14 15:33:15 +01:00
Noel Grandin ae351d9d5f tdf#158773 reduce cost of importing binary data
no need to pass it via the internal buffer of SequenceOutputStream when
we can read it directly

Change-Id: I832737d73309449a1f3a26a4b451977a2a580de3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164634
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-11 06:31:18 +01:00
Mike Kaganski 747463809e tdf#154587: allow directory entries in ZIP packages
The problem in the bugdoc was the directory entries. These entries
are valid in ZIP packages (even if not common); they may be useful
to e.g. define per-directory permissions (ACLs).

In normal mode, ZipFile reads central directory; there we can read
if the entry has FAT file attributes; and then, if the entry is a
directory. Then it is OK to skip it.

In repair mode, central directory is not used, local file headers
don't contain a "directory" flag. A workaround is used, checking
if there are entries that represent directories of other entries.

Also this change fixes some places that didn't pass the recovery
flag correctly.

Change-Id: I324671841a2c4d0f279b03801d95c8f2eeb99b46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162888
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-01 21:07:54 +01:00
Samuel Mehrbrodt 1e49f469af Don't export personal metadata to OOXML in privacy mode
Change-Id: Iac0985783a0c7334bd6ee3cfcaf37c135ac452ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162682
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2024-01-29 13:18:04 +01:00
Mike Kaganski 0fa827dbb2 Drop std::as_const from css::uno::Sequence iterations
Obsoleted by commit 2484de6728 (Remove
non-const Sequence::begin()/end() in internal code, 2021-10-15) and
commit fb3c04bd19 (Drop non-const
Sequence::operator[] in internal code, 2021-11-05).

Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-27 12:43:48 +01:00
Mike Kaganski 975bbafaae Related: tdf#76115 Also pass RepairPackage to FilterDetect
And drop the default argument value from ZipStorage ctor.
Always pass it explicitly.

Change-Id: I8bcf78dc4db7763567f9d6873841d75c328ede7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160760
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-14 14:11:07 +01:00