summaryrefslogtreecommitdiff
path: root/xmloff
AgeCommit message (Collapse)Author
2019-02-21xmloff: create XMLImpressContentExportOasis instances with an uno constructorMiklos Vajna
Change-Id: I75301ca29794dd42a966faa36add3078c8c55211 Reviewed-on: https://gerrit.libreoffice.org/68166 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-20More loplugin:simplifyboolStephan Bergmann
...found with (trunk) libc++ on macOS, where the standard library iterator implementations are apparently sufficiently different to libstdc++ to find more cases of !(... == ...) vs. ... != ... Change-Id: Ia3861406aa584c7b1d33f47448190b5cf2e770f7 Reviewed-on: https://gerrit.libreoffice.org/68089 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-15xmloff: create XMLImpressStylesExportOasis instances with an uno constructorMiklos Vajna
Change-Id: I831321bcce241bc180e22b20364137f776fee0f9 Reviewed-on: https://gerrit.libreoffice.org/67847 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-13sw btlr writing mode: implement ODF filterMiklos Vajna
An easy way would be to just extend aXML_WritingDirection_Enum, but then we would write the new attribute value to a non-extension namespace. So special case the new attribute value during both import and export (and only for table cells as a start). Change-Id: I431bf99693c4a3452e91f241bd2f0fcfc72c68fd Reviewed-on: https://gerrit.libreoffice.org/67770 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-11tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: Ib9ad5b874a210ef3862c668158fcc5d18eeab363 Reviewed-on: https://gerrit.libreoffice.org/67579 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-11loplugin:indentation in writerfilter..xmloffNoel Grandin
Change-Id: Ibda157508e92ab5fb222daf79a38941c30a8057e Reviewed-on: https://gerrit.libreoffice.org/67611 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Ib3201f865d43f372007cdf381c7e244e9cbeae26 Reviewed-on: https://gerrit.libreoffice.org/67474 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-08xmloff: create XMLImpressExportOasis instances with an uno constructorMiklos Vajna
Change-Id: I58c689f5a1b034f64687031e24b82a3ac56e4bae Reviewed-on: https://gerrit.libreoffice.org/67519 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-06no need to use OUStringHash here anymoreNoel Grandin
Change-Id: I2faa8c971dc7f4642353dceafa25b9022a0dfd2a Reviewed-on: https://gerrit.libreoffice.org/67436 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-05Remove code committed involuntarily.Xisco Fauli
Follow-up of a7da594593eb2d63004a91dc471683713ce9742a Change-Id: I7e252f9a881b2ac1098bc21bd193f66d32404056 Reviewed-on: https://gerrit.libreoffice.org/67423 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-02-05tdf#122625: Use solution for tdf#118879 in a more general caseXisco Fauli
Partially revert commit 36aa3f4d6f9e9da7289ed760cfb1e87600cb6459 Change-Id: Ia554d3e64da2ee620c69bc66b33a6cd305502c64 Reviewed-on: https://gerrit.libreoffice.org/67418 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-02-04tdf#118879 don't embed base64 image data if we have an origin URLTomaž Vajngerl
If an Graphic has an OriginURL it means it was created from an external source. We want to preserve this so we don't want to add the image base64 data - used in Flat ODF format. Change-Id: I2782ec53cf8dc78b0c360365d3eed3e5c54bf271 Reviewed-on: https://gerrit.libreoffice.org/67338 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-02-01Use << instead of + in SAL_WARN_IFStephan Bergmann
Change-Id: Iedf02c89954458e762a1997ed1676a278570a00c Reviewed-on: https://gerrit.libreoffice.org/67251 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-01fix incorrect OSL_ENSURENoel Grandin
broken in commit 5e0b52c1893ffe04a68333026afa7a557c48d534 Date: Thu May 17 14:51:04 2012 +0100 some more ConstAsciiString behind OSL_ENSURE Also convert to SAL_WARN_IF, and make the error message more useful. Change-Id: I7f1d0c577751e7309d5a0d544f38c5050b903a58 Reviewed-on: https://gerrit.libreoffice.org/67230 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-01xmloff: create XMLImpressImportOasis instances with an uno constructorMiklos Vajna
Change-Id: I10cac20b8180c0fc4d7cade2ab3d5de0f9380a88 Reviewed-on: https://gerrit.libreoffice.org/67240 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-29Improve ODF enhanced-path command moveTo to follow specRegina Henschel
ODF 1.2 section 19.145 says 'If a moveto is followed by multiple pairs of coordinates, they are treated as lineto.' The patch does this on import. Change-Id: Ib493ca49288cdb2d34b7ee801bd052281617d2e8 Reviewed-on: https://gerrit.libreoffice.org/66888 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2019-01-23loplugin:constparams in xmloffNoel Grandin
Change-Id: I8874c9204b8bf8f422fb5bb826a340b787589360 Reviewed-on: https://gerrit.libreoffice.org/66768 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-22tdf#42949 Fix IWYU warnings in include/xmloff/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Id20e0bc42e39f868a7c5d49d756f2ad5e14a86c0 Reviewed-on: https://gerrit.libreoffice.org/66637 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-19tdf#101218 Import layer-set from pageRegina Henschel
This patch is a interim solution for document exchange between Karbon and LibreOffice, till layer-set for page and for master-page is implemented some day. Change-Id: I2f12eeeb9c742f65999fd4c0d95c418273ae008f Reviewed-on: https://gerrit.libreoffice.org/66518 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2019-01-18Use getTokenCount instead of custom codeMatteo Casalin
Change-Id: Ie6f097984950d306453f0735eb299cfa65d4d74e Reviewed-on: https://gerrit.libreoffice.org/66225 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-01-18Avoid getToken index for single call, minor simplificationMatteo Casalin
Change-Id: If9ec36565cf42d11a0e1715f4aac28c365843a56 Reviewed-on: https://gerrit.libreoffice.org/66226 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-01-16New loplugin:emptyStephan Bergmann
Change-Id: I8729db064573ac21dfe6b203c5ae244d79ecc4fe Reviewed-on: https://gerrit.libreoffice.org/66430 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-14use unique_ptr in XMLPropertyHandlerFactory::CreatePropertyHandlerNoel Grandin
Change-Id: Idb33e3a23b7e6001b2c549875a16b475d3ecd470 Reviewed-on: https://gerrit.libreoffice.org/66186 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-13Base loops on getToken index, not on numer of tokensMatteo Casalin
Change-Id: I5dea52157b42749bcd1925bd7a9fcefad1dc857f Reviewed-on: https://gerrit.libreoffice.org/66224 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-01-13Avoid index for single getToken callMatteo Casalin
Change-Id: Id7206487f96792ffe38611c36ac0e0e28bcc59b7 Reviewed-on: https://gerrit.libreoffice.org/66222 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-01-11Replace OUStringBuffer::appendCopy with append(std::u16string_view)Stephan Bergmann
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-08convert "*xxx.get()" to "*xxx"Noel Grandin
Change-Id: Ic307226591ff9702957ccdec486ccf70357eb6d9 Reviewed-on: https://gerrit.libreoffice.org/65951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-07Fix typoAndrea Gelmini
Change-Id: I68223a70c2fb937e32b22b1f3131eef074c22de6 Reviewed-on: https://gerrit.libreoffice.org/65921 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-31tdf#112782: data-pilot-source is invalid in odf1.2 strictJulien Nabet
Change-Id: Ie24c416cb9ba8de904bf6e725a60b62ce7787596 Reviewed-on: https://gerrit.libreoffice.org/65742 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-12-29tdf#47471 odfexport: use stylename if autostyle missing.Justin Luth
My guess is the autoStylePool can be invalidated by some events (like clearing all attributes), and if nothing is done that re-creates the autostyle, then Find() returns an empty string. The normal case when all attributes are reset is that since there are no attributes, it doesn't bother looking for the AutoStyle, and just sticks with the given "parent" style. However, some attributes (like lists) aren't reset, and in those cases the autoPool didn't exist, and yet it still looked for something, returning an empty string when nothing was found. If there is a style, but autostyle returns nothing, then it should be safe to always use the given style. There are two more areas with similar coding that I will change in separate commits. (However, note that bug 90221 shows that an empty autostyle might not be exactly like the given style). Change-Id: I6a3d7b1608160f555004ca9cf1c93ec301177288 Reviewed-on: https://gerrit.libreoffice.org/65616 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-12-28tdf#112480 drawooo:enhanced-path only with ODF ver > 1.2Regina Henschel
Saving in ODF 1.2 strict using a debug build crashes in SvXMLNamespaceMap::GetQNameByKey. A pro build does not crash but returns the local name without a prefix, which produces the output reported in Bugzilla. Change-Id: I497cd4a2861f26616cc9ff0b65ca017834097f75 Reviewed-on: https://gerrit.libreoffice.org/65631 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2018-12-28related tdf#47471 textgraphic: use stylename if autostyle missingJustin Luth
The same fix for 47471 should also be useful for textgraphics. Change-Id: I27cef6bd22fbc4f2a94fb17231a3c385987364e0 Reviewed-on: https://gerrit.libreoffice.org/65619 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-12-27related tdf#47471 textframe: use stylename if autostyle missingJustin Luth
The same fix for 47471 should also be useful for textframes. Change-Id: I58b345eaa81dddf750f042610015ef45cd955c06 Reviewed-on: https://gerrit.libreoffice.org/65617 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-12-26tdf#122335 follow-up, typoJulien Nabet
Change-Id: I6fa7e5874179e6c28518a8ff056205ba29282740 Reviewed-on: https://gerrit.libreoffice.org/65628 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-26tdf#122335: sub-view-size can only be used with ODF ver > 1.2Julien Nabet
Change-Id: I7dd767fddd11319017a215c240684dcc17238c4e Reviewed-on: https://gerrit.libreoffice.org/65623 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-20use unique_ptr in xmloffNoel Grandin
Change-Id: I98fc0630308e51fcc5eb0224af77881eebf0ff0f Reviewed-on: https://gerrit.libreoffice.org/65443 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-18sw_redlinehide_4b: xmloff: destroy TextImportHelper before ModelMichael Stahl
nullpointer in ~XMLRedlineImportHelper in SwUiWriterTest::testThreadedException() Change-Id: Ic4a79ceffa831aced4db47836333a15a13773887
2018-12-18use unique_ptr in ImpXMLAutoLayoutInfoNoel Grandin
Change-Id: Iede8522988ae26a76fe5bb28491c17b76376420f Reviewed-on: https://gerrit.libreoffice.org/65145 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-18use unique_ptr in XMLTextImportPropertyMapperNoel Grandin
Change-Id: I8cc60add5fd8e3e17804795915fc4f87523b0599 Reviewed-on: https://gerrit.libreoffice.org/65143 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-18use unique_ptr in XMLPropertyBackpatcherNoel Grandin
and drop what looks like a very old (from 2000) workaround for long typenames and linker problems Change-Id: I9b4b42b0c37cacaa447a104bd2cf0d4aa76ba5fc Reviewed-on: https://gerrit.libreoffice.org/65142 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-13address forward incompatibility of InputRequired default changeLionel Elie Mamane
commit fec8c14e960fbcd639a04d6c3354caff2d0bd365 changed the default value of InputRequired as read from the file; that is the value InputRequired has when it is set to neither false nor true in the file This is to mitigate the fact that InputRequired was not property enforced and now suddenly is, but its default value was "true"! So lots of past forms have InputRequired==true everywhere, users did not pay attention to it because it was not enforced, and now it is enforced, which suddenly is a huge PITA for users because they have to update most controls in all forms. Since older versions of LibreOffice omitted the input-required attribute in the file (the XML stream) when it had its then-default value (namely "true"), we changed that to now mean "false". As a side-effect, newer LibreOffice omits the attribute in the XML stream when InputRequired has its new default value, namely "false". So the situation is that any file saved with an older LibreOffice will have all its form controls with InputRequired==false when opened with a newer LibreOffice, and any file saved with a newer LibreOffice will have all its form controls with InputRequired==true when opened with an older LibreOffice. This commit makes LibreOffice always write the XML attribute. So that any file saved with a newer LibreOffice will have the same InputRequired values when opened in an older LibreOffice. This enhances forward compatibility, because InputRequired was enforced in older versions when the underlying database field was marked NOT NULL. So the current situation leads to unwanted enforcement in older LibreOffice versions, with a file that is saved from newer LibreOffice with a control having InputRequired==false and bound to a database field marked NOT NULL. This commit fixes that, by ensuring that any form control with InputRequired==false in newer LibreOffice will also have InputRequired==false in older LibreOffice. Change-Id: I92ef48ad99c4e2ead43e95376282cc861c181ab3 Reviewed-on: https://gerrit.libreoffice.org/64642 Tested-by: Jenkins Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Reviewed-by: Eike Rathke <erack@redhat.com>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08related tdf#51671, store new "hide legend" feature also in ODFMarkus Mohrhard
Change-Id: Ibf55f02eccdcadb2d42f5aff8d72bff20ada3b3a Reviewed-on: https://gerrit.libreoffice.org/64792 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-12-07HAVE_CPP_INLINE_VARIABLES is always true nowStephan Bergmann
...but for safety, leave the configure.ac check in for some longer. Also remove now-redundant SAL_INLINE_VARIABLE again (which was LIBO_INTERNAL_ONLY). Change-Id: Id049e0cb84b4f97f5859f1b16b867b39b448dec0 Reviewed-on: https://gerrit.libreoffice.org/64772 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29remove unnecessary "if (!empty()" checks before loopsNoel Grandin
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-26remove some unused enum values in xmloffNoel Grandin
(*) also make it more obvious what XMLShapeExportFlags::SIZE represents Change-Id: Ie63edf0f2827f171542037b819ebe7d55e090275 Reviewed-on: https://gerrit.libreoffice.org/63948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-24BoolAttrFlags::DefaultMask is unnecessaryNoel Grandin
Change-Id: Iaae876e180cef95cb45e4c0df63e146aaf5320be Reviewed-on: https://gerrit.libreoffice.org/63909 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-23improve function local staticsNoel Grandin
simplify the initialisaion and make them thread-safe i.e. initialise them using the runtime's local static locking. Thanks to mike kaganski for pointing out the nice lambda approach that makes this feasible. Change-Id: I76391189a6d0a3d7eed2d0d88d28dfa6541eaff7 Reviewed-on: https://gerrit.libreoffice.org/63645 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-16loplugin:staticmethods improvementNoel Grandin
Change-Id: I8889ce8a7d2309b54454cfe4c6421282e1c6e755 Reviewed-on: https://gerrit.libreoffice.org/63434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>