summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2019-06-18loplugin:logexceptionnicely in writerfilterNoel Grandin12-68/+69
Change-Id: Ie01d0e6af6af0cfeb46cdde38f52ab068b64db6b Reviewed-on: https://gerrit.libreoffice.org/74284 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-13Simplify Sequence iterations in writerfilter, writerperfect, xmlhelpArkadiy Illarionov9-159/+112
Use range-based loops or replace with comphelper or STL functions Change-Id: I9113e04d15ad84d0abac087afc627969e8ebc354 Reviewed-on: https://gerrit.libreoffice.org/73867 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-13tdf#89991 DOCX: import Show changes from older formatsLászló Németh1-2/+10
w:formatting is optional, w:markup can be instead of w:insDel, too. Change-Id: Ic689499a880dcc7c97497e4381dff31610f745bf Reviewed-on: https://gerrit.libreoffice.org/73943 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-06-12tdf#89991 DOCX: import/export Show changes modeLászló Németh1-0/+17
handled by the optional w:revisionView OOXML setting. Using disabled Show Changes mode, exported DOCX contains <w:revisionView w:insDel="0" w:formatting="0"/> as the documents exported from MSO with disabled Show Changes and disabled Options -> Trust Center -> Trust Center Settings -> Privacy Options -> Make hidden markup visible when opening or saving (Note: this last setting needs also for opening the documents really with disabled Show Changes in MSO). Change-Id: I9f2c7df572f33838ae63185de21431102a7e139e Reviewed-on: https://gerrit.libreoffice.org/73885 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2019-06-12Comment correctionMike Kaganski1-2/+2
Writer does support collecting and restarting comments at end of section Change-Id: I472e6cc228c27ecbc9ed59b47eeaaad89e145628 Reviewed-on: https://gerrit.libreoffice.org/73858 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-12sw: merge some indentical switch-case branchesMiklos Vajna2-6/+0
Change-Id: I9c247f6d5b3d1309b6831a87c041de0a9cf6affc Reviewed-on: https://gerrit.libreoffice.org/73840 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-08loplugin:unusedmethodsNoel Grandin2-7/+0
Change-Id: I52efd8d843d0e4cc7a6adefb0eb95aa50469af38 Reviewed-on: https://gerrit.libreoffice.org/73693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-06tdf#125719 sw: rtf: refactor associated character propertiesSerge Krot4-48/+106
1. \rtlch, \ltrch should be placed before their properties. 2. Do not mix associated and normal character properties in output. 3. Do not output empty "\rtlch \ltrch", "\ltrch \rtlch" pairs. 4. Handle associated character properties runs instead of handling separately their parts without order of them. Change-Id: Ibbf7365d04708682a5f1eb664a579c60a47465d2 Reviewed-on: https://gerrit.libreoffice.org/72578 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-06-04tdf#70234 DOCX: import tracked deletion of fieldsLászló Németh1-0/+1
Deleted fields in tracked changes, for example page number fields, imported as not deleted text fields. Change-Id: Id35c3ad7d293039fc8a2d0b564572dc459a25d0f Reviewed-on: https://gerrit.libreoffice.org/73397 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-06-03tdf#120412 char formatting UI: clean-up DFLT_ESC_AUTOLászló Németh1-3/+13
Default auto values must be outside of the new enlarged range of the superscript/subscript percent values. Note: the raising limit was modified to 13999 from 14400, because the RTF unit test tdf112208_hangingIndent.rtf lost its hanging from the bigger value. Change-Id: I3a7e9715a27570278ee4ee70f9fc9ad29457e100 Reviewed-on: https://gerrit.libreoffice.org/73166 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-05-29tdf#120412 DOCX filter: fix missing superscriptJozsef Szakacs1-0/+2
by editeng support of large superscript raising. Maximal raising of superscript text is 1584 pt in MSO, while LibreOffice didn't import the values greater than 100% of the current font height. Using the maximal percent value of the default 11 pt font, the limit is 14400% now, fixing most of the import problems. Greater raisings will be limited to 14400% during the DOCX import. Note: the standard doesn't limit the bigger percent values, see "20.374 style:text-position" and "18.3.23 percent" in OpenDocument 1.2. Change-Id: I3d0d08f273f2067180f74fba40c47d62364fcc59 Reviewed-on: https://gerrit.libreoffice.org/69164 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-05-29writerfilter: various small cleanupsMiklos Vajna3-16/+26
Some parameters were passed by value for no reason, it's always a good idea to declare a variable at the point where we can also initialize it, etc. Change-Id: Ia07bbef7826132fa0326445b89fcaf48dd38b11b Reviewed-on: https://gerrit.libreoffice.org/73125 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-27tdf#115557 DOCX import: don't multiply charts in footnotesLászló Németh1-9/+14
A chart in a footnote was appeared in every footnotes, resulting fatal problems during a few import/export cycles, see tdf#115558 (MSO is unable to open the DOCX export with multiplied objects). Change-Id: Ib729e4442ed3c92e4646fa7cdf7253a963d883e8 Reviewed-on: https://gerrit.libreoffice.org/73025 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-05-24forgot to update commentNoel Grandin1-1/+1
in commit d6865e5cec34f5f521e0f9ec4ef3c7ad04503cfe Date: Fri May 24 11:52:30 2019 +0200 use std::unordered_map in RTFTokenizer Change-Id: I5197eae86c4611d1598dbb60bae4962ad0576ecd Reviewed-on: https://gerrit.libreoffice.org/72906 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-24use std::unordered_map in RTFTokenizerNoel Grandin2-20/+20
to speed up make sw.check Using a --enable-dbgutil --enable-optimised build, this takes my runtime from 6m03 to 3m43 Change-Id: I79d2345c361d99d4a1c4402a4b7008bbb59b8184 Reviewed-on: https://gerrit.libreoffice.org/72902 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins
2019-05-22tdf#121784 DOCX import: fix change tracking of footnotesLászló Németh1-1/+4
and endnotes by creating redline data for their anchors, too. Now footnote/endnote insertions are visible, and it's possible to reject them. Change-Id: I5cd3300c0d423b8c6803b7aeb848dcc103c3b565 Reviewed-on: https://gerrit.libreoffice.org/72680 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-05-20writerfilter: make RTFParserState members private, final partMiklos Vajna4-16/+19
Change-Id: I14e5bb0df50647801bf6c322132a76037185cada Reviewed-on: https://gerrit.libreoffice.org/72564 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 10Miklos Vajna6-196/+207
Change-Id: Id4445fc8fa1d81f052fd26ea85b661e44fd83be0 Reviewed-on: https://gerrit.libreoffice.org/72563 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 9Miklos Vajna6-133/+143
Change-Id: Ia9f2508b3e9d5087cb4cfe0724b90b220d3a3550 Reviewed-on: https://gerrit.libreoffice.org/72562 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 8Miklos Vajna6-107/+120
Change-Id: I1e53b4282daa7ca1a5da4a8cec67a30516449b60 Reviewed-on: https://gerrit.libreoffice.org/72561 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 7Miklos Vajna6-141/+172
Change-Id: I8740a47e86b66a0792b34c8cb5078310afe46bfa Reviewed-on: https://gerrit.libreoffice.org/72560 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 6Miklos Vajna6-85/+106
Change-Id: I4a2c89afc38f9df8a956a2fb38a1dc1ea73aea18 Reviewed-on: https://gerrit.libreoffice.org/72559 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 5Miklos Vajna5-105/+112
Change-Id: Iecab0f89283d182eb51329bb8e8281bedd57950c Reviewed-on: https://gerrit.libreoffice.org/72558 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 4Miklos Vajna5-148/+159
Change-Id: I53a3c2fa2f21b94a6ed5de9a136a8722e066b045 Reviewed-on: https://gerrit.libreoffice.org/72557 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 3Miklos Vajna5-66/+108
Change-Id: I823122d89f674539d6aa54ffd48b406d199677d2 Reviewed-on: https://gerrit.libreoffice.org/72556 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 2Miklos Vajna5-87/+120
Change-Id: I9d712b227ea39bd63c34e77572f7e3d5ff83aa7e Reviewed-on: https://gerrit.libreoffice.org/72555 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-20writerfilter: make RTFParserState members private, part 1Miklos Vajna6-122/+155
Change-Id: Iae4d454e0b160ee7f5b39d252505748c693a9c9e Reviewed-on: https://gerrit.libreoffice.org/72554 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin3-3/+3
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-12regenerate PCH headersLuboš Luňák1-1/+2
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-10an uno -> a unoCaolán McNamara1-1/+1
Change-Id: I538db88f8477dd2d2ad25c372928fec6c11d979d Reviewed-on: https://gerrit.libreoffice.org/72105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák1-10/+18
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-07tdf#124594 DOCX filter: don't extend margins from effects for rotated shapesMiklos Vajna1-4/+28
Regression from commit a5a836d8c43dc9cebbbf8af39bf0142de603a7c6 (DOCX filter: effect extent should be part of the margin, 2014-12-04), the problem was that extending margins as-is based on the effect extent values only work correctly in case of non-rotated shapes. For example, with 90 degree clockwise rotation the top effect extent should extend the right margin, etc. Fix the bug by limiting this extension to the non-rotated scenario. Test the behavior at a layout level, so in case later the effect extent feature is implemented, it won't be necessary to adjust the test. Change-Id: I97271bbb7c079951980b436cb8d8e5e54eeead55 Reviewed-on: https://gerrit.libreoffice.org/71878 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-02Use hasElements to check Sequence emptiness in [v-x]*Arkadiy Illarionov3-4/+4
Similar to clang-tidy readability-container-size-empty Change-Id: I71e7af4ac3043d8d40922e99f8a4798f0993294c Reviewed-on: https://gerrit.libreoffice.org/71603 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-30tdf#123636 writerfilter: handle deferred breaks on framesJustin Luth1-0/+16
...similar to handling breaks before shapes in lcl_startShape. Three different examples found to create/split a paragraph. Which one to use? (addDummy, m_bIsSplitPara, and lcl_startCharacterGroup). SplitPara is not good because the paragraph properties probably should not be copied to the dummy paragraph (like numbering for example). Slightly modified the lcl_startChar example to ensure that the dummy paragraph doesn't steal a part of the properties, but is only default properties plus page-break. This doesn't export very well, so roundtripping is very poor. Research Note: There exists a compat flag showBreaksInFrames (Display Page/Column Breaks Present in Frames) "This element specifies whether applications should honor the presence of page and/or column breaks which are present within the contents of paragraphs which have been defined as frames using the framePr element." --Currently, LO does nothing with this flag. Probably too exotic and irrelevant (word 2003 era?). No existing unit tests found that have isSet(pg_brk) frames. Change-Id: I29f815355401c7af8b347a3ed9d0298bc9b27b93 Reviewed-on: https://gerrit.libreoffice.org/71255 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-30improve loplugin:stringconstantNoel Grandin1-1/+1
to find more places we can elide the OUString() constructor at call sites Change-Id: Ie09f3c61f2c4b4959c97dc98ebcbaf7c51d5d713 Reviewed-on: https://gerrit.libreoffice.org/71514 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-29tdf#123460 DOCX track changes: moveFrom completelyLászló Németh2-1/+20
also with the paragraph mark, not leaving an empty paragraph at the original place of the moved text. Note: as desktop version of MSO does, but its online version leaves empty paragraphs interestingly. Change-Id: I03dda8997df3efbc82e936bd31a3813323e6b5ab Reviewed-on: https://gerrit.libreoffice.org/71382 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2019-04-26tdf#67207 DOCX mail merge: fix export/import of database fieldsLászló Németh5-2/+65
to support the registered databases (containing ODS, XLSX sheet or ODT text table data sources). Now database fields don't lose their database connection, and File->Print can merge mails after DOCX export/import, if the LO instance has got a registered database with the same name and table, as in saved in w:settings/w:mailMerge/w:query element of the DOCX document in the form of SELECT * FROM [databaseName].dbo.[tableName]$ query. Notes: – This fix supports only single table usage. – The exported DOCX document is editable in MSO, too, without losing the database connection in LO later. Change-Id: I97826b7ee7defd0243dbaffa0325c5b11dd2c0d1 Reviewed-on: https://gerrit.libreoffice.org/71228 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-04-25related tdf#123636 writerfilter: split newline also if PAGE_BREAKJustin Luth1-0/+7
...but only with old MSWord compat flag SplitPgBreakAndParaMark. All of the other cases (COLUMN_BREAK and non-empty runs) split the paragraph, so why not here? This document shows it is needed, but only for SplitPgBreakAndParaMark documents. Note: Word 2003 doesn't display "modern" docx well in this regard. It adds extra paragraphs where it shouldn't. There are already example unit tests that ensure that extra paragraphs aren't written for SplitPgBreakAndParaMark == false. The actual bug's document is not related to the compatibility flag. That will be handled in separate commit. Change-Id: I27399780c909663f9a2b21974a5b385bea67f9ec Reviewed-on: https://gerrit.libreoffice.org/70835 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2019-04-15loplugin:sequentialassign in writerfilter..xmlsecurityNoel Grandin3-9/+5
Change-Id: I41028c704eca08b71746c3c87e38926b95449775 Reviewed-on: https://gerrit.libreoffice.org/70735 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-15improve loplugin simplifyconstructNoel Grandin1-4/+1
to find stuff like OUString s = OUString("xxx") Change-Id: Ie7ed074c1ae012734c67a2a89c564c1900a4ab04 Reviewed-on: https://gerrit.libreoffice.org/70697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-14tdf#124670: xml:space attribute may be specified for w:document top-level ↵Mike Kaganski2-29/+17
element Treat xml:space specially in OOXMLFastContextHandler::startFastElement, to allow this attribute to be handled for any element. Change-Id: I81bd1e0642940ffdfc03d6c65d0ce9f421206c5e Reviewed-on: https://gerrit.libreoffice.org/70723 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-13tdf#124637 writerfilter: partially revert import section marginsJustin Luth1-16/+2
...from LO6.3 commit 8d4a7b17e60aa889d1a78da47630aae2d1c1513c Footnotes and Endnotes are also considered sections, and those sections are messing up tracking which page style is in effect. Simply reverting since any fix will still be based on page style assumptions and require losts of testing. The original commit didn't fix any reported bug anyway. Change-Id: I3597d511d9755f48e7ac2ae9cfb2f8ff63c74d17 Reviewed-on: https://gerrit.libreoffice.org/70702 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2019-04-12tdf#124344 sw btlr writing mode, DOCX import: fix vertical alignmentMiklos Vajna4-26/+0
The hack added in commit 3325e0f206ce864730468c3556ce06760042c157 (bnc#865381 DOCX import: handle w:jc=center inside w:textDirection=btLr, 2014-07-02) is no longer needed, actually just reverting it fixes the problem, as then layout does the right thing. No need to center paragraph adjustment to any kind of vertical orientation, now that we have proper layout support. Change-Id: I6aa74f5289a014c148fbd7c7ab03ec885d931daf Reviewed-on: https://gerrit.libreoffice.org/70610 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-10writerfilter: implement RTF derived styles defaultingMichael Stahl4-6/+74
It turns out that the situation fixed in commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 also applies to the definition of the styles themselves. To implement the same style import as Word, the style definitions need to be stored twice: once as read from the file, and another time with attributes defaulted and deduplicated vs. the parent style; the second representation is then sent to the domain mapper. To make this easier, add a bool parameter to cloneAndDeduplicate() to disable the implicit pPr dereferencing that happens when creating the hard formatted paragraph properties (this could potentially be cleaned up further if those paragraph properties would use pPr wrapper themselves). Also implement defaulting of line spacing in getDefaultSPRM(). Change-Id: I4810e917697b3af244e5dbdd7f5a45b4767c93fc Reviewed-on: https://gerrit.libreoffice.org/70320 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-01tdf#42949 Fix IWYU warnings in include/sfx2/[sS]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I4a3baffa8944b522b16b50975185759081662020 Reviewed-on: https://gerrit.libreoffice.org/69945 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-29tdf#124384 sw DOCX: fix crash during bibliography loadingSerge Krot1-1/+1
Change-Id: Ic0c4b6f7480a4c6c3f53bd04e285cb0cab172531 Reviewed-on: https://gerrit.libreoffice.org/69888 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-03-28tdf#121456 sw: DOCX: fix loading of empty TOC titleSerge Krot1-0/+3
Change-Id: Ib241edd07e4c6781d80db274f73146bda310d8c0 Reviewed-on: https://gerrit.libreoffice.org/69827 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-03-25tdf#42949 Fix IWYU warnings in include/sfx2/[a-D]*Gabor Kelemen1-0/+2
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I444cb71bc3d045072a4b1f9eed279ed7e425a0d4 Reviewed-on: https://gerrit.libreoffice.org/69481 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-25We can simply use DBG_UTIL now after efc29fbb6d458f5fd3660a36e2ff1592608fcbacTor Lillqvist38-225/+219
Change-Id: I74cce2d3fb4661ea9a44d0b166ca98dfade53056 Reviewed-on: https://gerrit.libreoffice.org/69604 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-25new loplugin:unoqueryNoel Grandin2-4/+4
look for places we are doing code like: Reference<XProperty>(model, css::uno::UNO_QUERY)->getAsProperty() which might result in a SIGSEGV is the query fails Change-Id: I5cbdbc9e64bd0bed588297c512bf60cbacb9442e Reviewed-on: https://gerrit.libreoffice.org/69044 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>