summaryrefslogtreecommitdiff
path: root/xmloff
AgeCommit message (Collapse)Author
2016-03-02xmloff: tdf#97808: allow empty draw:marker-start/marker-end/stroke-dashMichael Stahl
Apparently these are allowed to be empty, which means "nothing". (regression from db1d278dcc308c73eb5edebc20481c96e7f479d8) (cherry picked from commit af57a81d0c28944b424649f024c28f444a1ab2d9) Change-Id: I13f7998e0986b26c34929afd40b1b4f0fc9efdff Reviewed-on: https://gerrit.libreoffice.org/22724 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 13ed8b7035a3a3128e246ad2f5b3be059c411c57)
2016-02-04xmloff: tdf#96147: ODF export: fix duplicate fo:background-colorMichael Stahl
... attributes that happen if both CharHighlight and CharBackColor properties are used, because the CharBackTransparent property wasn't taken into account, and combining the CharBackColor and CharBackTransparent properties happens *after* XMLTextExportPropertySetMapper::ContextFilter() runs. Also, it looks like a transparent highlight wouldn't export properly but apparently DomainMapper::getColorFromId() won't create such. (regression from f880962f5bf26bfaef06bd3f9e67e2d901a2e74c) (cherry picked from commit 8dadefc35f8b33648fb6adbdaca75ea52b2705db) Change-Id: Ib628ef8bb377482f74fadb97c81afb95fbbf7184 Reviewed-on: https://gerrit.libreoffice.org/22046 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit e92dcab1407fa26fc5ee68d0b626b87bc04f1b3b)
2016-02-02xmloff: there is no reason why office:version should be omittedMichael Stahl
... if a document contains foreign elements or attributes. In fact since ODF 1.2 the office:version attribute is mandatory and any document that omits it is therefore invalid, while "extended conforming" documents are allowed to contain foreign elements and attributes. This mysterious check was there since CVS initial import, but without any justification. (cherry picked from commit d277ac87455a599fbf4acd3c6401f09bc74d3dac) Change-Id: Ifeafad2b7af41f06356461adb7ae65dbf7bae11d Reviewed-on: https://gerrit.libreoffice.org/21475 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 32a25a623347c038ec75c3c594d615419c4da7fc)
2016-02-02tdf#96480: ODF import: eliminate duplicate cross reference heading bookmarksMichael Stahl
7c3c3006deaaaf1bb3f2f4eeeaf11da3bcebe53c is apparently worse than it appeared at first glance since there are numerous assumptions about bookmarks, such as that if they were inserted successfully they may be copied successfully, which isn't the case for duplicate cross reference bookmarks. So fix this differently, by eliminating the duplicates and mapping all reference fields to refer to the surviving bookmark. It was not possible to do this in SwXBookmark by checking the makeMark() return as that would raise interesting problems such as it's currently guaranteed to have 1:1 SwXBoomarks to core Marks so we can't just connect 2 SwXBookmarks to the same core Mark, and we also can't leave the SwXBookmark unconnected after attach. Another alternative would be to temporarily allow inserting the duplicate bookmarks and then eliminate them after the import, but what is implemented now is to check from xmloff for duplicates, which is reasonably simple. (cherry picked from commit 774fb6d2e7cf36b677e66c54278225b1256bd40f) Change-Id: I7ee4854d1c9d8bf74201089cbb7287b1bd8ee3b9 Reviewed-on: https://gerrit.libreoffice.org/21369 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 55d2301ac658167396bf5533c940bceffff67f04)
2015-11-28Incredible slowness and crashes with document with vast num of frame dupsCaolán McNamara
it looks like draw:name values are supposed to be unique in ODF, even if it's not spelled out explicitly, since it exists so the frame can be referenced, which sort of implies that it has to be unique, so a document where the values aren't unique can be considered invalid 19.197.10 <draw:frame> The draw:name attribute specifies a name by which a <draw:frame> element can be referenced. So reject duplicate frames but limit this to document generated with 4.4.X which we believe is the version that created these bogus docs (cherry picked from commit de0432a9256188c7b5cd1a83858311e68c890ebf) Change-Id: I83f6d72fd969f667f0a8c2c85d2ffeeed672387a Reviewed-on: https://gerrit.libreoffice.org/20054 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit df58e60200273d90aab2fcb85df441e487f90fd6)
2015-11-28xmloff: add meta:generator constants LO_43x and LO_44xMichael Stahl
Change-Id: I1d962ad637f19b02855616edebcedbad719689c5 (cherry picked from commit ee655627ad2ba66a8160b4cbdaeb1dd52d047a1d) Reviewed-on: https://gerrit.libreoffice.org/20053 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 22f51321902af18ed8cc6b128cc8fa1e7470f797)
2015-11-13tdf#95744: saving shape names re-enabledOliver Specht
commit c29657e0d6bb707345584ac7a7f5ae5016f37297 inverted one of the tests for SvXMLExportFlags::OASIS Change-Id: I523cecd4203c91d82a4e3e82b8457d2c55a5fff0 Reviewed-on: https://gerrit.libreoffice.org/19931 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de> (cherry picked from commit 249f8b1cc9897ac9666dd5c69dc22fae7586c207)
2015-11-05tdf#93296 dashes in decimal part => 0 min decimal placesLaurent Balland-Poirier
During import, as well during export, "0.--" must be considered as 0 min decimal places Change-Id: I33d06dd95c0678660bc0bb222972f82ef54f2c6e Reviewed-on: https://gerrit.libreoffice.org/19647 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 3f970cf247ad96d1663462acb0be7f1c767d1ebf) Reviewed-on: https://gerrit.libreoffice.org/19781 (cherry picked from commit 18be99af0b2a9ad6d7303ba6e594774b4292c316)
2015-11-04ccu#1255 tdf#95569 xmloff: convert legacy assertions in ...Michael Stahl
... PageMasterExportPropMapper Make the properties optional, like XMLTextExportPropertySetMapper already does. (cherry picked from commit 18a712d2b3fe03629e00868ce17226994b7b7252) Change-Id: Iee5d8ac113360937d8f3a3b867a6e6c7a18bbfa4 Signed-off-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-11-03Fix tdf#93438 Impress generate abnormal style when copy-pastingMark Hung
from Writer with Chinese UI. When user configure UI language as Chinese, style names are also translated. However when Copy-pasting from Writer to Impress ( select RTF fromat with paste-special), Chinese (unicode) style names are borken into multiparts, where some of them are empty string. Neither deleting the abnormal style nor saving the file can be achieved. The only remedy is to remove style with emtpy name with macro. With this patch: 1) Catch NoSuchElementException and ignores it, so user still has chance saving file. 2) Make sure style has valid number before inserting it. 3) Prevent text breaking into multiple tokens by handling ucN in ScanText(). Change-Id: I417f70b81c23ac63c175cc13c548068873d13a38 Reviewed-on: https://gerrit.libreoffice.org/18148 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/19685 (cherry picked from commit 52f3eb47aa42bd1a2a61088706cd3c729e274fc0)
2015-10-17xmloff: fix ODF import of gradient draw:angle attribute a bitMichael Stahl
ODF 1.2 part 3, 18.3.1 angle, says "An angle, as defined in §4.1 of [SVG]" and "If no unit identifier is specified, the value is assumed to be in degrees." Unfortunately OOo could only read and write 10th of degree here. See also https://issues.oasis-open.org/browse/OFFICE-3774 As the first step towards fixing that, implement the import for draw:angle values with an angle unit identifier, but leave the import as-is if the angle identifier is missing. Change-Id: Ib88d417c03998ebcfc569b01492f0e1f851bbc85 (cherry picked from commit aadda5d17f6e422da143ea774f759bfc5f629c5b) Reviewed-on: https://gerrit.libreoffice.org/19283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 76a4665a09542fb67dd99c9a607c162e0b678ead)
2015-09-18tdf#92586 xmloff: fix import of stretched background imageMiklos Vajna
The bug document has: <style:page-layout-properties ... style:repeat="no-repeat"> <style:background-image ... style:repeat="stretch"/> </style:page-layout-properties> When a stretched background image is set on a page style using the Writer UI, then these two style:repeat attributes always match, but not in the bugdoc. The later used to have priority, till commit 7d9bb549d498d6beed2c4050c402d09643febdfa (Related: #i124638# Second step of DrawingLayer FillAttributes..., 2014-06-02). Fix the problem by extending XMLBackgroundImageContext::EndElement(): if we know that the <style:page-layout-properties> sets the FillBitmapMode property, then don't blindly set BackGraphicLocation, but try to overwrite the exiting FillBitmapMode one. Change-Id: I64ab4363b20cc95003d35acd63ea421472b1c071 (cherry picked from commit 6621da38b3cd217314c2d2295fd1e71be7e1875e) Reviewed-on: https://gerrit.libreoffice.org/18582 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-31ODF import: workaround dubious draw:fill="solid" on frame stylesMichael Stahl
Since the gradient frame backgrounds were added in LO 4.1, we export this: fo:background-color="transparent" draw:fill="solid" Which doesn't make a whole lot of sense as this is really a "none" fill, and now with the backward compatibility stuff in the style import code we get the pool default color added when setting the BackTransparent property, and with the draw:fill="solid" it becomes visible and the background color is now Sky Blue 1. So try to detect draw:fill="solid" without draw:fill-color attribute and contradicting transparent legacy attribute and nerf it. This way we also export draw:fill="none" again, although still with a bogus draw:fill-color but that shouldn't cause any harm. Change-Id: I1c2bea46ba7d9a3f042b875df0ca12c7f6037909 (cherry picked from commit 68efa6f5128abf4cd097ae81a4cfd7fecbcb2a80) Reviewed-on: https://gerrit.libreoffice.org/18040 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-31xmloff: ODF export: actually ODF 1.2 does not allow graphic-propertiesMichael Stahl
... in a style with family "paragraph", as detected by a --with-export-validation build due to the unit test added yesterday. So use the loext namespace for the style:graphic-properties element, and also omit it entirely (and rely on the style:paragraph-properties attributes fo:background-*) if the ODF version is set to 1.2 or 1.1. Also adapt a previous check that was missing the "drawing-page" style family, where the style:graphic-properties is allowed (commit 9746dc9ad62e7f3a39961733f2ac204e90289034) (regression from 7d9bb549d498d6beed2c4050c402d09643febdfa) Change-Id: Iedd66483f63020328bd61e1c1e19c62787b8ff6b (cherry picked from commit b1922eecb55b233de3e6abaaa644fe9f313cf0f1) Reviewed-on: https://gerrit.libreoffice.org/18064 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2015-08-06Resolves: tdf#91950 optional entries may not be presentCaolán McNamara
here we appear to check if the preceding optional entries are of certain types. Presumably if they are optional then its legal for them not to exist at all, just that if they are there they should be in the right order. Change-Id: Id147b91d7d375d7985d901cda112c7757dc3fb19 Reviewed-on: https://gerrit.libreoffice.org/17353 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-08-06xmloff: ODF import: fix spelling of "extrusion-first-light-level"Andrea Gelmini
The attribute is not imported currently due to the typo, but is exported with the correct spelling from shapeexport.cxx:4377 with XML_EXTRUSION_FIRST_LIGHT_LEVEL. Change-Id: I83d77e7eabbbc961fa4f7faf8e20b47601ba071b Reviewed-on: https://gerrit.libreoffice.org/16641 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 9fb8b3968670645b257982773ece9d9413f404c6) Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-08-06tdf#90133 Comply attributes name with OASIS#3860Laurent Balland-Poirier
See https://issues.oasis-open.org/browse/OFFICE-3860 Change-Id: I707b2e86633bc66df03dba8c43879aa6d5153062 Reviewed-on: https://gerrit.libreoffice.org/16905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 9c2a8065add0da1e649633efa0795beddfa68eed) Reviewed-on: https://gerrit.libreoffice.org/17005
2015-08-06the last condition is "all other numbers", not the third, tdf#92457 relatedEike Rathke
(cherry picked from commit b3c11e2b3ef4bad8c2b5f92ba00ac805fb68786f) So we'll properly strip the "value()&lt;=1.79769313486232E+308" condition that 5.1 will write. This will not enable the handling of the style, but at least it is fed correctly as intended to the number formatter. Change-Id: Ic9571d938c4a8837c5712bafbfb2ebf9f32011df Reviewed-on: https://gerrit.libreoffice.org/16988 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-06xmloff: don't add FIELD namespace twiceMichael Stahl
The first place already checks SvXMLExportFlags::CONTENT, so the second Add is unnecessary (and for versions <= 1.2 it shouldn't be exported). Change-Id: If2e471b50fcf21ad8977de48c433b628c5c03305 (cherry picked from commit 15cd958a8a5c0b8dbe8891e2ce47aea6c91ba914)
2015-08-06add field namespace to styles.xml when saving fdo85232-1.docx to .odtCaolán McNamara
when >= SvtSaveOptions::ODFVER_012 Change-Id: I0414bc4a83ae4787e10cd8a215555f249da7e65a (cherry picked from commit 9bc314e38b6bcc268fe519b6d771a60087a1af9e)
2015-05-22tdf#91140: tweak fix a bit, turns out xmloff was also passing empty URLMichael Stahl
Change-Id: Ia6e1fbe18e72c9c06915e1b437076a1f56a6c206 (cherry picked from commit 12f907da9535ae9fb28fb7ef1b05240eabf51e82)
2015-05-18Related tdf#88056: use better-fitting <text:page-name>Katarina Behrens
Implemented Regina's suggestions: * this is a text field, therefore it belongs to text namespace * page-name (evtl. slide-name) describes much better what this field really contains This (among other changes) reverts commit 6609de8856519e0e9 Change-Id: Idab3b7c291839a9137f80d325a7d3f5ef0ff2636
2015-05-18xmloff: fix non-debug buildsMichael Stahl
Change-Id: I5f6ceaa8726657cc6be43fbdb024e8d308c47171
2015-05-18xmloff: convert legacy assertions in SvXMLAutoStylePoolPMichael Stahl
Change-Id: Ibf3afcfb3f4dc400faa18a726ec47d58a230de65
2015-05-18xmloff: convert legacy assertions in XMLStyleExportMichael Stahl
Change-Id: I39146bc6005c43b034243d587dda17839b8e72e7
2015-05-18xmloff: convert legacy assertions in SvXMLAutoStylePoolP_Impl::exportXMLMichael Stahl
Change-Id: I9f21ad73a8a30e0b9d0d515713cc95b303f973f7
2015-05-18xmloff: assert when a non-existent auto style pool is requestedMichael Stahl
Change-Id: Ibff35f5c88d50f9e28c5e0c4e3dfb59f62d679a8
2015-05-18xmloff: convert legacy asserts in SvXMLStylesContext_ImplMichael Stahl
Change-Id: Ib9caf65f8cf1dc4ef9729f178fbe4ed032437be2
2015-05-18xmloff: convert legacy asserts in MultiPropertySetHelperMichael Stahl
Change-Id: Ie4fb04d1c8d29eb5c7d9da4076c793a69954ab29
2015-05-18xmloff: convert legacy assertions in xmltoken.cxxMichael Stahl
Change-Id: I852e6a6d805cc03920a467bf7f9739181b6c77d4
2015-05-18Remove include stdio (part2)Julien Nabet
Change-Id: Iae58d107d8df1c543a165086fb2b7c288e7121dd Reviewed-on: https://gerrit.libreoffice.org/15775 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2015-05-11loplugin:cstylecast: nop between pointer types of exactly same spellingStephan Bergmann
Change-Id: I72713a31aebe594b1a89c2d4a1c9f8aa37590e61
2015-05-08std::ptr_fun became deprecated since C++11Takeshi Abe
Change-Id: If93609d032c9864e0251230bf9ed76e6b6741a62 Reviewed-on: https://gerrit.libreoffice.org/15672 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-08XMLTransformerActionInit parameters are generically of type sal_uInt32Stephan Bergmann
Change-Id: Ic36339fbb78a6ac3233f3d75a1309cf1b0642fe0
2015-05-06xmloff: convert to assert in SvXMLMetaExportMichael Stahl
Change-Id: Ib959da6f4dab0b290955e8b786d6efeef7f307b0
2015-05-06xmloff: assert validity of XMLPropertySetMapper indexesMichael Stahl
Apparently -1 is used for invalidated ones. Change-Id: I31901ff9f1caf3d011e476e220cec71669f5a356
2015-05-06xmloff: assert existence of XMLPropertyHandlerMichael Stahl
Change-Id: I2554c77245eb2c22201b6e680ab42db666b2ee8b
2015-05-06convert FONTTOSUBSFONT constants to scoped enumNoel Grandin
Change-Id: I994bfc76d709d01406404991dbfbd49b15bd03f4
2015-05-02it works if we first set the size and then the position, tdf#86624Markus Mohrhard
Change-Id: I8ed98981ef3041839ab73b749a04febe369f66fe
2015-04-30xmloff: simplify code by using std::all_of/std::any_of/std::none_ofTakeshi Abe
Change-Id: I87311d8989c23538983d45ad9b12a64080441d78 Reviewed-on: https://gerrit.libreoffice.org/15569 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-04-30Bin some pointless comments and reduce some vertical whitespaceTor Lillqvist
Bin pointless '// predeclarations' or '// forward declarations' comments. If a programmer doesn't know what a forward declaration is, well, why read C++ source code? Also bin some pointless '// end of namespace foo' comments after namespace blocks just a handful of lines long, and some superfluous vertical whitespace. Change-Id: I2a31c5d73d9b4de8825fb8eb9e7559dbd7303ef9
2015-04-28XMLTransformerActionInit parameters are generically of type sal_uInt32Stephan Bergmann
Change-Id: I8a013c8ca8938ef2d8e1786cda3dba61fe3038a5
2015-04-28txtparae_bContainsIllegalCharacters var wants to be of type boolStephan Bergmann
Change-Id: Ie8b481ab1759725ba40e3cf1bb6611d3c058b53b
2015-04-28SvXMLEnumMapEntry holds all values as sal_uInt16Stephan Bergmann
Change-Id: I3af5f97e77240a0f0a3c96cffc03c8a005e8f0aa
2015-04-28tdf#90133 Extend ODF: variable decimal in scientific formatLaurent Balland-Poirier
Variable decimal is only saved in ODF for number, and do not consider partial variable decimal: 0.0## is saved as 0.000 This patch extend ODF with loext:min-decimal-digit for number format and scientific format Change-Id: I5022458da47bbd33c3e195c280e75c43faca5f8d Reviewed-on: https://gerrit.libreoffice.org/15135 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-04-27tdf#90133 Extend ODF: exponent sign of scientific formatLaurent Balland-Poirier
Scientific Format without sign in exponent, such as 0.00E0, are managed by LibO, and can be saved in XLS format This commit allows to save in ODF Change-Id: Ia0c4589e2af942543ea296f970d163bc1d1d6f05 Reviewed-on: https://gerrit.libreoffice.org/14955 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-04-24loplugin:simplifyboolStephan Bergmann
Change-Id: I4a7ba9192956941f05e68ae8df3263d609a7c4dc
2015-04-23Improved loplugin:literaltoboolconversion looking into cond. exprs.Stephan Bergmann
...automatic rewriter fixes Change-Id: I6b04ca80f08f8a71ff94e309fd52f44d736751ee
2015-04-23Revert "-Werror,-Wunused-const-variable"Thorsten Behrens
Actually used with follow-up commit b94de8fa13faa2849ead136d22cfb46f7d3bfddc This reverts commit e24a02dc29d6e750ee4270dac429c8416c5b738c. Change-Id: I0f8226f756c7b3a813600351cc1be9bbbbcf67c2
2015-04-22Related tdf#88056: Use correct service nameKatarina Behrens
Now the page title field can finally be imported and displayed in Impress \o/ It was a simple copy'n'pasta error, but damn, was it hard to find ... Change-Id: I04a3c71568960a66721269da3208208e168a99ac