When an empty PPTX presentation was opened and saved,
its Title and Content layout/master slide lost its
autofit setting.
Original slide master had <a:normAutofit/> element
in its placeholders, which turned into <a:noAutofit/>.
This happened, because on import the inherited property
got overwritten by the default no autofit.
Change-Id: If9842d4c53eb283b9497b46198aaea4911413bc9
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/14276
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit afe4932986453513ea1a50b1143de3827f39c0ed)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211865
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
When image is wrapped through in document body.
Separate part of SwFEShell::ShouldObjectBeSelected()
to SwFEShell::IsTextOverBgObjectAt(), and use it to detect
text overlapping background image.
Handle case when DocumentSettingId::PAINT_HELL_OVER_HEADER_FOOTER
is set. (see eg. SwFlyFrame::InitDrawObj())
Not part of this change: updating mouse pointer over objects/text.
Related to b860aea9d6,
which introduced special handling of
PAINT_HELL_OVER_HEADER_FOOTER for DOCX compatibility.
Change-Id: I571942a43c3c1d5a5be5906fcce08640739e6493
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/11523
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 3bae82eb865b2568506417349d2f3a62bfd775e8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211680
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
...formulas" and "XLSX: Valid data-validations are not being
exported".
This reverts commits 6b40ebc9e67b165e85212d92c861fc6844d24f42
and c6bcd2f7c467b944765b363e9a900eaa6625ff6f.
Reason:
The original change was introduced to skip exporting certain
formula in data validation checks to XLSX that made the files
invalid for Excel.
But because now some good validations get omitted, and it turns
out Excel itself doesn't do better with the orignal files, either,
let's revert the changes.
Added unit test. (to subsequent_export_test4.cxx, the change in
subsequent_export_test2.cxx comes from the revert)
Change-Id: I89d552853f0119aa4bf3edbc3843edcf00f54a70
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7876
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Karthik Godha <karthik.godha@collabora.com>
(cherry picked from commit 28b08b853a09b6f7e68bf05eed2f59ed9fcad071)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208754
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Commit d091c60f9a
introduced handling of tableType attribute.
Commit 8c5fd04f0b
later refined it to default empty to "worksheet",
but this occurrence was left.
Affected: fdo67783-1.ods.
Change-Id: Iddbef5e817b249cbabb3decfb9e43c29c5ef20c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202592
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
Office only writes characterSet attribute for charset
to word/fontTable.xml if file is strict OOXML,
which LO doesn't support anyway.
Commit ae8530c5b7 added
conditional export of characterSet depending on OOXML
version, sometimes exporting both characterSet and val.
OOXML validator complains about this:
{"Description":"The attribute
'http://schemas.openxmlformats.org/wordprocessingml/2006/main:characterSet'
has invalid value 'windows-1252'. The Enumeration constraint
failed.","Path":{"Namespaces":{},"XPath":
"/w:fonts[1]/w:font[1]/w:charset[1]",
"PartUri":"/word/fontTable.xml"},
"Id":"Sch_AttributeValueDataTypeDetailed","ErrorType":"Schema"}
This reverts commit ae8530c5b7.
Change-Id: Ic1fdb46724a2a8713286d02b65d6a052e207e8c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202471
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
Not necessary, Word doesn't export it, and OOXML
validator complains about the test doc if val attribute
is present with true value:
{"Description":"The attribute
'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val'
has invalid value 'true'. The Enumeration constraint failed.",
"Path":{"Namespaces":{},"XPath":
"/w:document[1]/w:body[1]/w:tbl[2]/w:tr[1]/w:trPr[1]/w:cantSplit[1]",
"PartUri":"/word/document.xml"},
"Id":"Sch_AttributeValueDataTypeDetailed","ErrorType":"Schema"}
Change-Id: I964320ea2ef6b48795224ac14545a2eaf4a3b5bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202396
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Otherwise it's treated as number, and eg. year 2011
becomes 2011 days from start of epoch: 1905.
Could be seen in date picker and when exported to DOCX.
Clashing values:
- word/headerX.xml: <w:date w:fullDate="2011-01-01T00:00:00Z">
- customXml/item1.xml: <PublishDate>2011</PublishDate>
On data binding, custom XML element takes priority.
Change-Id: I222f20bdc69fee3571859d408ee74de95d5c092f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201921
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Reference to the embedded XLSX was in substream that didn't
get propagated to the main document, and the embedded file
was missing from the reexported DOCX.
Change-Id: Ibb884d130b4a876a50b0156b3d08307352c0b03a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201284
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
The number of rowBreaks/colBreaks is practically limited
to 1023 in Excel, as described in Part 1 Sections
18.3.1.14 and 18.3.1.74 in [MS-OI29500].
Don't export more than the limit.
Change-Id: I45e49705022b90ab5b3b404bfc5d07da183e0db1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199999
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
Invalid XML gets exported with problematic matrix formula,
eg. fdo73235-1.ods as found by crashtesting.
Further problem this error exposed is that in certain cases
normal formula or error results (eg. #VALUE!) turn into
parameter errors (Err:504) in Calc, which are then discarded
by the previous change.
Let's revert the change until these issues are resolved. Affected files:
https://wiki.documentfoundation.org/index.php?title=Development/Crashtesting&oldid=869226
(under sax_fastparser::FastSaxSerializer::endFastElement)
If the change is later reapplied:
- handle matrix formula case as well,
- keep #VALUE! in the formula, don't remove formula completely.
This reverts commit bebe7a0b27.
Change-Id: I19aca20cc447871d89f462af874e46993ed6f4ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199635
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Excel won't allow them with no parameters.
In Calc:
- SUM() is 0,
- MAX()/MIN() gives Err:511.
Save them to XLSX as SUM(0), MAX(#VALUE!) and MIN(#VALUE!).
Change-Id: I0f0d05290b67684df294611bd0612090abf1a672
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198543
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
Calc/ODS is more forgiving about accepting input, the bugdoc
had this: =COUNTIF(BASE(1;14);"vv")
Here the first parameter of COUNTIF isn't valid, Excel
doesn't even allow entering it, and fails opening the XLSX
with such formula.
No problem in Calc, formula simply gives Err:504 result.
Fix: don't export formula with Err:504 (IllegalParameter
error) result to XLSX.
Change-Id: Ic453440f385b665e56488a61a7c80bf458c4effd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198391
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Based on [MS-OI29500].
This also fixes PPTX export of fdo56877-2.odp, which seems
to have bogus content in Object 1/content.xml:
<style:chart-properties chart:solid-type="cuboid"
chart:label-position="left"/>
It used to export as this invalid
attribute: <c:dLblPos val="l"/>
Change-Id: I710db739b36c469d300273ae016e3d5686b8c578
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197525
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
...and remain invisible after save.
After 0b9e4f6085 shapes did get
hidden, but in case of wrap-around shapes text still flowed
around their supposed placement.
Hidden images were simply shown before and after.
Add a new Visible property to SwXTextGraphicObject, and let
it set SwFlyDrawObj's Visible member as SdrObject.
Import and export wp:docPr's hidden attribute in OOXML based
on these properties.
To avoid showing their area, let
SwAnchoredObject::GetObjRectWithSpaces() return an empty
rectangle (during opening this is only called from
SwTextFly's IsAnyObj(...) and InitAnchoredObjList(), though).
Note that Writer lacks support of changing visibility of
images and shapes. This change adds minimal support for
hiding them and roundtripping the setting in DOCX, but
doesn't add ODF or UI support.
Change-Id: I6e9d062628006a7128e380d1af06508625aa3d06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197056
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
First commit f944648e0f added
a new config to make bullet library items configurable, then
commit 626357f53c switched
from using the set of three default list bullets to bullet
library items.
The configs are DefaultBullets and DefaultBulletsFonts.
The problem is that the bullet library was never meant to
correspond to the default list, and a bulleted list looks
silly now. Let's introduce new configs for the list, with
the old defaults:
DefaultListBullets / DefaultListBulletsFonts
Once reaching the end with increasing levels, the list
wraps around.
Change-Id: I91f6a06e3c298edcfd0d11a3597c23129e0b085d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197014
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Based on what Word can roundtrip, which is 64K twips,
even though that size (115 cm) can't be set via the UI.
Officially 2.1.220 Part 1 Section 17.6.13 of [MS-OI29500]
says 31680 twips, but let's keep to the value that works
in practice.
Don't adjust size on import, only on export, Writer can
handle much larger sizes.
446771fe3e91eb7d154e86b9c6a614374110e9ca was related.
Change-Id: I88540e80f4e94fd8fc3703c18d8b151a7bd270e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194843
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Implement cbf102d4c1 differently.
After previous commit, tdf136301-1.odp still contained
animation elements in slide1.xml when converted to PPTX, and
couldn't be opened in PP.
Set such nodes invalid instead to avoid processing them at all.
Change-Id: I799026c389681b89792bb9765b8f81562743deb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196424
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
In tdf#169825's fix I tried to correct the layout type
corresponding to AUTOLAYOUT_OBJ, originating from PP's obj
ST_SlideLayoutType to AUTOLAYOUT_TITLE_CONTENT, which had
unexpected side-effects:
PPTX->ODP->PPTX conversion of a 'Title, Content' layout added
placeholder artifact.
Revert that part of the change for now.
Regression from eb338daa90.
Change-Id: I5ba7ee14c4ae3a3a336b051edee4ca8702b87397
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196169
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
OOXML schemeClr element has a different type (ST_SchemeColorVal)
compared to themeColor's ST_ThemeColor type, eg. dk1 instead
of dark1, but commit baf179188d
mapped them to the same values on export, causing some affected
files to become invalid.
Change-Id: Iff63aea8943be905c9afbb68012db320cc94eeb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195346
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
...as vertTitleAndTxOverChart, if ODP layout was
AUTOLAYOUT_NOTES, causing corruption.
PPTX export code directly matched LO's AutoLayout IDs to
PPTX layout types (OOXML spec: 19.7.15 ST_SlideLayoutType
(Slide Layout Type)) without conversion, as some don't have
direct match, and need to be matched to blank layouts. This
could result in PPTXes that can't be opened in PowerPoint.
It could also result in PPTXes with wrong layout types when
using LO's own vertical layouts. The files could still be
opened in PP in this case.
In addition, import code imported vertical PPTX layouts
with wrong IDs, matching them to notes and handout autolayouts.
Part of the mentioned behavior happened since
bff76421e2.
Change-Id: Iba7a50795979c22bc566aa2cd6ea4d82f7f9477e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195049
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
3D objects are only supported in ODP, and don't get exported
to PPTX. Animations on them did get exported, resulting in
invalid 'spid' (-1) and invalid OOXML.
Reuse ShapeExport::IsShapeTypeKnown(...) introduced in
ab45b8d995.
Note the extra entries in
PowerPointShapeExport::WriteUnknownShape(...), these are
already covered by the second half of isValidTarget(...).
Change-Id: Ieb1dc1475b036fe4f24d84cee17b9af544c5bb18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194543
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Code-Style: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
Diagrams (SmartArt) had their separate counters for ids, and
when saving animation details, the shape to target wasn't
found, resulting in tags like this, where negative spid
is invalid:
<p:spTgt spid="-1"/>
See "19.5.72 spTgt (Shape Target)" in OOXML spec.
Ids can't be completely unified, as it would affect naming
in ppt/diagrams and on the UI to have large numbers
(eg. in the 40-60 range), while users would expect them
to start from 1.
At least ids to "p:cNvPr" under "p:graphicFrame" should be
unified.
The large number is because shapes are numbered consecutively
over all slides, while for the most part they could restart
on each slide, changing that is not in scope for this fix.
Change-Id: I9790036cc0743313e98f5926d4dc365c8051bd04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193479
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
No need to export if it's no different from the default.
Also reorder defaults alphabetically, in same order as
exported by original document producers (though not all
of them are always added in MSO, which is not addressed
in this change).
Change-Id: I8526da5adc068f02e6da072961c82f4e75e3b984
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193224
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
PDFs exported from Writer show/don't show tracked changes
based on what's set on the UI.
During command line conversion, there was no way to change
this setting.
Introduce a new option 'ExportTrackedChanges' to be only used
during command line conversion as a --convert-to parameter, eg.:
'pdf:writer_pdf_Export:{"ExportTrackedChanges":
{"type":"boolean","value":"false"}}'
Change-Id: I763393ee4305415b714662decf23e0e8f8e75662
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188194
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
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>
Otherwise roundtripped formulas in XLSX containing them
can end up with extra parenthesis, eg:
- Expected: OR(D1=0,D1<>““)
- Actual : OR(D1=0,D1<>““))
Change-Id: I6d296687cc2467ca0cdee329f9b04f6c956d2de0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183987
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Jenkins
Some export was added in fd238380ae.
This can result in only anchor pointers and no other data
saved for certain shapes having no export code, making it an
invalid file.
Change-Id: I81bf513b6ebaa9f6456a26ccbc3276e019551eca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182699
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
f547cf17a1 switched
saving date categories from text to numeric, but
the values were still formatted text.
Excel considered these files corrupted.
Switch to saving actual numeric values.
Change-Id: I1f77a87fd66d6f8fde4987f110e37ed55711bdf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182364
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
MIME types for media can be the default one,
'application/vnd.sun.star.media'.
In ODFs coming from old versions, for media unsupported
at the time, this default MIME type was used, and is read
when opening them in new versions.
MIME type is also guessed more accurately from the URI
(file name and extension), but was overwritten by the saved
MIME type. When using the UI, it is again overwritten by
the guessed MIME type, but not when using '--convert-to'.
This can cause a problem when saving ODPs to PPTX, PP will
consider these files corrupted.
Started happening after bc72514f90.
Change-Id: Icd95b06d54154f3b533840f8a5f381400f2e6108
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181399
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
...alongside each other are identical.
Started when a call inbetween was removed in
e50f6c0239.
and
V1053 Calling the 'EnableRTL' virtual function in the constructor
...may lead to unexpected result at runtime.
and
V1051 Consider checking for misprints. It's possible that the
...'nTopPos' should be checked here.
V1028 Possible overflow. Consider casting operands of the...
'nStartCol + 1' operator to the 'sal_Int64' type, not the result.
Change-Id: Ided25ab6dc9e9d4a1c72a1b809de586c7b890ce0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177218
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>