summaryrefslogtreecommitdiff
path: root/sw/qa/extras
AgeCommit message (Collapse)AuthorFilesLines
2018-05-09OFFICE-3776 xmloff: adapt ODF import to renamed text:sender-initialsMichael Stahl2-0/+91
ODF TC decided to rename the element to meta:creator-initials, so adapt the import so it can read this in addition to the 2 element names produced by current and past LO versions. Also add a test. Unfortunately it turned out that the ODF validator had a bug in checking character data in foreign elements, which is triggered by the test document, see https://issues.apache.org/jira/browse/ODFTOOLKIT-475 ... so update the validator jar as well. Change-Id: I1de1e8772b41f8937f043d9a0d150e169f25ffd4 Reviewed-on: https://gerrit.libreoffice.org/53979 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit b09889a158cbc839ebc8a6061b0b261fa74930e6) Reviewed-on: https://gerrit.libreoffice.org/54007 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit cc68977f1be22ac0f4a15eb37e05ccba13a7a554) Reviewed-on: https://gerrit.libreoffice.org/54019 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-05-09tdf#117268: treat erroneous \itap0 the same way as Word doesMike Kaganski2-0/+73
... so that if we are inside a table, it would not convert table paragraphs into top-level paragraphs. (The in-the-wild documents with this invalid input are, e.g., generated by Consultant+ legal reference database). Reviewed-on: https://gerrit.libreoffice.org/53790 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 247dabcb0b92a62b233ec0237deac84e6675325c) Change-Id: I45eb9073a0651bc963badb84229ce5ae437f1a8c Reviewed-on: https://gerrit.libreoffice.org/53840 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Michael Stahl <Michael.Stahl@cib.de>
2018-05-07tdf#117028 sw: conditionally consider fill of shape for in-textbox auto colorMiklos Vajna2-0/+24
Commit f966767e1ccfa432da33e1a0fd6de69e17a36bc3 (tdf#116925 sw: consider fill styles of shape for in-textbox auto color, 2018-04-10) did this unconditionally, but there are two cases: 1) Shape (with textbox) has a fill, in that case auto text color of textbox should consider the shape fill. 2) Shape has no fill, in that case the shape fill should not be considered when counting the background of a transparent fly frame. Fix 2) without breaking 1) by making the change to SwFrame::GetBackgroundBrush() opt-in, and only use it for auto font color, not in other cases. Change-Id: I761a1b7d6ecf47586edbe5641ec012f22f6a53d7 Reviewed-on: https://gerrit.libreoffice.org/52941 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit d9420a64fbb288020d33b681f40a858db49afca7) Reviewed-on: https://gerrit.libreoffice.org/52986 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit b981c148ef82d0a519e270974db01c9c5879a52c) Reviewed-on: https://gerrit.libreoffice.org/53742 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-05-07tdf#116925 sw: consider fill styles of shape for in-textbox auto colorMiklos Vajna2-0/+22
Automatic color is determined in SwDrawTextInfo::ApplyAutoColor(), but it uses this function to determine the background color. Be consistent and consider the same background in both the shape-with-editeng-text and shape-with-sw-text cases. (cherry picked from commit f966767e1ccfa432da33e1a0fd6de69e17a36bc3) Change-Id: I52249a908193765bc128789d96187af334c1017c Reviewed-on: https://gerrit.libreoffice.org/52983 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 9e0b21e416470d826f6f27d463ba2e42bee5222d) Reviewed-on: https://gerrit.libreoffice.org/53737 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-05-07tdf#116985 sw: fix geometry of textbox of shape with relative sizeMiklos Vajna2-0/+10
Relative size of shapes are calculated by the layout, so the normal doc model-level synchronization between the shape and its textbox was not enough. (cherry picked from commit c8b976ac64c9cac360f7c4fd9844fcfac7ba25a8) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: Ia6f460132efaf03a7ba3a023cf751f6fff74404d Reviewed-on: https://gerrit.libreoffice.org/52985 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 2b39c6821929041d0806125720c56525df40c455) Reviewed-on: https://gerrit.libreoffice.org/53740 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-05-07tdf#116976 DOCX import: fix rel size of shape after bitmapMiklos Vajna2-0/+7
We have a queue of these odd relative sizes (which are not XML attributes but text inside the XML element), if the bitmap doesn't pop the queue, the following shape won't get its size. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: I1602208c9509d8889bf0be254f3b25fb25fafca2 Reviewed-on: https://gerrit.libreoffice.org/52984 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 cba1897f3c063f8a535898bfd16a516c8de9ac21) Reviewed-on: https://gerrit.libreoffice.org/53739 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-05-07tdf#116410 DOCX import: restrict increased object spacing to multiple shapesMiklos Vajna4-0/+12
This anchored object handling is just there to be bug-compatible with Word, it's not needed for the case when there is a single shape in the paragraph. (cherry picked from commit 2c4d84e93901571ead79c85aa3894ef4e10bf5af) Also: Related: tdf#115719 DOCX import: fix ignore of increased anchored obj spacing If there is only a single anchored object, then ignore only the current paragraph, not all paragraphs of the section. (cherry picked from commit 599ff05300599d4e4ce818092f18e76e738b921e) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: I5e3dc4ba9a4a6f459ec6217e8974ebc2d7303bcc Reviewed-on: https://gerrit.libreoffice.org/52981 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 82f6da65acaf02bc3b9d6b2039a4c307d5593423) Reviewed-on: https://gerrit.libreoffice.org/53738 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-05-02tdf#116830 sw: handle cell background for BACKGROUND_PARA_OVER_DRAWINGSMiklos Vajna2-0/+68
Commit 18b3feb8bef06bf7b126fd0bc743e19479cb8026 (n#778133 sw: add BackgroundParaOverDrawings compat flag, 2012-09-12) added a layout compat flag that is meant to make Writer behave the same as Word when it comes to the order of various backgrounds. The original fix was that in case there are background shapes and also paragraph backgrounds, then this flag can opt in to have the paragraph backgrounds on top of background shapes. Cell backgrounds behave the same way in Word, so extend the behavior of the compat flag to cover not only the background of text frames but also of cell frames. (The test could be hacked into CppunitTest_sw_uiwriter, but 1) this is layout, not UI and 2) that one started to get rather large.) (cherry picked from commit 09954c381895f340c9b73af64b0833d8b4689c06) Change-Id: Ifca1851217000f6daac50e6c9562c042aca6ff7d Reviewed-on: https://gerrit.libreoffice.org/52982 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 05ed69af14af8f138f69941c7c6186b39c742eb4) Reviewed-on: https://gerrit.libreoffice.org/53653 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-03-29tdf#106746: pDelPam is a bit specialAron Budea1-0/+36
Regression from db17d3c17c40d6b0e92392cf3c6e343d1d17b771 Change-Id: I17e2fef2eb16a900cc487b75c3b9dbba2764ac71 Reviewed-on: https://gerrit.libreoffice.org/51814 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Aron Budea <aron.budea@collabora.com> (cherry picked from commit 7b1d50e97eaa00855152e74f42b789fc643e0bac) Reviewed-on: https://gerrit.libreoffice.org/52017 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-26tdf#115883 DOCX import: catch RuntimeException from SwXFrameMiklos Vajna2-0/+6
getPropertyValue("Surround") for a non-inserted frame can throw, but hasPropertyValue("Surround") still returns true. So fix the regression by just catching the exception, assuming that in that case no increased spacing is needed. Reviewed-on: https://gerrit.libreoffice.org/50175 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 5e1a50cc433a865da677faf7d502ba41858e45f6) Change-Id: I49a78ce8d41b4e1cc7d23721d5dc70f7550c94af Reviewed-on: https://gerrit.libreoffice.org/50349 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-17tdf#115719 DOCX import: increase paragraph spacing for anchored objectsMiklos Vajna2-0/+7
... like Word 2013 does, when the version string indicates that the new layout is wanted. An alternative to this change would be to add a new sw layout compatibility flag and handle this at a layout level (somewhere in SwAnchoredObject::GetObjRectWithSpaces()). The downside of that approach is that once a layout flag is added, it's not preferred to tweak its behavior, while doing the same at import time is not a problem. Also it's better to have a flag for something which has clear behavior in some spec / implementer notes, which is not the case for this problem. (I've mailed dochelp@microsoft, no answer so far.) (cherry picked from commit 8b73bafbc18acb4dd8911d2f2de8158d98eb6144) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: Ibad28d27e4bcbe1991a3be1c686064e18e9ffa4d Reviewed-on: https://gerrit.libreoffice.org/49803 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2018-02-07sw: disable testTableKeep on WNTMichael Stahl1-1/+1
Fails from time to time, like so: https://tinderbox.libreoffice.org/cgi-bin/gunzip.cgi?tree=MASTER&brief-log=1517842001.29090#err2 Change-Id: Ia33193fbfa05da58d31bcc5008beea32c1feb2fe (cherry picked from commit b2a053160c4c8eb0acd66b74c52dbda23a654bda) Reviewed-on: https://gerrit.libreoffice.org/49289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-30DOCX import: handle horizontal flip of bitmapsMiklos Vajna2-0/+6
Horizontal mirror on the UNO API level, mirror on the vertical axis internally. (cherry picked from commit 4bdbb5502f5995727017e22bb8a74b9f45552067) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: If142274a8f81a6875059a2651af6d8470870a36a Reviewed-on: https://gerrit.libreoffice.org/48902 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-20tdf#115079: check that row frame belongs to table frame to avoid segfaultJulien Nabet2-0/+5
A row frame may not belong to a table frame, when it is being cut, e.g., in lcl_PostprocessRowsInCells(). Its SwRowFrame::Cut() has been called; it in turn called SwLayoutFrame::Cut(), which nullified row's upper in RemoveFromLayout(), and then called Shrink() for its former upper. Regardless of whether it will be pasted back, or destroyed, currently it's not part of layout, and its height does not count. See bt https://bugs.documentfoundation.org/attachment.cgi?id=139171 Change-Id: I4010e1f246a3ebb89b3f972a03619a2775146da4 (cherry picked from commit daf1b10f4e266818b6e14f0f1dfddd66f0a3a2f0) Reviewed-on: https://gerrit.libreoffice.org/48234 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-11-21tdf#113790: skip charfmt grabbag items existing in autofmt grabbagMike Kaganski2-0/+25
Change-Id: Icc0065c1da9471cb36bfef0da45e2f67381a1a31 Reviewed-on: https://gerrit.libreoffice.org/44706 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/44918 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-15tdf#107111: DOCX export: restore HideTabLeader... attribute after TOXVasily Melenchuk2-0/+13
Previously m_bHideTabLeaderAndPageNumbers value was not restored after TOX finish and so causing visibility problems with following hyperlinks. Reviewed-on: https://gerrit.libreoffice.org/43310 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport9.cxx Change-Id: I4ba5ce1f70e05d706d17d60e1a33a62995701f9e Reviewed-on: https://gerrit.libreoffice.org/44754 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de> Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-10tdf#112352 ooxmlimport: ALWAYS treat 1st nextpage w/cols as contJustin Luth2-0/+11
fix 5.4 regression from 4605bd46984125a99b0e993b71efa6edb411699f. When there are columns, if a nextpage section doesn't contain any other "page style" details we treat it as a continuous break, If we don't, the column info becomes part of the style itself, and not just a section property. However, the very first section is troublesome - by definition it DOES contain page style details, and so if the document starts with columns, the default style would gain the column attribute. Usually that results in a mess, so lets make sure that we avoid that also in the case where headers/footers are defined. Change-Id: I7e08a9218e4304206579ed064bc92c9604d4470e Reviewed-on: https://gerrit.libreoffice.org/44505 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-on: https://gerrit.libreoffice.org/44520 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-09sw: ODF import: prevent shapes from inheriting paragraph default marginsMichael Stahl1-0/+3
The problem is that even with the vertical-pos default fix, we don't render ShapesWithWrapping.odt the same as Word does: https://beta.opendocumentformat.org/rendercompare/upload/223/86/191/1 The shape still has a spurious bottom margin, which should not exist. This has a surprising cause: the default-style family="paragraph" has the attribute fo:margin-bottom="0.1388in" on paragraph-properties, which gets imported as the pool's default item of RES_UL_SPACE; there is nothing that prevents the shape from using this pool default item if it doesn't have a margin set on itself. Prevent that by overriding the pool default in SwDoc::mpDfltFrameFormat, which already carries a XFillStyleItem for similar reasons. The mpDfltFrameFormat is used by a lot more than just shapes, but none of that stuff should inherit paragraph defaults. As an aside the fo:margin-* properties are also allowed on style:graphic-properties, but it turns out that the implementation of the default-style family="graphic", in SvxUnoDrawPool/SwSvxUnoDrawPool, does not have the corresponding properties, hence cannot import these. Not sure if it would be better to have multiple SvxULSpace items with different IDs, so the paragraphs and shapes and etc. can have separate defaults. Change-Id: Ie6a196db567beb7a48b4176f383c88490dcfb8e7 (cherry picked from commit 2e39e519767d58a20829baca2fb0a2418b70f772) Reviewed-on: https://gerrit.libreoffice.org/44287 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-08tdf#103978 textboxhelper: syncProperty OPAQUE (wrap in background)Justin Luth2-0/+21
Although the containing shape is in the background (and thus the normal paragraph text is still visible), the shape's text was still painting over top of the normal paragraph text because the textbox was set as opaque and not transparent. Setting the textbox to sync the opacity value of its containing shape. Change-Id: I02477e2fa7def1f13590afcaa7c6564dd79d6406 Reviewed-on: https://gerrit.libreoffice.org/39672 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit cc438f60d6ad0855f754dd32da9c9a80c7cabf92) Reviewed-on: https://gerrit.libreoffice.org/44430 Reviewed-by: Andras Timar <andras.timar@collabora.com>
2017-11-07tdf#113550 RTF import: fix incorrect text indentMiklos Vajna2-0/+27
Left indent was set to non-zero in the style, but direct formatting set it back to zero. Teach deduplication to remove the NS_ooxml::LN_CT_PPrBase_ind SPRM itself in case the last attribute was removed. (cherry picked from commit 5f4a3e7bd77c3294ef85eebec17ed2d624dc3a2d) Change-Id: I01b202f0241b02816b2b392326737b1150caffc2 Reviewed-on: https://gerrit.libreoffice.org/44395 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-11-06sw: ODF import: default as-char shapes to vertical-pos="top"Michael Stahl2-0/+9
The problem is that we don't render ShapesWithWrapping.odt the same as Word does: https://beta.opendocumentformat.org/rendercompare/upload/223/86/191/1 The first shape in the file is anchored "as-char" and has no style:vertical-rel or style:vertical-pos attribute affecting it. If Word would write either style:vertical-rel="baseline" or style:vertical-pos="top" explicitly, the rendering in LO would be the same. So the problem is that, for drawing shapes (note, text frames are images, embedded objects handled differently), LO's default vertical alignment is different, it is hard-coded in SwShapeDescriptor_Impl::GetVOrient() as SwFormatVertOrient(0, text::VertOrientation::NONE, text::RelOrientation::FRAME) This effectively positions as-char shapes *below* the baseline, which, while technically allowed, isn't really a good default. So fix this by making the default alignment dependent on the anchor type, so that as-char shapes sit on top of the baseline. The ODF filter sets the anchor type before inserting the shape in XMLTextShapeImportHelper::addShape(), however as it turns out the various MSO filters insert the shape before setting the anchor, which means the new default in SwXShape has an unwanted effect on them, as inserting the shape causes the default to be created. ... this backport does not include the various changes to MSO filters but instead just checks that we're in ODF import. Change-Id: Ifcabd96a037515f7803f5474ec995f968b3b4de1 (cherry picked from commit c79467ba954987f1d239c594c1e1b3af3f5515f6) Reviewed-on: https://gerrit.libreoffice.org/44239 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-02tdf#113408 RTF import style dedup: separate paragraph and character handlingMiklos Vajna2-0/+30
The problem was that the paragraph in question had no left margin, while it should have one. The reason for this is that the style deduplication logic took both the current paragraph and character style, but the direct formatting only contained character formatting, so it tried to emit the default values for all paragraph formatting. This started to show up after commit 657c6cc3acec0528209a8584b838cd6de581c437 (tdf#104228 RTF import: fix override of style left/right para margin, 2016-12-13), but the root cause is much older, it was there since commit 321d7ec2071472b3765a00806715e7ad9f8a306f (fdo#82078 RTF import: fix bold text spilling over to non-bold text, 2014-09-06). (cherry picked from commit 1970a686273c5d4fc1eeb4430283e37085d9f647) Change-Id: If03240a85cc9de89afe9111c2d29de2672e407bf Reviewed-on: https://gerrit.libreoffice.org/44115 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25tdf#113202 RTF import: fix lack of expected contextual spacingMiklos Vajna2-0/+48
Upper, lower and contextual spacing are all stored in SvxULSpaceItem, so if after spacing is set as direct formatting, contextual spacing has to be set directly as well (having it in the paragraph style has no effect). (cherry picked from commit f8b5ecc622e2b3e82576b27bf0ded9c8eac21cae) Change-Id: Ie331c7561de7f2f16776a1613717e38fa083a541 Reviewed-on: https://gerrit.libreoffice.org/43808 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-10-18tdf#104079 RTF import: fix handling fields inside TOC fieldsMiklos Vajna2-0/+64
The marker trick is not needed for these, but the paragraph margins are lost when using it, so avoid it. (cherry picked from commit 6ee33d0772f991f04e97b5b61d7b11810a1b8ac0) Conflicts: writerfilter/source/dmapper/DomainMapper_Impl.cxx Change-Id: I3fc9644cb85138b5473cb1478196ae8538041fb1 Reviewed-on: https://gerrit.libreoffice.org/43501 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-17tdf#112211 RTF import: fix unwanted direct formatting for other indentsMiklos Vajna2-0/+52
Commit 56a695fddb915bcba13b088b5b2b4e0841d4acbc (tdf#112211 RTF import: fix unwanted direct formatting for left indents, 2017-09-26) fixed left indents, and given that it was a regression fix, left the other indent types untouched. As it has been pointed out in the bug comment, the original bugdoc actually needs the other indent types removed as well, so let's do that. (cherry picked from commit 295cf49b81b8c008ec0ea2c92f7cf729d5523d4e) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Ia4ea7e2214b7df27536f46b046f90bd703c107be Reviewed-on: https://gerrit.libreoffice.org/43448 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2017-10-04tdf#112507 RTF import: fix too narrow table cellMiklos Vajna2-1/+52
Commit e6ec0794858df1444f43659b568119bf126a90e6 (tdf#104937 RTF import: \trwWidthA is an absolute value, 2017-08-29) changed the handling of the fake empty cell at the end of table rows so that the parameter of the control word is an absolute, not a relative value. Turns out this wasn't correct, the DOCX equivalent of that bugdoc shows that the parameter is a relative value after all. The RTF spec also talks about a "width", which is assumed to be a relative value. So fix that bug in a different way again (by making sure that this additional fake cell contributes to the total width of the table, so column separators are counted correctly), this time without less side-effects. (cherry picked from commit 409c230ed70707eeb5e6fcd4ab904bb4a411608a) Change-Id: Ic64fd3a6abae8e0398e8e77123f0473d73f0c4b0 Reviewed-on: https://gerrit.libreoffice.org/43080 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-09-30tdf#112679 sw: fix copying of fieldmarksMichael Stahl1-7/+18
Aha, now we know that the reason for the defensive programming in lcl_AssureFieldMarksSet() was that there are actually 2 different use-cases for it: usually a new mark is inserted, so there are no dummy characters and they must be inserted. However when copying text, the dummy characters are copied too, so they must not be inserted, or we get duplicate fieldmarks. This also reverts commit d4036d3a89b65a4912f62e3930eb1a31cd90a16b which fixed the problem only for CHECKBOX_FIELDMARK in a different way. (regression from bb069fe7b8b6a24f9ff4df4c7052961e17ea3a8c) (cherry picked from commit 421a23bb36bbf51edfabc58b7d2cd28ad37719d0) Silence --disable-assert-always-abort warnings (cherry picked from commit 7e76b983301b02dd7020636905b764b981b1fff0) loplugin:constparams (cherry picked from commit 14e2a82002042a3fe4d8866b635ee84a436a7a7c) Change-Id: I3c99b8c6d720951655198e682018794337859373 Reviewed-on: https://gerrit.libreoffice.org/42867 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2017-09-29tdf#112446 ooxmlimport: Orient=NONE when distance is givenJustin Luth2-0/+5
Prior to commit 9920a0bf9d783978cd6f7b97f7528d8aa2571143 the style could only contain the default of NONE. So when a position was specified, it was always paired with HoriOrient == NONE. So it never caused problems until that commit when the Frame's style orientation started overriding the unset paragraph default. When a position is specified, that needs to be paired with an orientation of NONE in order to take effect. Change-Id: Iab0057810270ba708a8855c2ec6db291cef17cfb Reviewed-on: https://gerrit.libreoffice.org/42499 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/42837 Reviewed-by: Justin Luth <justin_luth@sil.org>
2017-09-26tdf#112211 RTF import: fix unwanted direct formatting for left indentsMiklos Vajna5-8/+54
This is a combination of 2 commits: 1st commit: Related: tdf#112211 DOCX import: fix handling of missing first ind in <w:lvl> Usually a DOCX numbering definition has multiple levels, each level containing a <w:ind ... w:hanging="..."/> element. When this is missing, we should default to the Word default, not to the Writer one. This makes the DOCX version of tdf#106953 imported correctly, in preparation of dropping the original fix that helped RTF only. [ The DOC version of the bugdoc is still not imported correctly. ] Reviewed-on: https://gerrit.libreoffice.org/42447 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit c72a1a74b5b1064fc9cdf9994b11fce26d866e26) Commit #2: Commit f528f9499bd91b700c549575e88fa102cfffede9 (tdf#106953 RTF import: fix missing paragraph left margin, 2017-05-16) fixed a problem around inheriting indents from numbering styles vs paragraph styles, but it turns out that document was rather special and in general the old behavior was correct. So fix that bug in a different way again, this time without less side-effects. The trick is that in case the level numbers group in a list definition ends with \u59 (instead of an ASCII ';'), then that group is considered to be invalid by Word. RTF import already was aware of this, but it wasn't known that when this invalid state is reached, that also means that the indents of the list level definitions should be ignored. So in general not putting direct formatting on a paragraph is a good thing: that way in case the paragraph style and the number style both has indent infos, then the numbering style wins, and that is what we want -- but in case \u59 appears in the list definition, then the indentation from the numbering style should be ignored. So fix up the tokenizer to import the indentation from list levels in general, ignore it for invalid list levels, and then we can remove the direct formatting from the paragraphs, which fixes this bug and keeps the old one fixed as well. This required fixing up two poor testcases, which tested paragraph properties, but in fact are interested in the real source of indentation, which is now the numbering style. Visually both bugdocs are unchanged. (cherry picked from commit 56a695fddb915bcba13b088b5b2b4e0841d4acbc) Conflicts: sw/qa/extras/rtfexport/rtfexport2.cxx writerfilter/source/dmapper/NumberingManager.cxx Change-Id: I6390aa870659a8ad02ba5512d84dea34dba29e9f Reviewed-on: https://gerrit.libreoffice.org/42793 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-09-25VML, Watermark: detect shapetype from other subdocumentsSzymon Kłos2-0/+13
In some documents Watermark wasn't visible because shapetype wasn't detected. It was impossible to use shapetype defined in header1.xml in shape placed in the header2.xml. Change-Id: Ib406c8fc702968684ad46efd0857b768af2820f5 Reviewed-on: https://gerrit.libreoffice.org/41395 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 87f1f7fdb34fe452ac540524224e1e808ce5d3a2) Reviewed-on: https://gerrit.libreoffice.org/42349 Tested-by: Jenkins <ci@libreoffice.org>
2017-09-19tdf#111480 Circular text was imported horizontallySzymon Kłos2-0/+9
Change-Id: I84a6c3a30fd1dddf104ad8bf037a5e0b2a90d376 Reviewed-on: https://gerrit.libreoffice.org/40912 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/42350 Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-09-13tdf#109184 auto cell color should be transparentSzymon Kłos2-0/+19
Don't add color to the property map if is set to auto. In this case white color was assumed and tables were white instead of transparent. Change-Id: I7f203b8f3831b86ba8de33dc57de227b3029c6d9 Reviewed-on: https://gerrit.libreoffice.org/41255 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/41520 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2017-09-13tdf#94882 use first page header on first pageLuke Deller2-0/+13
The very first page of the document should always be formatted using the "first page" settings in the page style, regardless of the page number set for that page. (cherry picked from commit 232885c66422ab8f05d86cfeac9b377a97462ae4) Change-Id: I49cb00cef8b1d10120349073dee1511657dc84d1 Reviewed-on: https://gerrit.libreoffice.org/41892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2017-09-07tdf#111891 unostyle: use default handler for non-page styleJustin Luth2-0/+6
LO 5.1 commit 664197d95becd516c3dac25a50439078ba61e051 introduced a handler for RES_TEXT_VERT_ADJUST to handle page styles, but that meant that the default handler was no longer called for frames (the only other item currently using RES_TEXT_VERT_ADJUST). Change-Id: I33827160fe64dc4cc2107afc26f7ac2e698007e1 Reviewed-on: https://gerrit.libreoffice.org/41538 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 10dc371d31f003ac3ed9b89ca1db95d36603603f) Reviewed-on: https://gerrit.libreoffice.org/41910 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-09-07tdf#104936 RTF export: implement ZOrder of TextFrames / shapesMiklos Vajna3-2/+56
This used to work by accident for the particular textbox, but broke with commit 38f2b8b3b16aab19a2564ec699d253d3dccecc3c (tdf#88811 SwXText::convertToTextFrame: handle shapes anchored to us, 2015-02-03), so write ZOrder explicitly, like other filters already do. (cherry picked from commit 4cde2a01be75552a0b7d37f65cc4134cb48fea26) Change-Id: Ie8f11f4ec77707fb5aec7a597544d589a99bf6ca Reviewed-on: https://gerrit.libreoffice.org/41942 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-09-07Resolves: tdf#112145 pdf export of editengine highlight color fails sometimesCaolán McNamara2-4/+4
When setting a fill or line color on the outputdevice, put it back to its previous setting when finished with the record, PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D was the one in this case but protect the other similar ones here too Change-Id: Ifb9b182d72bb6c48a9d9480270fde4384be6291e Reviewed-on: https://gerrit.libreoffice.org/41762 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-09-05tdf#108765 DOCX: after import, allow default styles againJustin Luth1-0/+4
During import, we don't want LO's style defaults to intermingle with those of MSO [1]. However, if any styles are NOT defined by the document itself, then we want to use that new style with appropriate defaults. For example, if footnotes were never used, that style might not be defined in the .docx file. Later, if a user inserts a footnote for the first time, we certainly don't want the "default paragraph" settings. Instead, we want the default "Footnote" settings. [1]: see commit b95d203bc17c83ec0fe5139f519d53ed1d842d3a Change-Id: Ia71490e795885d3c16f764d0f716f6499765cb67 Reviewed-on: https://gerrit.libreoffice.org/41546 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit c071e5f6858661881065cbb4e644c37c8e94ccc6) Reviewed-on: https://gerrit.libreoffice.org/41769 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-09-03tdf#112169: Crash while saving character background color to DOCXTamás Zolnai2-0/+5
Reviewed-on: https://gerrit.libreoffice.org/41857 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 242688f3b4fc7228637837e0f4fec3da71ac2710) Change-Id: Iff12b9587b639166caef86f895fb841e83596817 Reviewed-on: https://gerrit.libreoffice.org/41866 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-01tdf#100492 Skip empty shapes in SVG exportVasily Melenchuk2-0/+34
Some shapes do not contain polyline and meanwhile contain start/end arrows. This is causing unexpected line endings appear in export. TODO: Unittest is disabled, since XML parsing returns only root node without children. So XPATH assert fails. Change-Id: Ibc28f12b0f3838065978a674f0debe8e1b8103e9 Reviewed-on: https://gerrit.libreoffice.org/41684 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2017-08-29tdf#104937 RTF import: \trwWidthA is an absolute valueMiklos Vajna2-0/+56
Not a relative one, so similar to \cellx need to convert these before sending the value to dmapper (which expects an OOXML value, which is always relative). The result of the correct type is that the relative width of the last cell in the table row is smaller, so other cells are wider -> they now reach the expected width. (cherry picked from commit e6ec0794858df1444f43659b568119bf126a90e6) Change-Id: If282eb9a5ec644b38e552b5a66fc64a93538f216 Reviewed-on: https://gerrit.libreoffice.org/41676 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-24tdf#108943 RTF import: handle \tx inside a list level definitionMiklos Vajna2-0/+43
\tx in the list level definition has a different meaning (we should map it to the ListtabStopPosition UNO property), compared to when it's used as a plain text property. (cherry picked from commit 57d535302596a62be914bee49d7b1df1fc622a65) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I7b98ae3d82bbd2c4ad41d0d7f4ad50525c4d0f9a Reviewed-on: https://gerrit.libreoffice.org/41457 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-08-19tdf#98700 docxexport: don't force on ParaKeepTogetherJustin Luth2-0/+9
The mere presence of SvxFormatKeepItem was ENABLING it during export, without checking to see if it was actually turned on or off. Both DOC and RTF check the value, and set accordingly, so do the same for DOCX. Merely toggling the setting on and off is enough to create the property, so this is a nasty bug that only affects inquisitive people. Change-Id: I02d83a255f5b4ff8c5124302a52a3126dad40b67 Reviewed-on: https://gerrit.libreoffice.org/41318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2017-08-17tdf#107480 RTF import: fix HTML automatic spacing in stylesMiklos Vajna2-0/+23
\htmautsp changes the meaning of \sbauto and \saauto, but the auto keywords may appear early in style definitions before \htmautsp arrives. This wasn't a problem before commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17), as there the right auto keyword interpretation was repeated as direct formatting. So fix the regression by not deduplicating these keywords, which brings back the correct layout. A larger rework is necessary in the future to delay the parsing of the stylesheet table, that would be a cleaner approach. (cherry picked from commit 9dd82d0d68065ab95e20a1a489f4130299a8669e) Change-Id: I783d2175483bc80ead0a511ad15c4b75e4ab663c Reviewed-on: https://gerrit.libreoffice.org/41203 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-08-02tdf#107723 Import font name from text portions in shapesSamuel Mehrbrodt2-0/+11
Change-Id: Ib9b73b5c05ec2e6846ea3adc950ccab5d1c0a9b0 Reviewed-on: https://gerrit.libreoffice.org/40439 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 178b361c6379bc963c8a48925f1807c583f2d09f) Reviewed-on: https://gerrit.libreoffice.org/40528 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-02tdf#108944 writerfilter: fix missing footnote separatorJustin Luth1-0/+3
Fix regression from e79ef12b7a904f17d4147fa409d055c12b70f952 tdf#107033 DOCX import: fix unexpected missing footnote separator. Initially related to tdf#68787. If HandleMarginsHeaderFooter was called twice, then it automatically would have disabled the separator. Clearing the HasFtn/HasFtnSep flags also shouldn't be run when in the footnote sections. Change-Id: I00cbd1cbc8dc86edf426f852c59c3f943e373b13 Reviewed-on: https://gerrit.libreoffice.org/40551 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 6f57c09aadd40009173f8ae3654004dd0cad9fb8) Reviewed-on: https://gerrit.libreoffice.org/40588 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-02tdf#109790 RTF import: keep remembering paragraph style between \cell and \rowMiklos Vajna2-0/+24
This is the opposite situation as tdf#44715, where the problem was that style was not reset between in-cell paragraphs. Here we don't want to reset the paragraph style too early, so that direct (character) formatting isn't lost just because the theoretical end-of-row character would not have the same direct formatting. (cherry picked from commit aaa6a5202a447fb4e86d5f016d8e79fbc34a3ed7) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx writerfilter/source/rtftok/rtfdocumentimpl.hxx Change-Id: I9bb54f37804f5889fb10504ae890362a2e42122c Reviewed-on: https://gerrit.libreoffice.org/40625 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-01tdf#109228: FILESAVE: ODT: Anchor changed to 'to character' after RTTamás Zolnai2-0/+6
Ignore frames without names, becuase the code does not handle them well. It does not affect those use case for which the deduplication code was added. Reviewed-on: https://gerrit.libreoffice.org/40222 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 615c2a2c54d3e7aefb4986ae7d8de81a42022988) Change-Id: I08ad062b8b11cc06323467329d8c4e97bc4932dd Reviewed-on: https://gerrit.libreoffice.org/40232 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-27tdf#108951 RTF import: fix missing custom bullet typesMiklos Vajna2-0/+47
Regression from commit f528f9499bd91b700c549575e88fa102cfffede9 (tdf#106953 RTF import: fix missing paragraph left margin, 2017-05-16) where I fixed the parent of the ooxml::CT_NumPr_numId token at one place, but forgot to adapt RTFDocumentImpl::popState() accordingly. (cherry picked from commit 1e87e93132f808ab95eab932b36bfe40d3cc607a) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Ibddd2486a50f284e11c2cd96339e7140b427aae1 Reviewed-on: https://gerrit.libreoffice.org/40385 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-27tdf#109202 Add mimetype to image elementSamuel Mehrbrodt2-0/+11
Browsers don't recognize base64 svg if the mimetype is missing. So we add the image mimetype to our flat odf export, which the xhtml export uses and transforms it into an xhtml document. Change-Id: I21aafdb97b4104e14e2d40abda73a526bb37041a Reviewed-on: https://gerrit.libreoffice.org/40371 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Reviewed-on: https://gerrit.libreoffice.org/40478 Tested-by: Jenkins <ci@libreoffice.org>
2017-07-20tdf#109080 First page header/footer ODF (1/2)Luke Deller3-0/+31
The proposal to add <style:header-first> / <style:footer-first> to the ODF standard has not yet been accepted, so meanwhile we should be using an extension namespace for these elements. This first commit (intended for backport) adds support for reading <loext:header-first> / <loext:footer-first> Change-Id: I616b6a0acaead9d767ae7d119e539b865f3a6774 (cherry picked from commit bff8cd3d52223002263dcb8c09758c4fc753b6e3) Reviewed-on: https://gerrit.libreoffice.org/40227 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>