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
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>
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>
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>
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
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>
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
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
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>
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>
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
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>
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
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>
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
- 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>
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>
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>
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
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>
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
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
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>
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>
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>