summaryrefslogtreecommitdiff
path: root/xmloff
AgeCommit message (Collapse)Author
2020-02-20use fast-parser APIs for embedded script parsingNoel Grandin
essentially, this duplicates and converts the service in xmlscript/source/xmlflat_impexp/ and then converts it to use SvXMLImport APIs, stripping about 3 layers of unnecessary indirection in the process. Also improve some exception throwing in sax/ to make the next programmers life easier when finding the source of exceptions. Change-Id: I1ac552ee0565349e8322a55f6f609cf9f4521cab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89084 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-18rename XML_OLD_NAMESPACE_ constantsNoel Grandin
so I can use them with the XML_ELEMENT macro, which expects them to start with "XML_NAMESPACE" Change-Id: If8098448f451675aaff8ca2dcf9544e765cda965 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88928 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-15convert XML_STYLE_FAMILY to scoped enumNoel Grandin
Change-Id: I5335b0190a2f5a8111993c0c9c224c8a6a8f0cfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-14convert XMLEventsImportContext to fastparserNoel Grandin
for now, it supports both fast and non-fast methods, since it is constructed by both contexts Change-Id: I925c50be161b95ecebd951cb7038a938c848a15d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88715 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-14xmloff: create SchXMLImport instances with an uno constructorMiklos Vajna
See tdf#74608 for motivation. Change-Id: I6b4a78317e2b228296c8e4794c776b617920ccfd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88630 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-13chart: don't export LO_EXT hide-legend in ODF 1.2László Németh
Regressions from commit 7869b3d6e4b24a0567ad2e492038d74c03b06b7d (related tdf#51671, store new "hide legend" feature also in ODF) and commit a96ec04a07c35338f5f9a0cb361b9322e5ca9cec (tdf#130225 implement ODF export of deleted legend entries of pie charts) Change-Id: I1d2847ae3e3ab7ccfbdb3841d94a0c1d79ded31f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88593 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2020-02-13tdf#130225 implement ODF export of deleted legend entries of pie chartsTünde Tóth
Follow-up of the following commits related to the new UNO property DeletedLegendEntries for pie charts: commit 86be3422cd55fa9e44104f1628648061bb6a3495 (tdf#129857 Chart OOXML export: fix deleted legend entries) commit 6e847aa817999ab18acd534f9e6a86685bb268fc (tdf#129859 XLSX import: don't show deleted legend entries) Change-Id: Id24cddefa83e50dde1ec6555d02891753483dd5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88018 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-02-12crashtesting: remove assert in SvXMLImportContext::SvXMLImportContextNoel Grandin
which came from commit 813118bfbb453f812be9e1a30f84908b4e0bfb51 Date: Fri Dec 20 14:34:56 2019 +0200 add checks to optional fields in SvXMLImportContext but it turns out various places abuse this field and pass stuff that is not a element name, including empty strings Change-Id: I33cfc7e44e0aafe0fdb084482a199d5cffde6a76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88523 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-09Fix typoAndrea Gelmini
Change-Id: If04bde50d7471d4c5a42e204f34a4d08115dbf95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88331 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-02-09Fix typoAndrea Gelmini
Change-Id: I5c350c44ded0ca1eafc6e7c7d05386d06c71f0ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88332 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-02-03move some xmloff/ headers inside the moduleNoel Grandin
Change-Id: I57e97da952c18c33af85a8fe24ebf021fc0631d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-01-31clang-tidy modernize-concat-nested-namespaceNoel Grandin
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-28New loplugin:unsignedcompareStephan Bergmann
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-24xmloff: create XMLImpressClipboardExport instances with an uno constructorMiklos Vajna
See tdf#74608 for motivation. Change-Id: Idab3996986eb38ff8b1a3765f9bf005229271728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87294 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-23loplugin:unusedmethodsNoel Grandin
Change-Id: Ic2212a502bbd42217934884f4fce49f6f8d4765c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87236 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-23tdf#130133: fix wrong values for attribute chart:regression-type in ODF 1.2Julien Nabet
"polynomial" and "moving-average" Change-Id: I5d07d0315555e8b72ea721a35a2205a8223ed294 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87226 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-22use fastparser for XMLFontStylesContextNoel Grandin
Change-Id: I7b273cdc0f90f2a8c9527d1f19fed97672a74741 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87175 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-22Convert reportdesign to fastparserNoel Grandin
Change-Id: I0703344aad4ca6c72e494160b019c13e24cc843a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87160 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21use more FastParser in SvXMLStylesContextNoel Grandin
Change-Id: I05c7314739246a864b16723c13bd8fbb4ef725e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87146 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21use more FastParser in ScXMLChangeInfoContextNoel Grandin
had to hack the token constant generating process a little because we have two tokens that only differ in "-" vs "_" Change-Id: I0744d697918d28cca0c92b83ecfd37c1ae9d2bae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87138 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21Use FastParser in XMLDocumentSettingsContextNoel Grandin
and flatten the pImpl data Change-Id: I8d817cd2af0a3855d10dbfaa580c3379119d5067 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87126 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21Use FastParser in SdXMLBodyContextNoel Grandin
Change-Id: I1070ca2351f7bfb2e0c10ba6e876ebcf2cae0ce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87118 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21use FastParser in SdXMLMasterStylesContextNoel Grandin
Change-Id: I9fb57f4bf97e3aa67bcdd55f5e98ebcddaaf9e4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87082 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21use FastParser in XMLScriptContextNoel Grandin
Change-Id: I7c5f5b77a78307c556ee5718480346ed3dd159fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-20return nullptr from CreateChildContext methods in subclassesNoel Grandin
the calling class handles this nicely, and also tells us when we are not handling some part of the XML file Change-Id: Ib64a704bc96bb4d6eff2d57116d62c9c15e25c6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87073 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-19inline some Create methodsNoel Grandin
to make it easier to follow the flow of logic through the context classes Change-Id: I914c04dd0aa8148f9ff1be4ea86e83ff67d8bb76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87039 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-19tdf#129883 Section links are lost on save and reloadNoel Grandin
Revert "convert XMLSectionSourceImportContext to FastParser APIs" This reverts commit ccdcc25a085299bda45bc5ea4b3594e856f2d315. THis was one of my earliest fastparser attempts before I properly understood the weirde workings of the SvImportXML stuff. Change-Id: I729467cb513740d36c0483eb6f8c84ffa4cab578 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87038 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-17tdf#98584 Correct import draw:transform values skewY and matrixRegina Henschel
Covers tdf#98583 and tdf#98565 too. TRBaseGeomety (API) uses for skewX the same angle orientation as written to file. But that results in mathematically wrong matrices. Change sign where needed. Vertical shearing is converted and written to file by LO as sequence rotation * shear horizontal * scale. Same should happen on reading. Because LO does not write skewY itself, I have used the angle orientation, that was used in OOo1.1.5 and that is used in Scribus 1.5.4. Import generates a transformation matrix from the draw:transform attribute. That is a mathematically correct matrix. It is applied to the shape via TRSetBaseGeometry. But that uses a wrong sign in the shear angle. Therefore conversion of mathematical matrix to TRBaseGeometry matrix is needed. The draw:transform attribute can generate a scaling, which needs to be applied on top of the scaling made from svg:width and svg:height. Such happens on import of skewY() and might happen with matrix(). SdrPathObject puts scaling form svg:width and svg:height directly into the coordinates of its points. It had ignored any additional scaling. I have add a part to detect and apply it. Change-Id: I7636b9feec432cf403e7c6ef8dbd6a769793d144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86244 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2020-01-17xmloff: create DrawingLayerExport instances with an uno constructorMiklos Vajna
See tdf#74608 for motivation. Change-Id: I1bb8e649cab67a2df4e40277758a47259f65a6c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86946 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-16return nullptr from Create*Context methods in nullptr subclassesNoel Grandin
the calling class handles this nicely, and also tells us when we are not handling some part of the XML file Change-Id: Ic51a42b9d2dec96243e7f83b528d7455d4bc0504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86906 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-16fix XMLVersionListImport fast-parserNoel Grandin
AddAtIndex does not seem to play nice with the fast-parser stuff Change-Id: Iea64566b595e952b8bdf767f51c0c1813f0abb6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86902 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15use FastParser for SchXMLImportNoel Grandin
Change-Id: Ib43f109dce8226d29b19c141010e4480147933ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86825 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-14use FastParser APIs in SvxXMLXTableImportNoel Grandin
Change-Id: I744943bdcdecc10219898d23038eb5d0c2dfb5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85479 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-13convert this warning to SAL_INFO for nowNoel Grandin
too noisy until I've done more conversion Change-Id: I1afe653683f12edc4516a40f609e6c1dc749c9e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-13convert dbaccess to FastParser APIsNoel Grandin
Noting that I use "& TOKEN_MASK" a lot because we can be dealing with either NAMESPACE_DB or NAMESPACE_DB_OASIS. Change-Id: I5ca0aac61e37dc903bb998a43b73b48df22e55fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86655 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-10use more std::make_sharedNoel Grandin
found using 'git grep', I tried using clang-tidy, but it only successfully found a tiny fraction of these Change-Id: I61c7d85105ff7a911722750e759d6641d578da33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-10xmloff: create AnimationsImport instances with an uno constructorMiklos Vajna
See tdf#74608 for motivation. Change-Id: I36a70b0657c4648a9f5cf69d67d4da4508099587 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86503 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-09convert XMLAutoTextEventImport to FastParser APIsNoel Grandin
Change-Id: If0249a9987a42c700f994073bc649774ae84f510 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86477 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-08ofz#19933 Null-dereference READCaolán McNamara
since... commit e1383444c6d00f5d0b1d507670517f45988b9cc7 Date: Tue Jan 7 13:01:41 2020 +0200 extract some common code from ImportContext classes which reduces code bloat, and lets us log when elements are ignored Change-Id: I873d14c07b8f2c62f7b1f4c7dc05c566fb35f458 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86437 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-08make ODBFilter return a fast contextNoel Grandin
And (*) use the fast parser already inside ODBFilter (*) pass around ODBFilter explicitly to make the code easier to read Change-Id: Ib0dd24e530b32b5edb94f150390df1e405c3efb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86248 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-07extract some common code from ImportContext classesNoel Grandin
which reduces code bloat, and lets us log when elements are ignored Change-Id: I5ca12bc1fcbfa3bea49ebde819fd80bd233a96a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86338 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-02tdf#123206 Add test: import custom-label-fieldTamas Bunth
Add test for deprecated custom-label-field attribute of the data-point element. Change-Id: I9a7619898fa72900323e5b41728d2146c14203e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86103 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-01-01tdf#123206 Store custom label as chart:data-labelTamas Bunth
Use the chart:data-label element instead of using the loext:custom-label-field attribute. chart:data-label stores can be a child of chart:data-point and it may contain a text:o element for holding one or more paragraphs of custom label text. This commit aims to export and import chart:data-label with paragraphs put into different text:span elements. These span elements may hold a text:style-name attribute in order to achieve formatted text. This structure is already in the ODF format. Change-Id: I0bea7ce1a16af9c47b33555e18545bdaae7e95ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85659 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-12-26use more TOOLS_WARN_EXCEPTIONNoel Grandin
so we get more useful log messages when stuff goes wrong Change-Id: Ia55db7ab1a4d79b0f281673fbbb06c61745fa89e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85829 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-25sal_Char->char in xmloff..xmlsecurityNoel Grandin
Change-Id: I292d699ce1de10ca9341525161f5da2592102ff7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85778 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-23tdf#129520 xmloff: fix ODF import of multi-paragraph fieldmarkMichael Stahl
The problem is that inserting PARAGRAPH_BREAK also calls AppendTextNode() internally, not SplitNode(). (regression from 6eb1c2304d257d16858b7b51cad63f1dc2bde88b) Change-Id: I2d33819a973c956ea04925458c904ce36ccb55a3 Reviewed-on: https://gerrit.libreoffice.org/85627 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-12-22loplugin:finalclasses in xmloffNoel Grandin
Change-Id: I389824999e8e24c27e5d6f36180ae0fd8032c482 Reviewed-on: https://gerrit.libreoffice.org/85699 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-21convert XMLSectionSourceDDEImportContext to FastParser APINoel Grandin
Change-Id: I4a2ca35d75a352d5f2b763114de9e9151125f001 Reviewed-on: https://gerrit.libreoffice.org/85648 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-21convert XMLSectionSourceImportContext to FastParser APIsNoel Grandin
Change-Id: I488d0e521a445055a33a7972d78005047b2c5b2f Reviewed-on: https://gerrit.libreoffice.org/85647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>