summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
2017-03-19fix typo/grammar: "the the" --> thedennisroczek
* also removing pointless ASCII art (tdf#62475) * truncate ending whitespace in Doxyfile Change-Id: I59b012f41ac0d170216229da85a49aa41689dee5 Reviewed-on: https://gerrit.libreoffice.org/35151 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-17cleanup double includes and declarationsJochen Nitschke
Change-Id: I770e09f48b1a3e8299f59a8e475ba3c18d436d7b Reviewed-on: https://gerrit.libreoffice.org/35312 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-03-17convert SvxBorderStyle to scoped enumNoel Grandin
and rename to SvxBorderLineStyle Change-Id: I19e530f162e4ca6290a0ad076e7fe3d5775ae6bc Reviewed-on: https://gerrit.libreoffice.org/35265 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-14tdf#105729 RTF import: \ltrpar should not override \qc from styleMiklos Vajna
This is similar to commit 92fd894ea18672cba4cf961bdc4c0bc98f168102 (tdf#94435 RTF import: \ltrpar should not override \qc, 2015-10-05), except that here the \qc is inherited from the style, it's not a direct formatting. The problematic code was added in commit 2638faa2e834c2da4c195224fd88d32c29b3d0cc (writerfilter08ooo330: applied patch for writerfilter08, 2010-07-28), and it's not really clear to me what is its purpose, given that the DOC import equivalent in SwWW8ImplReader::Read_ParaBiDi() doesn't set the paragraph alignment. Fix the situation by not touching the paragraph alignment for the RTF case at least. Change-Id: I2baa2c8c8012d972740da7cf3f710117812859b3 Reviewed-on: https://gerrit.libreoffice.org/35163 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-13tdf#103931 writerfilter breaktype: same for implicit and explicitJustin Luth
MSWord normally does NOT specify "nextPage" for the sectionBreak, since that is the default type. That is imported as BreakType == -1. However, Writer ALWAYS exports the section type name, which of course is imported explicitly. **There is an import hack that treats the very first -1 section as continuous IF there are columns**. Since Writer explicitly defines the section type, these documents import differently. When Writer round-trips these types of files, they get totally messed up in Writer, although they look fine in Word. So, treat both implicit and explicit nextPage identically for bTreatAsContinuous during import. Another unit test demonstrated that headers/footers are lost when treating as continuous, so preventing that situation now also. This fix allows several import-only unit tests to round-trip. Change-Id: I37fa861d82e8da564d28d8e9089fe0f2777650fb Reviewed-on: https://gerrit.libreoffice.org/35013 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-03-11Fix typosAndrea Gelmini
Change-Id: I2be7113bfe86476acfd6550f1eed53eed83c9747 Reviewed-on: https://gerrit.libreoffice.org/35063 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-07loplugin:loopvartoosmallStephan Bergmann
Change-Id: I089affb48717d64846064b61344820f1b87ac317
2017-03-07tdf#104287 RTF import: handle bitmap shapes inside tablesMiklos Vajna
Regression from commit 015fd55c94b7b650ed8e572cafaf3b0f903b01b9 (tdf#96275 RTF import: fix anchor of shapes inside tables, 2016-05-10), the problem was that since shapes inside tables are now buffered, some previously hidden problems in the buffering became visible. For one, there was no code to make sure that a bitmap shape is not appended at the end of the buffer again when it gets re-played. For another, only the bitmap shape itself was buffered, not its size. Change-Id: I04d65eb794ff6b160ef77af85479ba25ea5f8aa7 Reviewed-on: https://gerrit.libreoffice.org/34940 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-03Remove redundant 'inline' keywordStephan Bergmann
...from function definitions occurring within class definitions. Done with a rewriting Clang plugin (to be pushed later). Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8 Reviewed-on: https://gerrit.libreoffice.org/34874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02Fix typosAndrea Gelmini
Change-Id: Ibc81246e615d7c68c93e01b84584e78a79bece16 Reviewed-on: https://gerrit.libreoffice.org/34779 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-03-02xmlsecurity: avoid using the SerialNumberAdapter wrapperMiklos Vajna
This service is only used in xmlsecurity and it's a wrapper around two free functions in the same module. Change-Id: Ibc5a026b51eda6c2b4b27b7254dedc220dbf909a Reviewed-on: https://gerrit.libreoffice.org/34772 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-01writerfilter: avoid repeating the return type from the declarationMiklos Vajna
Change-Id: I4fb7993482e71c936d820b559aa6b4a212c8175d Reviewed-on: https://gerrit.libreoffice.org/34729 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-02-28new loplugin unoanyNoel Grandin
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89 Reviewed-on: https://gerrit.libreoffice.org/34714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-28tdf#103931 DOCX import: fix lost section breakMiklos Vajna
When there are multiple sections in a document, every <w:p> element triggers a handleLastParagraphInSection() call, and that's how the previous section is ended and the next one is started if necessary. In case the section contains no paragraphs at all, the section was lost on import. Fix this by also calling handleLastParagraphInSection() on <w:sectPr> as well. It's not a problem if there are both <w:p> and <w:sectPr> in a section (which is the usual situation) as only the first call closes the previous section / starts the next one. Change-Id: I64f2c403dcb2ceca76d444ab06df3052235d2795 Reviewed-on: https://gerrit.libreoffice.org/34715 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-02-25re org things a little to quieten coverity warningsCaolán McNamara
Change-Id: I97d1e5cce279031cb1d855132cc6695fc4b59c93
2017-02-24vcl PDF import: there is no PNG encoding hereMiklos Vajna
It was a copy&paste error from xmlsecurity/workben/pdfverify.cxx, which does PNG encoding. Change-Id: I7b5108a7cddffdc859276b656a6e1168f23d3863
2017-02-24tdf#105490: writerfilter exception - ULSpace must be >= 0Justin Luth
Instead of a minimal margin, default margins were being applied because an exception was thrown when trying to set a negative value to top and bottom margins in SvxULSpaceItem::PutValue Change-Id: I0a9fc2c7cb996efbd26abfdbed27ea0bcb86d9a5 Reviewed-on: https://gerrit.libreoffice.org/34598 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2017-02-23writerfilter: RTF import: hex-escaped \r and \n create paragraph breakMichael Stahl
... in Word 2010, while the spec doesn't say what they do. So just handle \'0d and \'0a like \par. This fixes an assert failure on importing lp556169-2.rtf, where insertTextPortion was called with a string containing "\r", which split the paragraph and that messed up the SwPaM. Change-Id: Iee8b5b47e15d18232de841adfbc9c6498727c384
2017-02-21tdf#104081 RTF import: handle \htmautspMiklos Vajna
It's the opposite of OOXML's <w:doNotUseHTMLParagraphAutoSpacing/>, so the default is different. Also adapt the fdo82006 bugdoc where the original bugdoc contained this flag, but the testcase did not. Change-Id: I2fd757a8f95be9b1bee63570c9f587c17d3b22bc Reviewed-on: https://gerrit.libreoffice.org/34507 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-02-20remove some unused enumeratorsNoel Grandin
Change-Id: Idb9080f9c2edd838385d78b64e61ab49e93fe54b Reviewed-on: https://gerrit.libreoffice.org/34373 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-17tdf#106001: Treat CharScaleWidth outliers as 100 in DOCX importAron Budea
Spec limit is [1..600], sometimes documents contain 0, which, similar to other values outside the limit should be treated as 100. Change-Id: I04aec25b638762392de3f9881cd72588f2753e71 Reviewed-on: https://gerrit.libreoffice.org/34341 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-02-15writerfilter: can use std::move() hereMiklos Vajna
Change-Id: I48980ae44cd68b9526d915f877a37f6a559910e5
2017-02-14RTF import: handle target of hyperlinkMiklos Vajna
lcov pointed out that there is no testcase for the export of this, and turns out the import part wasn't implemented. As a side effect this implements the same for DOCX import as well. Change-Id: I016ebc100ec3856bf3a43aea8ea55af72c2ead1e
2017-02-09tdf#105852: don't merge cells if there were no merge continuationMike Kaganski
In RTF, it's possible to start a cells merge using \clmgf, and simply omit following cells in the row - they must merge automatically. This makes HorizontallyMergedCell::m_nLastCol/Row uninitialized. Previously, the uninitialized values arrived as 0,0 - thus the first range's cell got merged with cell 0,0. This change prevents the merge; in scenario above, absence of additional cells in row will create merged cell automatically. Change-Id: I68b84b7ec70d9512c541a077689369fa4a8dc0c5 Reviewed-on: https://gerrit.libreoffice.org/34079 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-02-08loplugin:unusedenumconstants read-only constants in writerfilterNoel Grandin
Change-Id: I3cc0d696059b130a8f1f1d8d3b1908d2e84d1a75 Reviewed-on: https://gerrit.libreoffice.org/34017 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06tdf#101626: replace soft-hyphen by hard-hyphen in ooxml importPatrick J
If a list bulletChar is a soft-hyphen, it will disappear in PDF export. Therefore, replace it by a hard-hyphen. Change-Id: If0b535e7d2e23454136f25a2b7acf4b294b8dd27 Reviewed-on: https://gerrit.libreoffice.org/33707 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-02-06Add missing #includesStephan Bergmann
...and remove some unncessary using directives/declarations, in preparation of removing now-unnecessary #includes from cppumaker-generated files, post e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception specifications". Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-06writerfilter: convert ResourceType to scoped enumNoel Grandin
and drop unused constant StreamProperties Change-Id: I6a358cf7914412231d6c8f926a0d2fbd4bb8009b Reviewed-on: https://gerrit.libreoffice.org/33885 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02writerfilter: remove gperf related declarationsMichael Stahl
Reportedly gperf 3.1 changes the signature of in_word_set(), where the len parameter changes from unsigned int to size_t. It turns out the only forward declaration for this function is currently unused, so just remove it. Change-Id: Ifbc582cd31ca37fff9ff95a3706ee902ecfe5223
2017-01-31tdf#103976 DOCX import: disable incomplete w:before/afterLines style handlingMiklos Vajna
Regression from commit 9e7eb63989ef1cf4b9a0e0404b84ef890db3d8e3 (DOCX import: parse <w:spacing>'s w:before/afterLines attribute, 2014-10-17), the problem is that OOXML has 3 different attributes for the paragraph bottom margin (and other 3 for the top one), while in Writer we just have a top margin. Now the import filter tries to work out which one of these should have priority and ignore the rest, but this is way more complicated when style inheritance has to be taken into account as well. To avoid the regression just restrict w:before/afterLines handling for the case when it's used as direct formatting, that's why this was introduced after all. Change-Id: Ie8642c7a9771596def6b8899e098b26c4f8be0b4 Reviewed-on: https://gerrit.libreoffice.org/33738 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-01-30Indentation fixesMiklos Vajna
Change-Id: I22247da71d1594187c531ca5552cf75363aaddfd
2017-01-27loplugin: unnecessary destructor writerfilter..xmloffNoel Grandin
Change-Id: I511822dc874101ed3b9850b015b746a86d26c3b5 Reviewed-on: https://gerrit.libreoffice.org/33578 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26Remove dynamic exception specificationsStephan Bergmann
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-25sw: various small cleanupsMiklos Vajna
Change-Id: I1eb56649fb9913cb32397c1ef49634a0d202f1a1
2017-01-25tdf#105511: use LO language settings to set default RTF languageMike Kaganski
... when file containd ansicpg0/cpg0 This allows user to change this setting and get proper document language. Similar technique is used currently for DXF and WMF. Change-Id: I884a973d98384c92d45a1d2e19720ffe3e6aa20d Reviewed-on: https://gerrit.libreoffice.org/33505 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-01-24Drop incorrect "artistic" prefix from some token namesTor Lillqvist
Apparently copy/paste mistakes in the 642a252cf1a2f1d08c4bbfcae15527bb82c7664d and 21d4cfe19e2796ebf89c408e292c4473924b2bc4 commits from 2014; most of the picture effect type tokens added in that commit do have names that start with "artistic" but not all. Does not break any unit test. (Does not fix the bug I am investigating either, though.) Change-Id: I2c3bb7243e1feaa3fa949b58d3acf34825d6987b
2017-01-20tdf#48658 writerfilter: only set THROUGH wraps as transparentJustin Luth
commit 15c3a08b8b1e8060f9659c7bc98480a39d1802c5 set transparency before the wrap type was known (which is good in case wrap type is never defined, and the default wrap type IS through, so that fits) but transparency was never re-evaluated once the wrap type was known. In MSWord, the header is at a lower zOrder than the body, so objects that are OVER the header text are still UNDER the body text. Writer emulates this by insisting that ALL through-wrapped header objects are UNDER the header text. (This ought to only apply to objects that spill into the body text area, but that’s pretty hard to calculate, so transparency was applied to any object anchored in the header.) Change-Id: Ie3916c6b7f3fa80caf5994fd910ba4d4d89ec702 Reviewed-on: https://gerrit.libreoffice.org/33152 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-01-19New loplugin:dynexcspec: Add @throws documentation, writerfilterStephan Bergmann
Change-Id: I7e84da00d943d2849e6d94011f349d064fb658cb
2017-01-19tdf#104718: Prompt user to continue on SAXExceptionMike Kaganski
Change-Id: Ib0f9a89c670f8d513ebee206a6a1487802f901ff Reviewed-on: https://gerrit.libreoffice.org/33181 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-01-18tdf#99074 sw: remove duplicate property "IsBrowseMode" againMichael Stahl
Commit e0f9bb795251d950b5dd960fcd030170c8eb67aa added the property "IsBrowseMode" to SwXDocumentSettings, but it is already available in the API as SwXViewSettings property "ShowOnlineLayout". The problem is that both of these properties get exported in ODF into settings.xml, so it contains "IsBrowseMode" twice. Unfortunately the SwXViewSettings are not available in writerfilter, because the XModel::getCurrentController() is null, the view is created after the import. But there is already a way to store ViewData in the SfxBaseModel, which is then used by SfxBaseController::ConnectSfxFrame_Impl() when creating the view. This applies the property at just the right time. Change-Id: I842845d09a7b3fe81e27a1ed8ac8a8594da7f4e8
2017-01-18writerfilter: clean up remaining redundant initializers in RTF importMiklos Vajna
Change-Id: Ic01f496b45a68ae35627bfbfb18f5aaf0b2b783d Reviewed-on: https://gerrit.libreoffice.org/33253 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-01-18tdf#104181: don't throw on XRelationshipAccess queryMike Kaganski
The queries are followed by conditional blocks; so throwing is unnecessary and erroneous (breaks parser internal state). Change-Id: I49917a85e34866a326b4a2edd30e76f130b8ee27 Reviewed-on: https://gerrit.libreoffice.org/33244 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-01-17tdf#104150 DOCX import: handle <w:displayBackgroundShape/>Miklos Vajna
Regression from commit 992da0d5cf04497bad55637f6a6ebfcdaec03e16 (bnc#817956 DOCX import of document background color, 2013-05-27), <w:background> should be ignored when <w:displayBackgroundShape/> is missing from settings.xml, it turns out. This also requires generating the ooxml:CT_Settings_displayBackgroundShape token from the RTF tokenizer. Change-Id: I6d7986904cedb952998a87e7648919ae34adc360 Reviewed-on: https://gerrit.libreoffice.org/33207 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-01-17Resolves: tdf#103063 don't crash on importing this fileCaolán McNamara
doesn't go on to successfully open the docx, but it doesn't crash Change-Id: Ie37c115f81908695142849bd366583a5692ea806
2017-01-09New loplugin:externvar: writerfilterStephan Bergmann
Change-Id: I988555d9ccf9a7245d49cb2e05a84878978eebd6
2017-01-06tdf#105143 DOCX import: enable DoNotCaptureDrawObjsOnPage layout compat optionMiklos Vajna
Because that's what Word does to show only part of the shape in the bugdoc. Change-Id: Ic5cb84cace9237671d71eda0c64e9dadfe244cb9 Reviewed-on: https://gerrit.libreoffice.org/32782 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-01-04tdf#104085 Replace number format code literal with ooxml enumeration.Mark Hung
Liberals of Number format code (NFC) were no longer recognized by dmapper after it had been removed in d30a8ec448bcd08c6a52a37d6ae41a4b71c235da. Replace them with enumeration. Change-Id: I3ed1e09d9f3987fce95bd708b9c0b0568d3f15f9 Reviewed-on: https://gerrit.libreoffice.org/32527 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2017-01-04writerfilter: various small cleanups in rtfdocumentimplMiklos Vajna
Change-Id: If6ed5c12c100af6e37c83e177891f3c5c17c3aad Reviewed-on: https://gerrit.libreoffice.org/32720 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-01-04tdf#99616 writerfilter: hideMark shouldn't force min sizeJustin Luth
hideMark in Word does not force the minimum possible row size, but simply ignores any cell marker styles/sizings. So an empty row then takes on the "at least" size defined for the row. Change-Id: Id24a52f2a360a5040c2eed5c17757c0d32d03520 Reviewed-on: https://gerrit.libreoffice.org/32380 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-01-03tdf#104744 RTF import: fix unexpected zero para left margin wrt style dedupMiklos Vajna
See commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17) for the details on style override in RTF. Here the problem was that we added an unneeded "reset to 0" property, the opposite situation that commit 657c6cc3acec0528209a8584b838cd6de581c437 (tdf#104228 RTF import: fix override of style left/right para margin, 2016-12-13) was fixing (there a "reset to 0" was missing). Change-Id: I37f079b9cb4773214d2531c2e34920b3b8927211