summaryrefslogtreecommitdiff
path: root/xmloff/qa/unit
AgeCommit message (Collapse)Author
2021-12-14sw ODF shape import: improve is-textbox checkMiklos Vajna
This builds on top of commit 28d67b792724a23015dec32fb0278b729f676736 (tdf#107776 sw ODF shape import: make is-textbox check more strict, 2019-08-26). Before that commit, any non-empty parent style name on a shape resulted in an sw textbox. After that commit, we filtered out Writer images by checking for the Frame parent style name. The problem with this approach is that in case two documents are to be merged together, then it's reasonable to rename the Frame style, but then the complex content inside the shape gets lost. Fix the problem by going with a middle ground: require Frame as a prefix, but allow other names as well. This gets e.g. FrameX to work without breaking the "reject Graphics" use-case. Change-Id: Id59ed28a64a9398f2f1620f69b5f148d65e6c95a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126828 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-12-14tdf#62032 xmloff: list-level is positiveInteger, impl is 0-basedJustin Luth
Thanks for catching this Regina. Change-Id: Iaf6a0c9161378934818e392126a4437e55f5ddf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126743 Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-12-13ODP import/export: refer to theme from shape text color with effectsMiklos Vajna
Handle luminance modulation and offset (i.e. lighter and darker colors). Change-Id: I536bbca1ed994e991c7ceac153d6a47cb6ef35f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126722 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-12-09ODP import/export: refer to theme from shape text colorMiklos Vajna
Refer to the 12 pre-defined colors by name + don't write the attribute for the case when there is no theme. Change-Id: Ib6ab5b7b34d896a36e04309bf0cb410998acce01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126566 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-12-08ODP import: handle theme of master pagesMiklos Vajna
This is just the theme itself, we don't refer to this theme from e.g. shape text color yet. Change-Id: I0d8f4b06217fb491e47d775628fde742d8ff104d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126502 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-12-07ODP export: write the theme of a master pageMiklos Vajna
Which requires describing the schema, which is really just a new <loext:theme> element, the rest reuses the color-table markup, which wasn't used in ODF so far (but was used in our .soc files). Also make sure that we only do this in ODF extended mode (which is the default). Change-Id: I90eaad30f63946c441fe0c53caf6a47caf1714d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126466 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-10-28tdf#141301: extrusion-skew angle value -135 is not written to file...Julien Nabet
whereas it should since not default value (Regina) Hopefully in some years missing values are unlikely and bug tdf#141127 can be fixed. (Regina) I have added a unit test to Julien's patch. Change-Id: Ia2aabd8e724e3c3db9ae8a87cb27707aa7040fb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113257 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2021-10-10loplugin:moveparam in xmloffNoel Grandin
Change-Id: I46c1c8dc46cd2b8470b69506f6609f8bd7e42211 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123347 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-05drop 'using namespace std' in o* r* x*Julien Nabet
Change-Id: I15d56d133cf464a3cb6483be785b1259c7f35b43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123120 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-09ODT export: order <style:font-face> elements inside <office:font-face-decls>Miklos Vajna
This builds on top of commit 92471550b8c43d8ff0cef8b414884d697edf9e63 (ODF export: sort <style:font-face> elements based on the style:name attribute, 2021-03-11), the additional problem was that the style:name attribute already has number suffixes to have unique names for fonts where the style name would match. This means that even if we sort the container right before writing the elements, which font gets the number suffix depends on the insert order. Fix this by additionally sorting the font items before insertion, given that a single call-site does all the insertion, at least for Writer documents. This is required as SfxItemPool::GetItemSurrogates() exposes a container which is based on SfxPoolItemArray_Impl, which uses an o3tl::sorted_vector<> of pointers, so effectively unsorted, the order depends on the pointer address of the font items. Change-Id: I46569b40796243f7f95b92870504c2023b2ce943 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121823 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-09-03tdf#62032 ODT export: handle style:list-level="..." for para stylesMiklos Vajna
ODT import was already working. The spec also says to only take this into account when applying the style, so it seems only the UI remains for the bug to be closed, the rest is done. Change-Id: I27da4dc171b4ced75f143bbcecb3f8c748a26b02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121607 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-09-02Related: tdf#137363 ODT import: handle style:list-level="..." for para stylesMiklos Vajna
This is just the import side, the export side still needs doing. The used attribute was already part of ODF, and NumberingLevel for para styles where already imported/exported for DOCX. Change-Id: I8385ed23dc799c99e81318387236341b404d01a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121515 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-08-31tdf#126126 ODT import: improve import of cross-table commented text rangeMiklos Vajna
Regression from commit d4b473dd9ba77427b28d97847067b8877c2033d9 (office:annotation-end import, 2012-07-20), the problem was that XMLAnnotationImportContext::EndElement() assumed that we can always call gotoRange() to go from the annotation start and end points, but this is not true: an annotation may start inside a table and end outside a table, which is not a valid selection, so gotoRange() fails. Fix the regression part by just creating a text range for the anchor of the comment, so the comment is attached to the end of the range, and this way the rest of the comment & the document can be at least opened. [ It seems bookmarks behave similarly: they don't block the whole import, but don't work cross table boundaries, either. ] Change-Id: I1b5a2e2e7501ce3054379fc79d2045c3439c52e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121322 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-07-23sw bibliography, local copy: add ODF filterMiklos Vajna
Map it to <text:bibliography-mark loext:local-url="...">. Note how this can be a relative URL, while the text:url attribute is typically a http(s) URL. Change-Id: If16171c9761221841ff07824cb0466fd42911480 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119407 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-23tdf#139734: Drop redundant asserts after MacrosTest::loadFromDesktopAhmet Hakan Çelik
Change-Id: If5b2f2433b4be7b654b08815cbfb08faaac309db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112130 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-01tdf#141345 sw page gutter margin: reimplement ODF filterMiklos Vajna
See <https://issues.oasis-open.org/browse/OFFICE-4105>, the proposal is to include the gutter in the left/top/right margin to have better backwards compatibility, at the price of more complex xmloff code. This works by increasing the left/top/right margin on export (so even if gutter margin is ignored at import time, the layout will look fine, just the editing will be poor) and decreasing on import. Change-Id: I852e5c7366e8641abd61e136f9390466585953fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113464 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-31tdf#140343 sw page rtl gutter margin: add ODF importMiklos Vajna
See <https://issues.oasis-open.org/browse/OFFICE-4105>, the proposal is to not map this to a new attribute of the <style:page-layout-properties> XML element, rather only write writing mode on export and infer RtlGutter from that writing mode in import. This is similar to how FillBitmapOffsetX and FillBitmapOffsetY are two UNO properties, but there is a single draw:tile-repeat-offset attribute for them. This has the benefit of simpler ODF markup, at the cost of more complicated xmloff code. Change-Id: I189a7ec62d4e5624e20252b7259a36133594fe40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113405 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-26Extract copy&pasted namespace list to XmlTestTools::registerODFNamespaces()Miklos Vajna
Both sw/ and xmloff/ can depend on test/, so no need to duplicate this. Change-Id: I93bfdb4422bdef9f8d28bc37548130fae49829e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113107 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-25tdf#134734 xmloff: ODF import compatibility for BackgroundFullSizeMichael Stahl
This is annoyingly complex because LO 6.3 changed the way backgrounds are painted in an inconsistent way. Use the generator version to guess what the document should look like, which of course will give the wrong result if it was created before LO 6.3 and then round-tripped with LO 6.3. Since LO 7.0 at least a hard-coded draw:background-size was written. Change-Id: If9c5d2b32bfa50cbe4fb166132f7223763af850f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112770 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-11ODF export: sort <style:font-face> elements based on the style:name attributeMiklos Vajna
m_pFontAutoStylePool is already sorted, but sorting ignores XMLFontAutoStylePoolEntry_Impl::sName, and changing XMLFontAutoStylePoolEntryCmp_Impl would affect how find() works in XMLFontAutoStylePool::Add(), so just extend XMLFontAutoStylePool::exportXML() instead. With this, the order of <style:font-face> elements is meant to be stable in content.xml and styles.xml, helping use-cases where a document is converted to ODF multiple times and an integration test wants to assert that the output is the same. Change-Id: If0dbfa40a1b204aebe5e141fe64f71ac2ca92405 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112339 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-02-10loplugin:refcounting also check OWeakObject subclassesNoel
Change-Id: I2d89085a22d7424c6f8f7662307433ce50fc61d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-15tdf#136861 ODT export: fix writing resolved state for non-ranged commentsMiklos Vajna
It was probably not intentional to write the resolved state only in case the annotation has a name. Change-Id: Ia3a6b2320e2288528c43c832211ebfcde492881e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109354 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-10fix coverity parse errorsCaolán McNamara
Change-Id: I4884bfb67a061b865e8cf38b2fea6de0cb1bc3d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109057 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26New loplugin:stringliteralvarStephan Bergmann
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for details. (Turned some affected variables in included files into inline variables, to avoid GCC warnings about unused variables.) Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-05clean up some temp files after running testsAndras Timar
Change-Id: Ia28e96cf1f6ec476f202e99877fa80e93d691278 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105314 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-08-16Fix typoAndrea Gelmini
Change-Id: Ie3910ffbee6f3a80f077e1c2f3e3112daa96017a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100654 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-13Remove some unused includesMiklos Vajna
Change-Id: Iea6b931b1f2328886354f70ad81a3e07367db717 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100669 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-08-12tdf#135144 xmloff textbox: fix export style name to be consitent with importMiklos Vajna
Regression from commit 28d67b792724a23015dec32fb0278b729f676736 (tdf#107776 sw ODF shape import: make is-textbox check more strict, 2019-08-26), the problem was that in case the import side in SdXMLCustomShapeContext expects a fixed "Frame" parent style name, then the export side should go with that name as well. Fix the problem by simplifying XMLShapeExport::collectShapeAutoStyles(), which initially assumed that the string may be localized, so try to look it up: instead just use the fixed string that the import side will look for. This solves all problem which may stem from a parent style name which is non-empty, but other than Frame. Change-Id: I8146440c591d3dd5a904d243d85741d704711e9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100577 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-08-07Fix typosAndrea Gelmini
Change-Id: Iedaac490a577d3582ea9ef5a105836eff8c2eaf5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100078 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-04tdf#130707 xmloff: survive <text:database-display> in editeng textMiklos Vajna
Regression from commit 28d67b792724a23015dec32fb0278b729f676736 (tdf#107776 sw ODF shape import: make is-textbox check more strict, 2019-08-26), now that we correctly identify what shape text to import as "textbox" (Writer TextFrame) and what to import as editeng text, there are documents out there that try to import mailmerge fields into editeng-based shape text. Fix missing error handling there. Note that the error is not just silently ignored, we do insert the field result into the shape text, existing code provides this already. Change-Id: Ibe631ac5d94c1c7795dd00bad05fdcca0e6741a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100028 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-27Remove some unused includesMiklos Vajna
Change-Id: Id5a31185faf2a3a13b6ea266e058a7df41d44423 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94890 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-20tdf#130479 FODG import: fix handling of <draw:fill-image> in stylesMiklos Vajna
Regression from the image handling rework, the problem was that the old, URL-based code had explicit handling of mxBase64Stream, while the new, XGraphic-based code assumed that by the time we reach the end of of the bitmap style element, maAny already contains the graphic. Fix the problem by improving XMLBitmapStyleContext::EndElement(), so it loads the graphic from the base64 stream if we don't have a graphic already. Change-Id: I6d90f1470a5b797fb51789901081ccd7a6fd29e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94548 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-19xmloff: ODF export: additional ODF 1.3 chart featuresMichael Stahl
* OFFICE-3662 chart:interpolation additional values * OFFICE-3958 chart regression curve: polynomial * OFFICE-3959 chart regression curve: moving-average None of these are exported in ODF 1.2 extended because they require additional values for standard attributes, which isn't valid. Change-Id: I920cc44dbde46687b570c1296c7d8926f0a1a9c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94064 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-05-11Document relation between three lists that must be in syncMike Kaganski
Change-Id: I9fc44b6878450d147d21f77ff4daa6939edfa0c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93837 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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-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>
2019-09-30tdf#42949 Fix IWYU warnings in xmloff/source/[c-m]*/*cxxGabor Kelemen
Also checked xmloff/qa Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I843917d255f841066ace8d944aa1d00f1b718108 Reviewed-on: https://gerrit.libreoffice.org/79773 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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-16New loplugin:emptyStephan Bergmann
Change-Id: I8729db064573ac21dfe6b203c5ae244d79ecc4fe Reviewed-on: https://gerrit.libreoffice.org/66430 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-19loplugin:staticvar in xmloffNoel Grandin
Change-Id: I283d162807a906334627613be7c340af566144f1 Reviewed-on: https://gerrit.libreoffice.org/61921 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-24tdf#42949 Fix IWYU warnings in include/comphelper/[a-l]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I22ba2c8aec235e34cd7835b8a0a716bf3057db7a Reviewed-on: https://gerrit.libreoffice.org/60837 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-13loplugin:simplifyconstruct in writerfilter..xmlsecurityNoel Grandin
Change-Id: Ic2d901ca0dbc2d6fa96611d260c1572da8a783c0 Reviewed-on: https://gerrit.libreoffice.org/60398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-30loplugin:useuniqueptr in XMLTextParagraphExportNoel Grandin
Change-Id: I753bbfc60172a36e1f3ba08398dc17ee14e0c551 Reviewed-on: https://gerrit.libreoffice.org/53604 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-14xmloff: ODF import: improve meta:generator checksMichael Stahl
Instead of a hard-coded check for (effectively) one project name "LibreOffice" (which is build-time configurable), check for the string "LibreOffice_project", which has been produced hard-coded ever since LO 3.3.0. This now recognises additional downstreams "LibreOffice_Vanilla" and "Collabora_Office", and also historic "BrOffice". An important point here is that the build-time configurable version numbers of any downstream that retains the hard-coded "LibreOffice_project" *MUST* be the same as the upstream's at least in their major and minor versions (micro and further digits are currently not used), and that such downstreams don't backport changes with ODF export compatibility impact further than upstream. Add a unit test too, with a representative sample of 4372 distinct generators in bugzilla attachments. This revealed that StarOffice 6 and AOO 4.0.1 were falling through the cracks and not recognised, so fix that too. Change-Id: I8105222d3428e7b20cc4a6b8e76732c697812594 Reviewed-on: https://gerrit.libreoffice.org/51171 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-10-23loplugin:includeform: xmloffStephan Bergmann
Change-Id: I9e55142a7904c426fce49f68f1790365ea490fab
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-01-06writerperfect, xmloff: fix loplugin:cppunitassertequals warningsMiklos Vajna
Change-Id: Ie8246433a7cea0886f00d8c76cf6f7d023545417 Reviewed-on: https://gerrit.libreoffice.org/32770 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-10-07xmloff: fix --enable-mergelibs buildMichael Stahl
... by merging all object-using CppunitTests into uxmloff, which is already disabled for MERGELIBS. Change-Id: I12ad08660fd714cceba2fe9b855cdb1bbda19c2d
2016-08-22GSoC - Keeping both token lists in xmloff/ consistent:Mohammed Abdul Azeem
Added dummy tokens to keep the lists consistent and a test case to check the same. Change-Id: Ia58f1f77a5100a9fb3c7226fcad1fef1bd5aec39 Reviewed-on: https://gerrit.libreoffice.org/28183 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>