summaryrefslogtreecommitdiff
path: root/xmloff
AgeCommit message (Collapse)Author
2018-02-26use less RGB_COLORDATANoel Grandin
part of removing ColorData Change-Id: If31b5b88545529863377e9a178f45f4516bf6cbb Reviewed-on: https://gerrit.libreoffice.org/50345 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-26Fix typosAndrea Gelmini
Change-Id: Ifcfb8ed6783f7d022e7c7f139e3f3bafa7b4b71a Reviewed-on: https://gerrit.libreoffice.org/50088 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-26xmloff: remove unused code when loading/saving the bitmap tableTomaž Vajngerl
Change-Id: I6bffe243e813079538a4cb57111266b41d7c03f1 Reviewed-on: https://gerrit.libreoffice.org/50333 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-25remove const property name member for "GraphicURL"Tomaž Vajngerl
All of them should be removed however.. Change-Id: I83c9ec3c8d5f547b39528121a8d4be12aa1b911c Reviewed-on: https://gerrit.libreoffice.org/50296 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-25fix import of graphic bulletsTomaž Vajngerl
When changing to use "GraphicBitmap" property instead of "ImageURL", the import wasn't adapted and there was no test which would warn of such an situation. This also changes the difference between writer and impress where impress used "Graphic" and not "GraphicBitmap" property. Also adds missing tests for both writer and impress Change-Id: Ieed629d2d37f7806d63e729b6ef23cd848593071 Reviewed-on: https://gerrit.libreoffice.org/50140 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-23forcepoint #5 null derefCaolán McNamara
Change-Id: I95b67f98b7028d7ca7c4a9d1c15100e42d359816 Reviewed-on: https://gerrit.libreoffice.org/50241 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-22Replace "ReplacementGraphicURL" with "ReplacementGraphic" propertyTomaž Vajngerl
To transport the replacement graphic we use "ReplacementGraphicURL" property, but as it uses an GraphicObject URL it needs to be replaced. The new "ReplacementGraphic" does this with an XGraphic object as instead of the String URL. Change-Id: Iddf01c9aecb2a31a467e7b9d399495e0428d1859 Reviewed-on: https://gerrit.libreoffice.org/49993 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-21report the saved mimetype when saving graphic + mime from streamTomaž Vajngerl
When saving we need to determine which mime type to use for the graphic. Return this information back to the caller so the metadata can be written into the file if necessary. Also add function to determine the mime type from the XGraphic by converting it to a stream first (only then we can determine the format that will actually be used and written to the storage file. Change-Id: I796da715e47f29d77dea605a2769a2217ecd6ba5 Reviewed-on: https://gerrit.libreoffice.org/49992 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-21tdf#115782: Need to use mirrored rotation in ODFArmin Le Grand
To be compatible with the orientation of rotations in ODF format in current state (which is wrong oriented) we have to do the same as in all other places (unfortunately). Change-Id: I2f02019b91a0f6020612c9c09be2d247e1b1deb1 Reviewed-on: https://gerrit.libreoffice.org/50047 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-02-20create uno::Any overrides for ColorNoel Grandin
And use less ColorData in writerfilter and xmloff. part of removing ColorData. Change-Id: Ia1c57bf837ae814e7642cf1c7de2eb7ada7a1500 Reviewed-on: https://gerrit.libreoffice.org/50028 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-20drop Color::SetColor(ColorData) in favour of operator=Noel Grandin
first stage of getting rid of ColorData Change-Id: I5e4e95eb958722814c43c8d1ebfef17ad18c29ec Reviewed-on: https://gerrit.libreoffice.org/49997 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-18Fix bug numbers in these commentsAdolfo Jayme Barrientos
Follow-up to 0e687595295e210e6275eda57a253ca66e8249ce. Props to Regina and Heiko. Change-Id: I4a5b71230639edf8c22d9e21c29fa31b4a561e75
2018-02-18remove printf left in the code by accidentTomaž Vajngerl
Change-Id: Icc5742cc3b4e44ce6f7daa460af16a3c4aba82c8 Reviewed-on: https://gerrit.libreoffice.org/49894 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-18GetEmbeddedXGraphicStream to read XGraphic as streamTomaž Vajngerl
This is an alternative to GetEmbeddedGraphicObjectStream which uses URL as parameter and will be removed soon. Change-Id: I3c7431bdeed0bd4ed3c7f48517a52846d0944ed2 Reviewed-on: https://gerrit.libreoffice.org/49893 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-16tdf#115519: Handle rotation for WriterFlyFrames correctlyArmin Le Grand
Change-Id: I5f29b3640eaf24d63c64edfecd6732f336582640 Reviewed-on: https://gerrit.libreoffice.org/49826 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-02-15xmloff: avoid unhandled exception warningMiklos Vajna
Happened e.g. when copy&pasting editeng content in Impress tables, document::XStorageBasedDocument is not implemented by SvxSimpleUnoModel, so it's not exceptional that the queryInterface() for mxModel fails. Change-Id: Iaed53941bb47ff8a0553896f18a553cf64e2224a Reviewed-on: https://gerrit.libreoffice.org/49747 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-14shapes: don't use "GraphicURL" property, always use "Graphic"Tomaž Vajngerl
With GraphicURL property on shapes (XShape) we transported the external or internal URL to the model, which also included the GraphicObject uniqueID style URLs. This changes that - now we always use "Graphic" property and transfer XGraphic to and from graphic filters. "Graphic" property is already present for XShape so it wasn't needed to add it. Filters changed are: OOXML (oox), ODF (xmloff), RTF and binary MS (esherex). Also start using originURL on Graphic which now transports the URL of the external (linked) graphic/image if it was created that way. Change-Id: Ic338c60b7cfaaae354cf1e1ca3ae7a6373220230 Reviewed-on: https://gerrit.libreoffice.org/49648 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-13AddEmbeddedXGraphic: add parameter for requested nameTomaž Vajngerl
Change-Id: Id5f028d3286513b468bc0637484507a34b2188a2 Reviewed-on: https://gerrit.libreoffice.org/49644 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-10ofz#6180 Integer-overflowCaolán McNamara
Change-Id: Ibf4b40521f5be3866451e574abc59b7e1cf3aec9
2018-02-09ofz#6180 Integer-overflowCaolán McNamara
Change-Id: I6339a6ebb188dc9e7bccfa629a40af8e67c13feb Reviewed-on: https://gerrit.libreoffice.org/49487 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-08tdf#115319 use loext namespace for reference-languageLászló Németh
attribute of alternative reference fields with Hungarian articles Change-Id: I19578bc0d5cb5633cf2619e9aea81da946a13f3e Reviewed-on: https://gerrit.libreoffice.org/49437 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2018-02-07tdf#115483 svl xmloff sc sw: verify all ODF 1.2 protection-key hashesMichael Stahl
ODF 1.2 has added some mandatory requirements for protection-key hashes which did not exist in ODF 1.1. This affects sections and indexes in ODT documents, as well as spreadsheets and sheets in ODS documents. 1. Accept the following hashed passwords: * UTF16 LE/BE encoded StarOffice-SHA1, OOo legacy and allowed by ODF 1.1 * UTF8 encoded proper SHA1, as required by ODF 1.2 * UTF8 encoded SHA256, as required by ODF 1.2 - specified either with the wrong URL used in the ODF 1.2 spec or the correct URL from the W3C spec, see OFFICE-3702 * Excel+SHA1 double-hash, only in Calc, see OFFICE-2112 2. Round-trip any of the above as-is * for SHA256 only write the URL from the ODF 1.2 spec 3. Generate only UTF16 LE encoded SHA1 for now, so that older LO releases can still verify the password * some time in the future, switch to generating some valid ODF 1.2 hash More changes are necessary in Calc, which can actually preserve different hashes for the same passwords in its runtime data model, whereas Writer just has a single buffer without even any metadata. For the Calc unit tests we need one document per hash because the protection-key attribute can be set on the entire spreadsheet, which is an unique element in the document. There are further uses of SvlPasswordHelper for change-tracking passwords, but apparently those are stored in settings.xml, so ODF has no requirements for them, so let's leave that as it is. Change-Id: Icb720b14ae9c0d9c04d2e082769ae2b74e3af8aa Reviewed-on: https://gerrit.libreoffice.org/49352 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-05unused includeTomaž Vajngerl
Change-Id: Ia39289367d00b006b022305db500abeb1ab0ef9e Reviewed-on: https://gerrit.libreoffice.org/49220 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-02tdf#115319 references with Hungarian articlesLászló Németh
Add new alternative reference formats, stored by the proposed text:reference-language attribute. This is an implementation of the ODF improvement draft published in the bug report. Note: choose Hungarian locale setting to show the new "Article a/az + Page" etc. reference formats in dialog window "Fields". Change-Id: I210d4b9a3e821fb4e45e24643bad9c70b867c89d Reviewed-on: https://gerrit.libreoffice.org/48944 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-02-01Change bitmap table to store XBitmap instead of GraphicObject URLTomaž Vajngerl
As we want to get rid of GraphicObject URLs for the more robust image life-cycle handling, it was necessary to change the way bitmap table stores and handles images, so that they always store a Graphic object (wrapped in UNO object that provides the XGraphic and XBitmap interface). In addition this changes loading and saving from ODF (xmloff) and OOXML (oox) filters so they don't depend on GraphicObject URL anymore, but load or save directly to / from XGraphic or XBitmap. Change-Id: I2b88e10056e7d6c920249d59188f86b1a5a32d21 Reviewed-on: https://gerrit.libreoffice.org/49074 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-01-31loplugin:useuniqueptr in SvXMLExportNoel Grandin
Change-Id: I8ce26b7cddeb74fd86f60896c84bf3574ccbc9bc Reviewed-on: https://gerrit.libreoffice.org/48421 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-29xmloff: add a comment tooMichael Stahl
Change-Id: Ic23c36250938009b17f4b916f0d13a097d018a0c
2018-01-29tdf#106780 Fix for invalid attribute in impress ODFAbhishek Shrivastava
This patch fixes the invalid ODF generated in impress. In tables now the attribute is shown as table:name="default" instead of "text:style-name". For strict XML version we only set table:name="default" For Extended/Compatibility XML we set both text:style-name and table:name Change-Id: I894fd31f5f0eed3f77b216b3114b5da53acf1f9f Reviewed-on: https://gerrit.libreoffice.org/48373 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-28ofz#5621 Integer-overflowCaolán McNamara
Change-Id: Ie0a7c29428e686e5c480997b84b8d12e5be4539f Reviewed-on: https://gerrit.libreoffice.org/48790 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-26xmloff: ODF export: don't write LO_EXT attribute unless ODF expendedMichael Stahl
The loext namespace is not defined when exporting standard ODF versions, which triggers an assert() in SvXMLNamespaceMap. (regression from 4469b29faeb8dbf7793a5d81d9c5ddebacf3015f) Change-Id: Ic93fb0ea8fe092463d3fd18a0fbf4429d8652642
2018-01-26ofz#5621 Integer-overflowCaolán McNamara
Change-Id: I621fb776457054f82078ed483c8b247acf734a3a Reviewed-on: https://gerrit.libreoffice.org/48630 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-26loplugin:useuniqueptr in XMLTextParagraphExportNoel Grandin
Change-Id: I20a45d5d3914c75b01b55339169d495b294fe7fd Reviewed-on: https://gerrit.libreoffice.org/48514 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-25loplugin:useuniqueptr in XMLTransformerBaseNoel Grandin
and flatten some members, no need to allocate separate object Change-Id: I9f6b7ee89af935608424a88d9343d8bbebaaada1 Reviewed-on: https://gerrit.libreoffice.org/48513 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-25reuse limitCaolán McNamara
Change-Id: I5942b6581c02ac55d7eb6acf535214daa5b34865 Reviewed-on: https://gerrit.libreoffice.org/48507 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-25ofz: out-of-memoryCaolán McNamara
Change-Id: If1c9ade3268f4ebadfdad771fe3b35641dca210d Reviewed-on: https://gerrit.libreoffice.org/48506 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-25loplugin:datamembershadow in SdXMLShapeLinkContextNoel Grandin
in this case, we can just drop the child member and re-use the parent member. The parent class barely contains any logic anyway. Change-Id: I520217c04a38b66323a76bf5fddb476bd3fc8e15 Reviewed-on: https://gerrit.libreoffice.org/48551 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-25loplugin:useuniqueptr in XMLTextFieldExportNoel Grandin
Change-Id: I2b3e1ec5454bc3486fb41b010091adc549500daf Reviewed-on: https://gerrit.libreoffice.org/48512 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-25loplugin:useuniqueptr in SvXMLNumFmtExportNoel Grandin
Change-Id: I720450a4bee17673907fba2e9a34879d2a98bcae Reviewed-on: https://gerrit.libreoffice.org/48481 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-25loplugin:useuniqueptr in SdXMLExportNoel Grandin
and flatten some data structures, no need to allocate some of the the vector members on the heap Change-Id: I8e7e06144da2fa58c8e3352013d44d368d61ea1d Reviewed-on: https://gerrit.libreoffice.org/48480 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-25loplugin:useuniqueptr in XMLEventImportHelperNoel Grandin
Change-Id: I2369ac92fa2f30b98b5910563dd6d0a6f8ca6a0c Reviewed-on: https://gerrit.libreoffice.org/48479 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-24ofz#5621 Integer-overflowCaolán McNamara
Change-Id: I98f93101dc287b2ef285f3d9547d44dd06d2fe01 Reviewed-on: https://gerrit.libreoffice.org/48429 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-24loplugin:useuniqueptr in OOo2OasisTransformerNoel Grandin
Change-Id: I6c1cabbf233e6d3d9fd37cdb5c66ffa17df2dd9c Reviewed-on: https://gerrit.libreoffice.org/48425 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-24loplugin:useuniqueptr in Oasis2OOoTransformerNoel Grandin
Change-Id: I7636bb09bfa728ae8031d57e52d2903f711e9cca Reviewed-on: https://gerrit.libreoffice.org/48424 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-23USHRT_MAX -> SAL_MAX_UINT16 for XMLCharContext::m_nCountStephan Bergmann
...which is of type sal_uInt16 ever since the class got introduced with 0e3ff5db960cdf907c03445220f1e29d37fc367f "INTEGRATION: CWS oj14: #i77059# export char content helper for example line break" Change-Id: I1dcb2894861ea5b6104932d896b7166c5c0b4689 Reviewed-on: https://gerrit.libreoffice.org/48347 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-20loplugin:unused-returns in filter,tools,xmloffNoel Grandin
Change-Id: I7a57be7e241883adac4417baa699a97d6304a631 Reviewed-on: https://gerrit.libreoffice.org/48188 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-18Fix typosAndrea Gelmini
Change-Id: I633e4921042809c628e55825b70c540767eba1d3 Reviewed-on: https://gerrit.libreoffice.org/48140 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-18Fix typosAndrea Gelmini
Change-Id: Iaad78e5f1100df1ca69d34bf7693e4a9feac17eb Reviewed-on: https://gerrit.libreoffice.org/48084 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-17loplugin:unnecessaryparen extend to delete statementsNoel Grandin
Change-Id: Ic4383ea948876a26f791f0e5b0110cef978a26e1 Reviewed-on: https://gerrit.libreoffice.org/48027 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-15tdf#114488 Rank multiple images also for flat odfSamuel Mehrbrodt
Only the file extension was considered before which is not available in flat odf. Now both internal and external URLs are resolved to their respective mimetype. Change-Id: Id7e290cd9a441a1a6c2ce5e8d764391c50495bea Reviewed-on: https://gerrit.libreoffice.org/47824 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-01-15More loplugin:cstylecast: xmloffStephan Bergmann
Change-Id: I870bc9fd1c7361913b073411065ec723f6b080da