summaryrefslogtreecommitdiff
path: root/writerfilter/qa
AgeCommit message (Collapse)Author
2020-11-16DOCX import: lost cached result of fields: fix leading whitespaceMiklos Vajna
" IF " and "IF " is the same, but "IFF " is something different. (cherry picked from commit 65d6173152deab49f9c9ed138f6d9fa56008b800) Conflicts: writerfilter/source/dmapper/DomainMapper_Impl.cxx Change-Id: Ieb2d128d28ed3daa3df73128804bcc40dda9878d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105942 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-16DOCX import: fix lost cached result inside an IF fieldMiklos Vajna
This builds on top of commit d09336fbdceaafd9320466b660a2b32a07dcc16a (tdf#125038 DOCX import: fix lost MERGEFIELD result inside an IF field, 2019-10-31), and extends it for more cases. We know that DOCVARIABLE, FORMULA and IF fields inside an IF fields is not something Writer is capable of, so make sure we keep the cached result. (cherry picked from commit 6b15b6a6ab294e1d4a3a4bfb5ac81630aa08015c) Conflicts: writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx writerfilter/source/dmapper/DomainMapper_Impl.cxx Change-Id: I20004f97c2073309c33594e5da6f8ba89ba278ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105937 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-27DOCX import, altChunk: fix missing page breakMiklos Vajna
Somewhat similar to copy&paste, the altChunk mechanism drops styles from the inner document by default. A surprising consequence of that is sections in the inner document have the default page size. This leads to a page break when the content of the outer document ends and the content of the inner document starts. Fix the importer to support this: 1) Ignore the page size and number in DomainMapper::lcl_attribute(). 2) Pass the start of the current section to the sub-importer, so that it can insert the starting page break at the right place. (cherry picked from commit 32c322e9d037b29ded2297b400a2c596c042f1fa) Conflicts: writerfilter/source/dmapper/DomainMapper_Impl.hxx Change-Id: Id3955f2b35a139692254c4ac1233e96eef2620e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104870 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-27DOCX import: handle <w:altChunk r:id="..."/>Miklos Vajna
This refers to a self-contained full DOCX file inside a DOCX file. (cherry picked from commit 4347d505e7d1c90809dd356334fcdc7936c84f73) Conflicts: writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx writerfilter/source/dmapper/DomainMapper_Impl.cxx writerfilter/source/dmapper/DomainMapper_Impl.hxx Change-Id: Ic9451833db30231f08ff2e2493da678edbc9a4c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104869 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-30DOCX import: fix overlapping floating tables when anchored inside a tableMiklos Vajna
The WW8 import does the same in SwWW8ImplReader::StartTable(), now we're on par with that. (cherry picked from commit 6c82a9fa1da15d5f83f524f6897028906dda337e) Change-Id: I2ce0d96d255d8f405203f36a358559687b36e9e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99777 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-15DOCX export: fix interaction between the crop and the wrap polygon of imageMiklos Vajna
If the wrap polygon is influenced by crop at import time, we need to do the opposite at export time. Do this for RTF and DOCX, where there is matching import code in writerfilter/, leave DOC alone for now. Test this by changing testFdo76803 into an export test, then seeing how the first point's Y position fails and fixing up the exporter, so we get back the old good value. (cherry picked from commit c68b458514b35cae70c9a6630e06f46a867aa3b9) Change-Id: Ieef18aad3c76f7945c7348201b07bcb27a4cd48d
2020-05-15DOCX import: fix interaction between the crop and the wrap polygon of imagesMiklos Vajna
Word first applies the crop, then applies the wrap polygon on the remaining visible part of the image. Writer applies the crop on the original bitmap, and even has explicit code to make sure the uncropped bitmap is used for the wrap polygon, see how SwFlyFrame::GetContour() calls SwNoTextFrame::GetGrfArea(), which will extend the resulting size based on cropping. Fix the problem by moving and scaling the wrap polygon, so it ends up where it would in Word. Also adapt testFdo76803, which had a similar crop+wrap polygon case, but the different there is quite small. (cherry picked from commit 2abe9837deee3823c7928a76b5b2f94f1464f1a3) Conflicts: writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx Change-Id: Iab2adaa81a33eb04e1806b17ed129ac50f5d2aa3
2020-05-12sw: add DOCX import for semi-transparent textMiklos Vajna
This is one of the text effects properties, which is already grab-bagged. That is done in a generic way, so the easiest is to just read the value from the grab-bag, rather than from the dmapper tokens directly. (cherry picked from commit 3a749d7278bbe65cfc063e64460df8af6bc2af47) Conflicts: writerfilter/CppunitTest_writerfilter_dmapper.mk Change-Id: Id74a3eb0abddf745a9e4e59625bf9345f7df9dfe
2020-05-07DOCX import: don't touch the ZOrder of inline, in-shape objectsMiklos Vajna
1) This is not needed: Word only supports inline "anchoring" in textboxes. 2) If the textbox has a certain ZOrder, we don't want the inline shapes to be behind the textbox. 3) This allows restoring the old assert in sw_ooxmlexport7 that was changed in commit 99847d6b3005c5444ed5a46ca578c0e40149d77c (DOCX import: fix ZOrder of inline vs anchored shapes, 2020-02-12). (cherry picked from commit 70ae12fe0b9e33633fc62cf805c261ef51fb4b59) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport7.cxx Change-Id: I817e4fb70cb789e8eb116219050fc1aeaec76667
2020-05-07DOCX import: fix ZOrder of inline vs anchored shapesMiklos Vajna
Shapes which are anchored but are not in the background should be always on top of as-char anchored shapes in OOXML terms. Writer supports a custom ZOrder even for as-char shapes, so make sure that they are always behind anchored shapes. To avoid unnecessary work, make sure that when there are multiple inline shapes, we don't pointlessly reorder them (the old vs new style of the sorting controls exactly this, what happens when two shapes have the same ZOrder, and all inline shapes have a 0 ZOrder). Adapt a few tests that used ZOrder indexes to access shapes, but the intention was to just refer to a shape: fix the index and migrate to shape names where possible. (cherry picked from commit 99847d6b3005c5444ed5a46ca578c0e40149d77c) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport7.cxx writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx Change-Id: I670e4dc2acbd2a0c6d47fe964cb5e3f2300e6848
2020-05-06DOCX import: fix margins of inline shapes with effects, imported as Draw shapesMiklos Vajna
Effects have an extent, and unhandled effects (like this blurred shadow) need to take space in the margin of the shape to make sure they use the correct amount of space in the layout. This was working in general, but not in case the importer decided to import the shape as Draw shape + the shape was inline. (And also disable a new CppunitTest_sw_uibase_shells test on Windows, which is only stable on Linux, it seems.) (cherry picked from commit bf25e69f8f657d5e3bcdd0bd54c5fa0d66ec85fe) Conflicts: writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx Change-Id: I9d0531d9393d8c2cd274e6f54bbbfe8024bf270f
2020-05-04DOCX import: fix lost page break when footer ends with a tableMiklos Vajna
Regression from commit 7d3778e0ef9f54f3c8988f1b84d58e7002d6c625 (bnc#816593 DOCX import: ignore page breaks in tables, 2013-09-02), the page break was ignored because the preceding footer ended with a table (no empty paragraph at the end of the footer stream). Fix the problem by saving/loading the table state around header/footers, that way the page break is not ignored. Adjust testTdf102466 to test the page number from Word. (cherry picked from commit a86a2a1c1ceb7203857d4317913c5b1bb9feb4aa) Conflicts: writerfilter/CppunitTest_writerfilter_dmapper.mk writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx Change-Id: Ia4c22452ee2c37f7f941dfd922db04c851644d0c
2020-04-29DOCX import: handle <wp:positionH relativeFrom="insideMargin">Miklos Vajna
This is the same as page, but it is from-left on odd pages and from-right on even pages, i.e. our "mirror on even pages" mode. (cherry picked from commit fccbb557add457db16e0556c3f0172cafc2cf981) Conflicts: writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx Change-Id: I018e0ac165a3d802f64cfc314d5c5f58da3cb580 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93003 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-14tdf#103964 DOCX import: ignore rotation when setting position of group shapesMiklos Vajna
Regression from commit 36ac7749523e0c6f40a77beac278bd9e7a667a9b (DOCX import: make sure rotation does not affect shape position, 2014-09-24), the motivation for tweaking the rotation when setting the position of a shape was for images. By accident, this also happened for group shapes. But the bugdoc shows it's not a good idea to read the rotation of group shapes: the group shape is just a container, it does not have rotation in itself. (The test120551 intention was probably just to verify that the position is not entirely off, so the small required change to the expected value should be OK.) (cherry picked from commit 9fedce7a261f28dc286943f7bdd2adb010ed9b31) Conflicts: writerfilter/CppunitTest_writerfilter_dmapper.mk Change-Id: I8e12c28e65c5f64168c3f802546fddf472fcc6eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87589 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-11tdf#129221 DOCX import: fix missing restart of numberingMiklos Vajna
Regression from e49d2b31fb2020d065b4ad940d1031d07b10f32b (fdo#78939 [DOCX] Hang while opening due to incorrect modification of Style, 2014-06-06), the problem was that the 2nd sub-list of the bugdoc was not restarted in Writer, while it was in Word. The PR2 paragraph style inherits from the PR1 one and only that sets the numId; tweaking the bugdoc to state the numId directly in PR2 would work around the problem. Fix the issue by improving DomainMapper_Impl::finishParagraph(), so that it uses lcl_getListId() rather than calling pStyleSheetProperties->GetListId() directly; since the previous knows how to walk up the parent chain if needed. (cherry picked from commit 63d3ac37865460ff51348a6e792bbacf2f7c4653) Conflicts: writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx Change-Id: I1c460919b0389d5b053b4ca1c9210279d6cd183c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88426 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins
2020-02-07DOCX import: don't give up on floating tables in headers completelyMiklos Vajna
This reverts commit 213d6390a2cc59d174173f4359c161625a9c4bdc (tdf#108272 DOCX table-only header: fix SAX parser error, 2020-02-03), except its testcase and replaces it with a better fix that does not import all floating-table-in-header as non-floating tables. See the new testcase, which is 1 pages in Word, it was 3 pages in Writer, and with the better fix it's now 1 pages in Writer as well. Change-Id: Ica3500120f12222d7cf766d55c17d78164865026 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88037 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88098
2020-01-03tdf#129205 DOCX import: handle the <w:shd w:val="nil" ...> paragraph propertyMiklos Vajna
Reading the spec, "nil" is the opposite of "clear": i.e. if the (background) color is red and the fill (color) is green, then "clear" means green. And you would expect "nil" means red, but it's just nothing in Word. Fix the problem by doing the same: don't set any paragraph property for the "nil" case and keep doing it for the common "clear" case. (cherry picked from commit fbe7612d654be9dfe1ea6f2e67900eb4eec4202a) Change-Id: I30af8a7fb55fb9bab2d12e120069a479fc7ab0a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86098 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-12-22DOCX table import: fix interaction of 1-cell rows and "inside" vertical bordersMiklos Vajna
The interesting part of the bugdoc was: - table style wants visible borders - table direct formatting clears left and right borders - 1st row of the table has 1 cell (2 cells in fact, but they are merged) Fix the "inside" vertical border handling, so that the first cell gets these vertical borders as a right border only in case there are multiple cells. (cherry picked from commit fd92740a86ab8e71e77d947d1d7dabc51a8d0794) Change-Id: Id847109ecfa95d1745abe62ddf36c4936b730855 Reviewed-on: https://gerrit.libreoffice.org/85574 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-01-31CppunitTest_writerfilter_rtftok: use CPPUNIT_TEST_FIXTURE()Miklos Vajna
Change-Id: I16e0c1adf854c3a2fa8d945724270d2d87461b39 Reviewed-on: https://gerrit.libreoffice.org/67192 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2018-01-04tdf#42949 Fix some more Include What You Use warningsMiklos Vajna
Change-Id: I2040315707674dc99a37aedb96ac61dca274c13a Reviewed-on: https://gerrit.libreoffice.org/47348 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-22RTF filter: drop now redundant astyle.optionsMiklos Vajna
I (tried to) keep the RTF filter style consistent locally with astyle in the past, but now that's redundant when we have an enforcing clang-format mechanism in place. So drop the astyle config and switch to clang-format in the RTF filter case. To minimize backport pain, do this shortly before the libreoffice-6-0 branch-off. Change-Id: I708dbeb0b5ad2afacc90029ee5abba9495f4601f
2017-08-16DomainMapper_Impl: add check for m_xTextFactory.is() where missing.Justin Luth
To test: make CppunitTest_writerfilter_rtftok These crash triggering instances were hidden by the presense of \super in topcontext-2.rtf - so I copied it, and only removed \super. My fix for tdf#109382 triggered a unit test failure for one missing m_xTextFactory. It seemed safe enough to test for all of them that aren't in try/catch blocks, not just for the specific instance I can prove with the test. Change-Id: I1e317e05f9bcbbb14360941ce07af1bdf0edac6a Reviewed-on: https://gerrit.libreoffice.org/41060 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-11tdf#105204: ShellCheck nitpicks for watch-generated-code.shYeliz Taneroğlu
Change-Id: Ic1e953b5bcae6124ee6ce7d141ddac11a94b2a8b Reviewed-on: https://gerrit.libreoffice.org/37464 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-09-12fftester: no table managerCaolán McNamara
Change-Id: Icb3c640e04416f9120d37558646a570daeddf0a4 Reviewed-on: https://gerrit.libreoffice.org/28825 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-10fftester: no table managerCaolán McNamara
Change-Id: I033454670d1ee662bc80bc07578690155d97ce28 Reviewed-on: https://gerrit.libreoffice.org/28805 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-10fftester: use of deleted RTFParserStateCaolán McNamara
but we only use the RTFParserState to use its m_pDocumentImpl and the m_pDocumentImpl is never changed for the RTFParserState lifetime, so take the m_pDocumentImpl at ctor time instead and use that directly later Change-Id: I15152e3f6d9008553b4a384a5e5da21373904cc9 Reviewed-on: https://gerrit.libreoffice.org/28802 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-06fftester: missing ValueLastCaolán McNamara
Change-Id: I8e881871b1ae4dea757263d04796779e62e168dc Reviewed-on: https://gerrit.libreoffice.org/28693 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-02fftester: apparent wrong property tested for existenceCaolán McNamara
Change-Id: I5d208bb2a85d7aa4eea9b1c950eeb6f35493f759
2016-08-27fftester: topcontext checkCaolán McNamara
Change-Id: I2045ce82a1d536ab566e6a1218bea9c6a6696024
2016-08-07fftester: guard against empty table manager stackCaolán McNamara
Change-Id: Ibb4cadb58aa17eacfc9741f7f13c780be347cd8b
2016-08-02fftester: guard against no drawing object property setCaolán McNamara
Change-Id: I51736459f9f098d9d793bff3b9a1a403962e099d
2016-07-31fftester: another table manager stack checksCaolán McNamara
and a m_xTextFactory check too Change-Id: I9352410c42048b4dd7d6dbc3514351ab8f16790b
2016-07-30fftester: context stack checkCaolán McNamara
Change-Id: I4a135a9f9ac2f16f9dab096f5c234ff1d6e5e853
2016-07-29fftester: some more table manager stack checksCaolán McNamara
Change-Id: Ic8dd72da175fee656889910b55d31ea161b944cc
2016-07-29fftester: another empty table manager stackCaolán McNamara
Change-Id: If3148cb6e16cff4aad28c4f86467c66ed04bcd05
2016-07-29fftester: another null DestinationTextCaolán McNamara
Change-Id: I84bf3788ac092c491d7c5a9f86421f1cf9f3e814
2016-07-29fftester: null DestinationTextCaolán McNamara
Change-Id: Icdd71733c4e9f4b36e6e957e4dea772087890faa
2016-07-28fftester: throw on empty stack accessCaolán McNamara
rather than spend the rest of my life protecting each one Change-Id: I181df33b052a0303f072ce0252d98562231569e2
2016-07-28fftester: empty states stackCaolán McNamara
Change-Id: I05dfffced9a8677650a46b43f65a29e9b21c5524
2016-07-28fftester: empty table manager stackCaolán McNamara
Change-Id: Ia7f7ace8130d5dfe290207e0cd3d2e6a43b8ab46
2016-03-11writerfilter: avoid ugly cross-directory includeMiklos Vajna
Change-Id: I16db4e16e5c2fa3aa3bfb22f83d2c36695499b5c
2016-03-10Extract Directories from BootstrapFixtureBaseStephan Bergmann
(as some tests derive from the latter only for the Directories part, not for the setUp/tearDown overrides: those tests will be cleaned up next) Change-Id: Ib6b78eea868b8bc21d4cc6e8fd9e1d025deca05f Reviewed-on: https://gerrit.libreoffice.org/23078 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-08tdf#97703 Removed empty setUp/tearDown methodsChirag Manwani
Change-Id: Ia62de30ae94bdae87cd5109c44eab40af4d020e5 Reviewed-on: https://gerrit.libreoffice.org/22985 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-07improve defaultparams lopluginNoel Grandin
to catch calling params with defaults like "= OUSString()" Change-Id: Iad060e318ed492c22f8be44e326174fe6d28fff9 Reviewed-on: https://gerrit.libreoffice.org/22932 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-31boost::tuple -> std::tupleCaolán McNamara
Change-Id: Ia08c184b792ff73d3ed49d6a5d54dec1a35943e9 Reviewed-on: https://gerrit.libreoffice.org/21955 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-12-08writerfilter: loplugin:stringconstantMiklos Vajna
Change-Id: Idb0865f4d0db6c4eda33810ab2ef4cff49bc85d1
2015-12-08tdf#54584: adjust skip-slash condition, allow unterminated quoteMike Kaganski
Experimenting with different non-alpha characters in front of field, most of them aren't allowed and result in field not recognized by MS Word: #$%&'()*+,-./:;<>?@[]^_`{|}~ Besides, if backslash "\" is followed by another backslash or space, it is illegal, too. This patch takes care of it. On the other side, not closing quotes is allowed by MS Word. This patch allows this, too. The patch does not handle another allowed field code "=2+2". This should be done in another commit. Change-Id: I842fe59c026b68977e61a7ae0b5495c02803ad83 Reviewed-on: https://gerrit.libreoffice.org/20435 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-11-05use uno::Reference::set method instead of assignmentNoel Grandin
Change-Id: I31a69a997098eb1807361b8049c3312a4f287d75
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-05-26need DISABLE_CVE_TESTS for these tests under windows tooCaolán McNamara
Change-Id: I92de8fa6a48dac9a0a09e6ebda4af9b8e4c3a1d7