summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2017-05-10tdf#104407 writerfilter: fix crash with null xRangePropertiesMichael Stahl1-5/+7
The m_xStartingRange is null at this point for whatever reason, and the block immediately above this one already checks xRangeProperties, so let's just do the same here. (Also IsNewDoc(), where the logic between PageDescName and PageNumberOffset presumably shouldn't differ?). (started to crash with abaf6bde4ee91c628bd55a7ec2e876a5d0ecff6e as previously that code was unreachable in RTF import) Change-Id: I20539c3a753ecea357e556ea556c3c26983ce1d1 (cherry picked from commit e4da2e5dfa9e462e0d9c23a1a60caf4b3ef2dc56) Reviewed-on: https://gerrit.libreoffice.org/37305 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 8521f4c8fb08aa37912f73a73ba1a34c2ccc97ed)
2017-05-10AutoText: add only real AutoText entriesSzymon Kłos5-11/+35
* add only autoTxT gallery type * new test with other types of entries Change-Id: Ibf7751c73dcf3b6ebd69eec5f4931dbeaaf098c8 Reviewed-on: https://gerrit.libreoffice.org/37425 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit a470d16208a78ae6893d199b3b6bc77a8559b06a) Reviewed-on: https://gerrit.libreoffice.org/37460
2017-05-07tdf#107033 DOCX import: fix unexpected missing footnote separatorMiklos Vajna3-4/+21
Regression from commit 330b860205c7ba69dd6603f65324d0f89ad9cd5f (fdo#68787 DOCX import: handle when w:separator is missing for footnotes, 2013-09-04), the problem was footnote settings were modified also in case there were no footnotes at all in the document. Make the bug scenario and the original one working at the same time by touching footnote settings only in case there is at least one footnote in the current section. (cherry picked from commit e79ef12b7a904f17d4147fa409d055c12b70f952) Change-Id: I163d11769cbd97957662607fbedfba404181e002 Reviewed-on: https://gerrit.libreoffice.org/37228 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit cc6a55d687581db1a174b2a7d01f8a62887b5e24)
2017-05-04AutoText: read names of entriesSzymon Kłos2-0/+21
+ extended model to parse <docPartPr> and <name> marks + names are inserted to the document before content of each entry + SwDOCXReader interprets first paragraph of each section as a name Change-Id: Ib7de152ba1c6bea4f4665f98d321019c3f68863e Reviewed-on: https://gerrit.libreoffice.org/37124 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-04AutoText: Reading multiple entriesSzymon Kłos10-1/+82
+ each entry is placed in a separate section + extended model and dmapper to react on docPart mark Change-Id: I7e5213a09ae7352d1d09369bd0a209b6d4e18e82 Reviewed-on: https://gerrit.libreoffice.org/37107 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2017-05-04AutoText: importing docx contentSzymon Kłos2-0/+8
- passing "ReadGlossaries" flag to the WriterFilter - if set - WriterFilter reads glossary document instead of the main content - updated model.xml to read docParts and docPart nodes - SwDOCXReader adds document content as an AutoText entry Change-Id: I9a0cc91c793d6accc8461e1c3aca791c5997d497 Reviewed-on: https://gerrit.libreoffice.org/36753 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2017-05-04tdf#107104 DOCX drawingML import: fix invisible arrow shapeMiklos Vajna1-0/+6
This is the drawingML equivalent of commit 3d9ebded1358395ed81db7a63629b046aec2aeac (Misc improvements for docx VML import, 2010-10-06), which made sure that shapes are never invisible just because they have zero height or width. For this particular bugdoc the Word-produced WW8 equivalent width is 20 twips, but let's be consistent with the VML import and just round up to 1 mm100. Also fix two existing tests that wanted to test something else, but implicitly asserted that some shapes indeed have zero width/height. (cherry picked from commit e6e5a68f52f4e06b73f0ece3a3886f3bfc30f56d) Change-Id: I9600424520d0a3deecc711b44622eccc041a59da Reviewed-on: https://gerrit.libreoffice.org/36953 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 7d3baea4a726d6c0cf6cb0d6a8b2c83cef4f580d)
2017-04-24tdf#107116 RTF import: fix missing upper and lower borders around textMiklos Vajna1-1/+20
See commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17) for the context. Here the problem was that various details of the top border were removed during the style deduplication, but not the top border sprm itself. That was interpreted (correctly) by dmapper as "no border", rather than "inherit from style". (cherry picked from commit e9f0d8d02885eca619552b19eab30c1eade9e7ef) Change-Id: I3dec8df789fc7b75fccfff91ce66f457fecd2f6e Reviewed-on: https://gerrit.libreoffice.org/36692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit c8c90854506cc7f1c3d7084ab97c156aead003e2)
2017-04-18tdf#106970 DOCX import: don't collapse para auto space for different numsMiklos Vajna1-3/+15
Commit 1bf7f6a1a50ee9f24a3687240fe6ae390b905a6b (tdf#106690 DOCX import: fix automatic spacing before/after numbered para block, 2017-04-04) made sure that autospacing is only collapsed in case the adjacent text nodes both have a numbering rule. It turns out there is an additional condition: even if both text nodes have a numbering rule, do the collapsing only in case they have the same numbering rule. (cherry picked from commit e1c83d0514e6123faa50ad0a7aa6a9031b271c9a) Change-Id: Idb7a2b24d7eaa9094cc36f86b8a483045a33d028 Reviewed-on: https://gerrit.libreoffice.org/36510 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit e57873156d3c04ecc34bb5f38b186ebe29567f0c)
2017-04-12tdf#106690 DOCX import: fix automatic spacing before/after numbered para blockMiklos Vajna3-7/+50
The context is text nodes with automatic before/after spacing and numbering rules set, like: A * B * C * D E The correct behavior seems to be (though I haven't found this explicitly written in the OOXML spec) to drop spacing between B and C and C and D, but not before B and not after D. Originally no spacing was dropped, then commit c486e875de7c8e845594f5043a37ee8800865782 (tdf#95031 DOCX import: auto spacing inside numbering means no spacing, 2016-10-18) removed spacing around all B/C/D. Fix the problem by checking the numbering rules and automatic after spacing of the previous paragraph, so spacing before B and after D is not removed. Change-Id: Icbdb36e31057ab0e8ac033888cf5cc7c52dad5d0 Reviewed-on: https://gerrit.libreoffice.org/36062 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 1bf7f6a1a50ee9f24a3687240fe6ae390b905a6b) Reviewed-on: https://gerrit.libreoffice.org/36142 Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 776839b8bfc6eed905ce97c6fe32af8deb8d1451)
2017-04-12tdf#106692 writerfilter: RTF import: fix \'0d in \leveltextMichael Stahl1-2/+4
It's not a newline but yet another one of those bizarre RTF-encodings. (regression from 10e733908038407791f9c14af2a86417cc4a653c) (cherry picked from commit 69b7204164945cfed385d58e64592ce1b17937d7) Reviewed-on: https://gerrit.libreoffice.org/36284 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit fd93d09a5b6226a8297b5dd995301d514ec7b8ca) Change-Id: I568050b031b95ac0b6ebfa1a0c39107e62f68bed
2017-04-04writerfilter: DOCX import: fix handling of w:hideMark vs. w:vMergeMichael Stahl1-1/+5
The problem is that Writer's layout can't handle the case where cells are vertically merged and the last row has a fixed height; the vertically merged cell will grow up to the height of the other cells in the non- fixed rows plus the fixed row height, but no larger. So for now, avoid setting fixed row heights in this case. (regression from d1278ef4849661b9ae0eb7aaf4d74fbf91ccaf11) Change-Id: Iac3689e0bb0d5b8a62115ca0fb1f2c553a6e6bbc (cherry picked from commit c382c998ffdaf80c10a3f078fb4f0a37224d1158) Reviewed-on: https://gerrit.libreoffice.org/35960 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 7d7d21cfa53c8e80fd4dd0938579d8377da5a840)
2017-03-30tdf#106694 RTF import: fix missing paragraph tab positionMiklos Vajna1-1/+19
The problem here was that while in general paragraph style / direct formatting deduplication is supposed to happen in the tokenizer, paragraph tab positions is an exception, and dmapper expects to see the duplicated tokens. Fix the problem by introducing a blacklist that contains tokens not to deduplicate. Change-Id: I1cca53e99cfdb082df389ff295f3447cc8f9d3b8 Reviewed-on: https://gerrit.libreoffice.org/35790 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit fea174753b1c6b0882aebb044bf1a1eef6fa50e0)
2017-03-28Resolves: tdf#106724 crash when Title property doesn't already existCaolán McNamara1-8/+8
because we just write past the end instead of resizing before hand (cherry picked from commit 4e32e8900e59f9751a60d9fdef80cdf7d500f72f) Change-Id: I4742980a331b14ca39aff8aa6cfc27db154091ff Reviewed-on: https://gerrit.libreoffice.org/35651 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 1255360bffebef0f0521b00c4e5af57e6fe09e6b)
2017-03-17tdf#105729 RTF import: \ltrpar should not override \qc from styleMiklos Vajna1-2/+4
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. (cherry picked from commit 2cc5f18d10cf6ef1349d9518e6f67977f7c5d9bf) Change-Id: I2baa2c8c8012d972740da7cf3f710117812859b3 Reviewed-on: https://gerrit.libreoffice.org/35190 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit b5c4e120540053d0cb737720503cb7038f12d5bd)
2017-03-17tdf#103931 DOCX import: fix lost section breakMiklos Vajna1-0/+1
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. (cherry picked from commit 6603947329a7b372a173a3c60e013e532d0bc5cf) Change-Id: I64f2c403dcb2ceca76d444ab06df3052235d2795 Reviewed-on: https://gerrit.libreoffice.org/34718 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 1e88c10327642e6867db5708e3fd0fb7065bc74c)
2017-03-14vcl PDF import: there is no PNG encoding hereMiklos Vajna2-2/+2
It was a copy&paste error from xmlsecurity/workben/pdfverify.cxx, which does PNG encoding. Change-Id: I7b5108a7cddffdc859276b656a6e1168f23d3863 (cherry picked from commit 89e339fc1937b7de0d0e1f4ced802db7b4a68a9b)
2017-03-10tdf#104287 RTF import: handle bitmap shapes inside tablesMiklos Vajna4-15/+60
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. (cherry picked from commit 8240be9170cc473506531dad2fda82469ae84443) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx writerfilter/source/rtftok/rtfvalue.cxx writerfilter/source/rtftok/rtfvalue.hxx Change-Id: I04d65eb794ff6b160ef77af85479ba25ea5f8aa7 Reviewed-on: https://gerrit.libreoffice.org/34953 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 9a899023db876630b74493da588b4a5490f90894)
2017-02-24writerfilter: RTF import: hex-escaped \r and \n create paragraph breakMichael Stahl1-1/+13
... 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 (cherry picked from commit 10e733908038407791f9c14af2a86417cc4a653c) Reviewed-on: https://gerrit.libreoffice.org/34584 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 7a26194b05029f68e58ff71285c7be1c5b4c2c42)
2017-02-24tdf#104081 RTF import: handle \htmautspMiklos Vajna4-4/+10
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. (cherry picked from commit 291c9122b23ce7aa619e828b895b08dcd21bf025) Change-Id: I2fd757a8f95be9b1bee63570c9f587c17d3b22bc Reviewed-on: https://gerrit.libreoffice.org/34568 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit af9d9f274ff26b462048746069a5bb38493ff115)
2017-02-24tdf#106001: Treat CharScaleWidth outliers as 100 in DOCX importAron Budea1-2/+11
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> (cherry picked from commit 6e3a84023b46f6be632b43d2f5713d8d4bb2ba62) Reviewed-on: https://gerrit.libreoffice.org/34368 (cherry picked from commit 06c81a3e61e2d5743ffd8a50d85e5ecee989e46b)
2017-02-17tdf#104181: don't throw on XRelationshipAccess queryMike Kaganski1-4/+4
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> (cherry picked from commit 13827ffa54268dc648e1b72ea574daea02598335)
2017-02-07writerfilter: remove gperf related declarationsMichael Stahl1-11/+1
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 (cherry picked from commit 19c0eff34a5e1de4f3aff723b7750d4e01d4ba6d) Reviewed-on: https://gerrit.libreoffice.org/33969 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-02-06tdf#104082 RTF filter: handle user-defined document properties of type numberMiklos Vajna2-0/+5
Previously only strings were handled, which resulted in not being able to open the bugdoc. (cherry picked from commit fc8c4606e0834cd2128a228c2c95fc7c8f9eb7b1) Change-Id: I2452cbabf48bfaa9f1a3044be4b8cbe4aa9dd0d9 Reviewed-on: https://gerrit.libreoffice.org/33952 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-02-02tdf#103976 DOCX import: disable incomplete w:before/afterLines style handlingMiklos Vajna1-2/+8
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. (cherry picked from commit 353a45aa1b1a15047aa2a92c1383996070e87405) Change-Id: Ie8642c7a9771596def6b8899e098b26c4f8be0b4 Reviewed-on: https://gerrit.libreoffice.org/33774 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-01-23tdf#48658 writerfilter: only set THROUGH wraps as transparentJustin Luth1-1/+7
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> (cherry picked from commit c0688e8bf047bb123680806317fe040ba2cde407) Reviewed-on: https://gerrit.libreoffice.org/33360 Tested-by: Jenkins <ci@libreoffice.org>
2017-01-19tdf#99074 sw: remove duplicate property "IsBrowseMode" againMichael Stahl1-13/+14
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 (cherry picked from commit 2dce8dd41c208ecda40c054635f3736147ec8914) Reviewed-on: https://gerrit.libreoffice.org/33283 Tested-by: Jenkins <ci@libreoffice.org> 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 Vajna6-7/+33
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. (cherry picked from commit 38a1e19ae49ac30757e4020b60adee7c30f3deb9) Change-Id: I6d7986904cedb952998a87e7648919ae34adc360 Reviewed-on: https://gerrit.libreoffice.org/33224 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-01-09tdf#105143 DOCX import: enable DoNotCaptureDrawObjsOnPage layout compat optionMiklos Vajna1-0/+1
Because that's what Word does to show only part of the shape in the bugdoc. Conflicts: writerfilter/source/filter/WriterFilter.cxx Change-Id: Ic5cb84cace9237671d71eda0c64e9dadfe244cb9 Reviewed-on: https://gerrit.libreoffice.org/32782 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/32784 Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2017-01-05tdf#99616 writerfilter: hideMark shouldn't force min sizeJustin Luth1-3/+1
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> (cherry picked from commit 1a58cdf8af1aba52ce0a376666dd7d742234d7cf) Reviewed-on: https://gerrit.libreoffice.org/32721
2017-01-04tdf#104744 RTF import: fix unexpected zero para left margin wrt style dedupMiklos Vajna1-29/+45
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). (cherry picked from commit a9e029ace41562e28e9242d63230ad1ca275f5d3) Change-Id: I37f079b9cb4773214d2531c2e34920b3b8927211 Reviewed-on: https://gerrit.libreoffice.org/32718 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-01-02tdf#104876 writerfilter: m_bTableSizeTypeInserted = false hereJustin Luth1-1/+3
fixes commit cbd0fbc287051f918e4adb32b3e9b58dfbf8059d which removed the insertion code with the explanation saying we should simply not do anything, and that'll lead to the right behavior, don't try to be smart and try to set TABLE_WIDTH here but still left the flag set, falsely indicating that the tableSizeType had been inserted. Change-Id: I0720083c992d1d03a5fe259d5b4b177a0c8108f8 TODO: the table size still isn't correct. Reviewed-on: https://gerrit.libreoffice.org/32385 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit e73c961a7fb23246dc4a9c27d7ed0808b9ba74b5) Reviewed-on: https://gerrit.libreoffice.org/32636
2016-12-23tdf#75573 - relocate code: alternate stream already startedJustin Luth1-4/+4
moving this keeps the original fix and prevents losing a table in this unit test fixes regression commit ecea3431ca761369d8180a74eba2877533050516 Change-Id: I5e94760649020ddf1c468d52b91aaf0521bbfdda Reviewed-on: https://gerrit.libreoffice.org/32269 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 34324bff1252dc5a51c9408f9502654453f319b6) Reviewed-on: https://gerrit.libreoffice.org/32324 Tested-by: Jenkins <ci@libreoffice.org>
2016-12-22tdf#104710 bRemove: only prevent w/BREAK_TYPE for defined SectionsJustin Luth2-1/+4
fixes regression from fix for bug 103975 which prevented removal of empty paragraphs if there was a page/column break. This patch adds the requirement that there is also a defined SectionBreak. I did a bad thing with unit test rhbz988516 (which was re-used as the unit test for bug 103975). I didn't first check in MSWord to see how many pages it really ought to have, and when it started round-tripping with 3 pages I was happy. Well, the proper page count according to MSO is 2 (a hard page/break and Section/newPage combine to form a single pagebreak). Undoing the regression fixes that too. The regression was commit 7b250d56981f78e77454a2a3fd670731b2358e75 Change-Id: I15e9df2d260954f02a9e183d9f48c1d267494b49 Reviewed-on: https://gerrit.libreoffice.org/32236 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit e37563c304e52f1d2385868c9b33e0145493d2bd) Reviewed-on: https://gerrit.libreoffice.org/32328
2016-12-22related to tdf#97417: fix unit test's early para numberingJustin Luth1-1/+3
The unit test's first blank page already started the paragraph numbering. Setting it so that a contentless, single paragraph section will not display numbering. In fact, no dummy paragraph should have numbering, but that would get complicated. This is in preparation for tdf#104710. Change-Id: I98c9926cb3cd1e3fe3cd43bf46cab22bfbec7eba Reviewed-on: https://gerrit.libreoffice.org/32235 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit c829e01e973ac32fb625925ce83f843ad30d94db) Reviewed-on: https://gerrit.libreoffice.org/32326 Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-12-22related to tdf#97417: fix unit test page countJustin Luth1-2/+2
The unit test should have been showing a blank page before the content page. Non-section paragraphs should not remove the first/last status. Frames were already excluded, now this patch also excludes header/footer paragraphs. This is in preparation for tdf#104710. Change-Id: I686944843302160d6f6bbbcb73f01c836179aa9f Reviewed-on: https://gerrit.libreoffice.org/32234 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 893698741a78e56d74b87caff24f67742ddd892b) Reviewed-on: https://gerrit.libreoffice.org/32323 Tested-by: Jenkins <ci@libreoffice.org>
2016-12-21tdf#96218: MSO DOCX image incorrectly placed when using Alignment PositionTamás Zolnai3-1/+7
layoutInCell attribute should be ignored when we are not in a table. Change-Id: Ieed29c690f8516f63d0956a4f0495500908a0d27 Reviewed-on: https://gerrit.libreoffice.org/32253 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 36750bc977b3210b23b7822abd395b30a78af6f5) Reviewed-on: https://gerrit.libreoffice.org/32267 Tested-by: Jenkins <ci@libreoffice.org>
2016-12-20tdf#104162 DOCX import: fix crash on <w:hideMark/> in a comment tableMiklos Vajna1-0/+8
sw comments are handled by editeng, so tables in comments aren't imported. That means lcl_emptyRow() may get a row where the first cell's start is an empty reference, so handle that case. (cherry picked from commit 74dddd8b483d89dc7915471441cc30a1aa342363) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport9.cxx Change-Id: I43e286314143934c20e6cbbd656d32883b6b2efe Reviewed-on: https://gerrit.libreoffice.org/32223 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-12-20tdf#104714 bRemove paragraph: ignore frames in Headers/FootersJustin Luth3-13/+9
Empty paragraphs are removed in certain cases. If the previous paragraph was in a frame, then this one shouldn't be removed (unless that previous paragraph was in a header/footer). Most of this patch is renaming the function to clarify that it refers to the latest paragraph, not the very last one. As noted in original tdf#75573, there may be other paragraph containers that should also ignore their framed status - so I've tried to set this up to make it easier to add those cases when proof documents are found. Change-Id: Icd09793f652616622ab266942f4b81eeb39c0ccc Reviewed-on: https://gerrit.libreoffice.org/32121 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 223dd0c15e383144bdeea040f86efb7a06f89450) Reviewed-on: https://gerrit.libreoffice.org/32125 Tested-by: Justin Luth <justin_luth@sil.org>
2016-12-19tdf#104713 writerfilter: parentless styles - only if default definedJustin Luth1-2/+11
LibreOffice's default paragraph style is very different from Word's normal style? Anyway, if normal is not defined in styles.xml, then don't re-assign any other automatic styles to be based off of it, since that indicates that the style information being imported is not complete. avoids regression from commit b79b5e0df6dc5a0ba18054b0503d6fa804b69f02 Change-Id: I1bfa8505d6b89b2bba255ad727ebadbacc8d3651 Reviewed-on: https://gerrit.libreoffice.org/32103 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit b8fa395288a1f3a24a4fca392afdf3a9b58373ea) Reviewed-on: https://gerrit.libreoffice.org/32173 Tested-by: Justin Luth <justin_luth@sil.org>
2016-12-14tdf#104228 RTF import: fix override of style left/right para marginMiklos Vajna1-0/+2
See commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17) for the details, this bug was about the same, just for two more paragraph properties. Specify the default values for them, so override of style value as direct formatting works as expected. Change-Id: I353cc3ae8c35baf1b5ed5a83a8bd131c7bfbbe64 (cherry picked from commit 657c6cc3acec0528209a8584b838cd6de581c437) Reviewed-on: https://gerrit.libreoffice.org/32005 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-12-14tdf#104420 writerfilter: no dummy para in headersJustin Luth1-1/+2
Change-Id: I22bf2d85e01ce5a084babdc07a11ada0790f4933 Reviewed-on: https://gerrit.libreoffice.org/31710 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit b71c09a31c245f2fc1e1ff3760206bb121869633) Reviewed-on: https://gerrit.libreoffice.org/31988
2016-12-14tdf#46941 docx: don't balance columns before page-break-sectionJustin Luth2-1/+22
Pleasantly surprised to see we already don't balance before regular page-breaks or at the end of the document. This adds not balancing before a page-break-section. Change-Id: Ifedff5cc45b154a005f13b3212154c443727e286 Reviewed-on: https://gerrit.libreoffice.org/31826 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit ede1a83e110ce7bc7d3560f415d6269ea3feb947) Reviewed-on: https://gerrit.libreoffice.org/31943
2016-12-13tdf#103925 RTF import: fix handling of \animtext0Miklos Vajna1-3/+17
Since commit ac6bfd85df271b650dbd24b45391dac346ecd72c (tdf#92045 DOCX import: <w:effect w:val="none"/> doesn't mean blinking, 2016-01-06) the "no blink" blink type is not 0, but NS_ooxml::LN_Value_ST_TextEffect_none. (cherry picked from commit c260580daa4fe78093265c1359c4d54677d76470) Change-Id: If854e57d125a365f829797f027ca5e131705e137 Reviewed-on: https://gerrit.libreoffice.org/31899 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-12-08tdf#103651 check isForwardEvents() for symbols in commentsMark Hung3-1/+8
Every time a comment is referred, the whole comment stream is parsed but only the referred comment is extracted. But the symbol is always processed so it is added to all the comments. Change-Id: I3264de2d011ff188ef64f6500ae426cde0106c16 Reviewed-on: https://gerrit.libreoffice.org/31584 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 3caf89200c8fa7b38d6c340b666ca6cc8c2eb766) Reviewed-on: https://gerrit.libreoffice.org/31759
2016-12-07tdf#104317 RTF import: avoid setting CustomShapeGeometry on a line shapeMiklos Vajna1-7/+11
Even Santa Claus knows it has no such property. (cherry picked from commit c2e070d9a8192e7aceed64a63c716c7317843747) Change-Id: I46e27868c62fabd10c6447956e40e55962ee284b Reviewed-on: https://gerrit.libreoffice.org/31723 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-12-03tdf#103975 docx import: don't lose column break #2Justin Luth1-2/+3
Change-Id: I871e10d675d9009c163dd2b0fc74d29206934e34 Reviewed-on: https://gerrit.libreoffice.org/31342 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 4307a850a310c0371bee1f79a8eb41fa8ff7fed2) Reviewed-on: https://gerrit.libreoffice.org/31396
2016-11-30tdf#103975 docx import: don't lose column breakJustin Luth1-0/+9
This round-trips terribly, but that was equally true before these patches. Change-Id: I4ed191c77e7f519d4c013fc83ef8b866b53d0c70 Reviewed-on: https://gerrit.libreoffice.org/31326 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit bbc7ed9c379019f31dc7ac234cf83ea151601465) Reviewed-on: https://gerrit.libreoffice.org/31341
2016-11-29tdf#103975 docx import: don't remove sectPr with BreakItemJustin Luth1-0/+1
If an empty sectPr paragraph contains Page/Column break information, do not discard it. Change-Id: If817debccb924eb9cf0ffdc374c960d25908370f Reviewed-on: https://gerrit.libreoffice.org/31227 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 7b250d56981f78e77454a2a3fd670731b2358e75) Reviewed-on: https://gerrit.libreoffice.org/31233 Tested-by: Jenkins <ci@libreoffice.org>
2016-11-15tdf#82824 DOCX import: fix at-char embedded object handlingMiklos Vajna1-1/+15
The anchor type of embedded object was simply not handled, we always assumed that it's as-char. When it's at-char set the anchor type accordingly, and also set the usual 6 properties determining the position of the anchored object. Change-Id: I3f8bede33c6f1a0bdc4f4d4ea59c4fc805802291 Reviewed-on: https://gerrit.libreoffice.org/30860 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>