summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2018-05-11tdf#117403 RTF import: fix lost cell border of merged cellMiklos Vajna1-4/+31
If two source cells have different border types, then Writer takes the second, Word takes the first. So mimic the MSO behavior explicitly in dmapper. (cherry picked from commit 42b32321381126ad70700424b8970dbc45a843f5) Change-Id: I25adc62e024a929216c7b05fec44e1f602f28285 Reviewed-on: https://gerrit.libreoffice.org/54089 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-05-04tdf#116801 DOCX import: char styles have no IsAutoUpdate propertyMiklos Vajna1-2/+2
See sw/source/core/unocore/unomapproperties.hxx:447, UNO_NAME_IS_AUTO_UPDATE is part of the COMMON_PARA_STYLE_PROPERTIES define. So it's not "list styles don't have this", but "only paragraph styles have this". (cherry picked from commit ebcf27d419e41a497242c98fcfec08a2088c0720) Change-Id: I1c256b087cdc2e7e341f55d717ef8e678fc69fb4 Reviewed-on: https://gerrit.libreoffice.org/53773 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-05-04tdf#117268: treat erroneous \itap0 the same way as Word doesMike Kaganski1-0/+7
... 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/53813 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-26tdf#117246 RTF import: don't loose page breaks inside nested groupsMiklos Vajna1-0/+9
Regression from e3f254ab8211fbab7541cde2100a35c875b0c240 (RTF import: fix spurious page breaks at doc end (related: rhbz#1065629), 2014-02-27), the problem was that now we update the parser state to remember the next section break should set the break type of the current section to "next page", but this state should be remembered once the RTF group ends ("}" character), otherwise \page will be represented with a continuous break, i.e. lost. (cherry picked from commit 4a93b46e4652e73ed3460e4c66999d94e50db4b7) Change-Id: I69a8413f45e17e11d6d676c7bfd13ca7560b4d43 Reviewed-on: https://gerrit.libreoffice.org/53506 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-26tdf#116841 RTF import: fix default value of left para margin from numberingMiklos Vajna1-0/+5
The left mragin value is usually spelled out in RTF and DOCX, but this bugdoc used the WW6 RTF markup to declare the numbering rules and there the margin value was missing. This also allows me to partially revert the changes to testTdf106953 from commit 56a695fddb915bcba13b088b5b2b4e0841d4acbc (tdf#112211 RTF import: fix unwanted direct formatting for left indents, 2017-09-26). (cherry picked from commit 810364653b8e5ef8578ae7c9fc2e3b9196e7cdc4) Conflicts: sw/qa/extras/rtfexport/rtfexport3.cxx Change-Id: I9902f2f9ada4080cb4d873624ae9824342c6ee77 Reviewed-on: https://gerrit.libreoffice.org/53433 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-25tdf#116976 DOCX import: fix rel size of shape after bitmapMiklos Vajna1-2/+8
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/52970 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-04-10tdf#116410 DOCX import: restrict increased object spacing to multiple shapesMiklos Vajna1-0/+4
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/52022 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-26tdf#116269 RTF import: implement reverse deduplication for listsMiklos Vajna5-2/+104
This is the same mechanism that was added in commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17), except that here the reference is a list definition, not a paragraph style. Also, this commit only implements the part that inserts explicit defaults for not repeated properties, not the actual deduplication, as that already works at a dmapper level. (Saving the bugdoc as DOCX, it's visible in document.xml that DOCX marks these defaults explicitly: <w:ind w:left="0" w:right="-6" w:firstLine="0"/> but RTF does not, so the right place to fix this is in the tokenizer.) (cherry picked from commit 0f0a80123d970ef6f3f8269619813e5277fff4df) Change-Id: Iec88d9bf1032d1d89194bd272500d6780c3c2224 Reviewed-on: https://gerrit.libreoffice.org/51690 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-23tdf#113182: DOCX filter: new values of wrap property in text boxSerge Krot1-1/+6
Added support of "none" and "through" values of the w:wrap poroperty in the text box. Change-Id: I83f0c9e8162e93bf457f228d49d3b426050d4dc6 Reviewed-on: https://gerrit.libreoffice.org/51396 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit be02ce71f2ee694fa2609a7a630853c24acfbfff) Reviewed-on: https://gerrit.libreoffice.org/51431 Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de>
2018-03-20tdf#116472: import "auto" border color as blackMike Kaganski1-4/+5
Since commit fe6da2feb57c3d5e355a36f6b8ac09b48412ff39, "auto" color is supported in OOXML import. Since ODF doesn't support "auto" color as border color, just convert "auto" border color to black on import, like is done in GetLineIndex in ww8par6.cxx. Incidentally, this also fixes a problem in RTF import, where we used to import black borders ("\red0\green0\blue0;" entries in color table) as 0x000001 ("\red0\green0\blue1;") - see fixed tests in rtfexport2.cxx. Change-Id: I4f5e720d215b51c8a43dc7c58f338741bd608efc Reviewed-on: https://gerrit.libreoffice.org/51519 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/51585 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-20tdf#116179 Support reading "auto" colour from docxLuke Deller11-12/+51
In docx a colour value is represented as a 6-digit hex RGB value, or alternatively the word "auto" to represent automatic colour. - Add support for reading the value "auto" as COL_AUTO. Previously this would be read as if it were a hex value, stopping at the letter 'u' which is not a valid hex digit, resulting in the colour 0x00000A - a very dark blue, which looks close enough to black that it went unnoticed for a long time :-) - Remove code which tried to handle this wrong 0x00000A value, including the constant OOXML_COLOR_AUTO, as it is no longer needed and will cause surprises for anyone who really wanted this exact shade of dark blue - Fix unit tests that were checking for 0x00000A Change-Id: I6000070341931147ff9341ad6281cd3b53c02b46 Reviewed-on: https://gerrit.libreoffice.org/50995 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/51461 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-03-15tdf#115861 DOCX import: avoid last-paragraph removal when discarding footerMiklos Vajna2-1/+19
Discarding header/footer is necessary when the document or section settings request to ignore first or even headers/footers. In the bugdoc case settings.xml didn't opt-in for different even/odd footers, but there was an even footer to be ignored. Handle this state at two more places, so we don't end up in a situation where we ignore the footer but not its "remove last (empty) paragraph at the end of the footer" action. Also make the debug dumper for text ranges more robust to have a working token dump when we try to get the string for a table. (cherry picked from commit 49cf733effc56c09c5e2eb023120c2d3532b5b3d) Change-Id: I6395f37aa40c42304e2c918d87dadecb21e9d378 Reviewed-on: https://gerrit.libreoffice.org/50884 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-03-13forcepoint #24 back() on empty vectorCaolán McNamara2-0/+8
Thanks to Antti Levomäki and Christian Jalio from Forcepoint. Change-Id: Idb6723b53a1ae8aaca80847bfe643bc4abaedd21 Reviewed-on: https://gerrit.libreoffice.org/51122 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-03-12forcepoint #21 pop on empty stackCaolán McNamara1-1/+4
Thanks to Antti Levomäki and Christian Jalio from Forcepoint. Change-Id: I25b1c6361fb0a3ae6b01f2be870c9e1b49bf5b84 Reviewed-on: https://gerrit.libreoffice.org/51115 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-28tdf#115715 RTF import: ignore zero para indents in styles without parentsMiklos Vajna2-5/+29
The only reason the DOCX equivalent of the bugdoc was imported correctly is that these default zero margins are simply missing from the DOCX markup, suggesting Word ignores them. We now do the same, this way the stripped down document's 3 paragraphs all have different margins as expected. (Also rework the testTdf112211_2 testcase to test the original problem better: I verified that the layout is unchanged before/after this patch.) (cherry picked from commit 59363e639b67a8acbd6da240635de47921b2c955) Change-Id: I88d56c27c19e070e983c3392f99bca96597cd56e Reviewed-on: https://gerrit.libreoffice.org/50435 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-27forcepoint #10 pop empty stackCaolán McNamara2-1/+7
Change-Id: I96452a86187a6b03251614625445d1b18a5ee218 Reviewed-on: https://gerrit.libreoffice.org/50358 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-26tdf#115883 DOCX import: catch RuntimeException from SwXFrameMiklos Vajna1-1/+8
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. Change-Id: I49a78ce8d41b4e1cc7d23721d5dc70f7550c94af 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) Reviewed-on: https://gerrit.libreoffice.org/50348 Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-21tdf#112694 DOCX import: handle <w:titlePg> when turning on follow style headerMiklos Vajna2-11/+10
Commit 17e51f427b3f0cec74ac8e0a1b3f51189006ae6f (DOCX import: first page header should always set default headers as well, 2014-11-21) turned on header/footer of follow page styles of first page styles when the first page style had the header/footer turned on, but failed to consider if <w:titlePg> is present or not. When it's not present, the first page header/footer should be ignored. An additional problem is that by the time DomainMapper_Impl::PushPageHeaderFooter() is called, <w:titlePg> is not parsed yet, so we can't act accordingly. Fix the problem by moving the check to SectionPropertyMap::PrepareHeaderFooterProperties(), which runs at the end of the section properties, where all required info is available, there we can just check for m_bTitlePage. This allows reverting the two changes to existing testcases in CppunitTest_sw_ooxmlexport6 from the original commit as a side-effect. (cherry picked from commit a16275a3647a2fba9913ed23e8329e45b02123b4) Change-Id: Ic628adab99a4b148fcfd66ca39d0cf81eb7dd9f1 Reviewed-on: https://gerrit.libreoffice.org/50027 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-16tdf#113258 DOCX import: fix beforeAutospacing for shape first paragraphMiklos Vajna3-0/+32
Commit c761df1e42fd11acc5fc05b0baacd803c3788ca6 (tdf#84678 DOCX import: fix handling of textbox margins, 2016-10-25) uncovered a previously harder to notice problem that single-paragraph shapes have an incorrect upper paragraph margin for the first paragraph. Now that the shape margins are correct this problematic paragraph margin causes crop of the shape text. Fix the problem by adapting the DOCX import to the WW8 import's SwWW8ImplReader::AppendTextNode() (the "If this is the first paragraph in the document" part), where it seems the first paragraph is not only the literally first paragraph in the document, but also the first paragraph of shapes as well. (cherry picked from commit f737c9386a605cb7d8c9dbc210c557f98f6cdc19) Conflicts: writerfilter/source/dmapper/DomainMapper.cxx Change-Id: I9d99b9cfabae2c9a7c33eefefb5a9f008669e93d Reviewed-on: https://gerrit.libreoffice.org/49626 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-16tdf#115719 DOCX import: increase paragraph spacing for anchored objectsMiklos Vajna7-29/+135
... 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.) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: Ibad28d27e4bcbe1991a3be1c686064e18e9ffa4d Reviewed-on: https://gerrit.libreoffice.org/49802 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-09tdf#115242 RTF import: order numPr before other paragraph propertiesMiklos Vajna7-11/+48
So that paragraph properties inherited from numbering properties can be properly overwritten with direct formatting, even when we have to take style deduplication into account. The OOXML tokenizer already did this, writerfilter::dmapper::DomainMapper::sprmWithProps()'s NS_ooxml::LN_CT_NumPr_numId depends on this, so adapt the RTF tokenizer accordingly. (cherry picked from commit 03cee02464f230a2efa67d131c137f32fe540052) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Iec6026d146f08a9d06266763d01ed626a2d1f3d1 Reviewed-on: https://gerrit.libreoffice.org/49355 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-07tdf#114217: Consider relative width when importing floating tableMike Kaganski3-3/+12
Unit test included Change-Id: I8e3338d7df431bd016caa4e06e684fbd189127c4 Reviewed-on: https://gerrit.libreoffice.org/49324 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 76d6fcd05c630a928dd3bd028d560792d9c904ca) Reviewed-on: https://gerrit.libreoffice.org/49333 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-02-07rtf: null-derefCaolán McNamara1-21/+30
Change-Id: I9c4510cb91e2572a3ab2b62497dc4dd9fd1119c8 Reviewed-on: https://gerrit.libreoffice.org/49341 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-30DOCX import: handle horizontal flip of bitmapsMiklos Vajna1-0/+11
Horizontal mirror on the UNO API level, mirror on the vertical axis internally. (cherry picked from commit 4bdbb5502f5995727017e22bb8a74b9f45552067) Change-Id: If142274a8f81a6875059a2651af6d8470870a36a Reviewed-on: https://gerrit.libreoffice.org/48893 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-30tdf#115155 RTF import: fix left indent handling inside list definitionMiklos Vajna2-2/+12
This used to work in the past only because the left indent was also imported as a direct paragraph formatting, but that is not the case since left margin of lists is deduplicated during import after commit c9dee880d88305312094b311abdae155e452bf14 (tdf#104016 RTF import: deduplicate before text indent from numbering, 2017-12-05). (cherry picked from commit 7655001a65a250ea7cd70f2efcc78037b5a9813f) Change-Id: I1c9be30700c51ef97fb274e8781d6008db3121d8 Reviewed-on: https://gerrit.libreoffice.org/48888 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-27tdf#115153 writerfilter: RTF import: fix vert orient of Word 6 shapesMichael Stahl1-2/+8
The bugdoc is affected by the change of default vertical alignment; apparently it's not even possible to set the vertical alignment of a Word 6 drawing object (\do) so we have to set the Word default. (regression from c79467ba954987f1d239c594c1e1b3af3f5515f6) (cherry picked from commit dc16cc0492ba96007078cc285fee1a8d03f40d55) tdf#115153 the missing test document (cherry picked from commit b7f12d8fd7493a7201ae5fd97e80e0296538f136) Change-Id: I4084a7a7e2a55f864cb569e04632e034d59eefdb Reviewed-on: https://gerrit.libreoffice.org/48524 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-23tdf#113946 add 'topMargin' to GraphicHelpers importPatrick Jaap1-42/+44
The case '...topMargin' was not caught for setting a relative vertical position in GraphicHelpers. The test file demands a '7' here, which stands for 'PAGE_FRAME'. The '7' was overwritten in GraphicImport in case 'LN_CT_Anchor_positionV' by a call of 'resolve'. For a better overview a switch is inserted here. Change-Id: Ie98209fe445ecbba15c3dafe5980ca52421126f8 Reviewed-on: https://gerrit.libreoffice.org/47908 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-09tdf#114703 DOCX import: apply num defaults only to abstract numsMiklos Vajna2-16/+20
Numbering definitions have two levels: abstract ones and overrides. The full definition is a merge of the two. Make sure that when defaults are added to the numbering level properties, these are only added for abstract ones, otherwise overriding e.g. the start value of a level will also pull in other, unwanted default properties. (cherry picked from commit a6ec829055ab0b9d223979ae5f90d158d5549db1) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: If0273ebc6b49476df17b09d636489a3bfb717334 Reviewed-on: https://gerrit.libreoffice.org/47653 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-04tdf#112443 disable off-page content positioningPatrick Jaap1-1/+1
Disable the positioning for objects that are completely off-page. During import, LO writer forces content always back to the page and causes unwanted content on the page in constrast to MSO. To achive this the top/left position of the content is compared to the bottom/right border of the clipping region. A new compatibility flag OFF_PAGE_POSITIONING is introduced for legacy rendering of legacy documents. A unit test demonstrates the issue. It resolves tdf#112443. Change-Id: I263c129f9f09ed909ad777a34f8b9ffc84d871e4 Reviewed-on: https://gerrit.libreoffice.org/43313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 8d62b79f168180c6992eb483ec864d473050635f) Reviewed-on: https://gerrit.libreoffice.org/47260
2017-12-19tdf#113547 DOCX import: fix handling of stub numbering overridesMiklos Vajna2-2/+11
Regression from commit c72a1a74b5b1064fc9cdf9994b11fce26d866e26 (Related: tdf#112211 DOCX import: fix handling of missing first ind in <w:lvl>, 2017-09-19), now that a numbering level can have default properties, we need to differentiate between the case when the level has real properties or it has only default properties. Merging of properties is not necessary when the abstract numbering has properties, but the "override" has default properties only. (cherry picked from commit a0bf35f7c0eedbe04783285a4a7071e68baeb7fe) Change-Id: Idbcbd0f66932514612e11fe82377f2b68ac9e403 Reviewed-on: https://gerrit.libreoffice.org/46777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2017-12-19tdf#114303 writerfilter: RTF import: fix default vert orient of shapesMichael Stahl2-5/+5
The bugdoc is affected by the change of default vertical alignment, it doesn't contain anything that would set the VertOrient property. (regression from c79467ba954987f1d239c594c1e1b3af3f5515f6) Setting the AnchorType property before adding the shape is actually not as effective as expected: it does cause the old default vertical alignment to be used, but does not actually set the anchor type because there is no anchor position and so SwXDrawPage::add resets the anchor type to FLY_AT_PAGE; it's less confusing to set the VertOrient property instead. Change-Id: Ib0a71d20d479776ab5e4c21c3dd13c0c307a045e (cherry picked from commit 706728df38830536354ba902978cc8297f787dfc) Reviewed-on: https://gerrit.libreoffice.org/46731 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-13tdf#113183 DOCX import: fix not independent text box alignmentsMiklos Vajna1-0/+4
The alternative would be to clear them in writerfilter::dmapper::DomainMapper::getPositionOffset(), but that runs before writerfilter::dmapper::PositionHandler::lcl_sprm(), so it would be too early. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx (cherry picked from commit 312cecf11c1ab8acef6ce08ccb90d5322836b08f) Change-Id: I287b9a4025c4b1844ae467c48815b5d7ffe3f98e Reviewed-on: https://gerrit.libreoffice.org/46322 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-07tdf#104650 Creating guard to reset status indicatortagezi1-3/+22
Change-Id: Ic1e79badedc031a588c0b07958002ad7c558ba82 Reviewed-on: https://gerrit.libreoffice.org/45987 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 58e4b36ace484f2743a3b9919d830c175464b05d) Reviewed-on: https://gerrit.libreoffice.org/46006
2017-12-06tdf#104016 RTF import: deduplicate before text indent from numberingMiklos Vajna1-0/+1
We already deduplicated first line indentation since commit 3915bf2dc877d5f1140798e24933db0f21386a4a (tdf#95376 DOCX import: fix incorrectly indented tab stops, 2016-01-26), the same is necessary for before text indent. (cherry picked from commit c9dee880d88305312094b311abdae155e452bf14) Change-Id: I11394881d116f76922c1a706dd14b6a7cdf3c89f Reviewed-on: https://gerrit.libreoffice.org/45929 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-24loplugin:unnecessaryparenStephan Bergmann1-1/+1
Change-Id: I5a1fa919b7fe8c91ac886a796426b5671573dbb6
2017-11-24writerfilter: fix loplugin:simplifybool warningMiklos Vajna1-1/+1
Change-Id: I23806d8839bc6227311cb5f5d39c779f23e72e83
2017-11-24pick a default during fuzzingCaolán McNamara1-4/+2
Change-Id: I98d99465d32b553ae55d76c99125f83e686ea2a1 Reviewed-on: https://gerrit.libreoffice.org/45215 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin1-1/+1
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-22drop duplicate methodCaolán McNamara3-9/+9
Change-Id: Idadd0a64e41cd02f5167b275081c3576a6224b12 Reviewed-on: https://gerrit.libreoffice.org/45075 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-22RTF filter: drop now redundant astyle.optionsMiklos Vajna31-7278/+7531
I (tried to) keep the RTF filter style consistent locally with astyle in the past, but now that's redundant when we have an enforcing clang-format mechanism in place. So drop the astyle config and switch to clang-format in the RTF filter case. To minimize backport pain, do this shortly before the libreoffice-6-0 branch-off. Change-Id: I708dbeb0b5ad2afacc90029ee5abba9495f4601f
2017-11-20look for =() in loplugin:unnecessaryparenNoel Grandin2-2/+2
Change-Id: I4f9b71ff7767e90987bb40358fc46ed5d1d571d0 Reviewed-on: https://gerrit.libreoffice.org/44944 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-19tdf#86087 DOCX Import link as relative if preferredSzymon Kłos2-1/+3
Change-Id: I92e273aa57db8b4b9779d8d784c5bbad42d720e5 Reviewed-on: https://gerrit.libreoffice.org/44735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2017-11-18loplugin:flatten in toolkit..writerfilterNoel Grandin1-109/+111
Change-Id: I4da2a768b6b55869c3a3d6f8a8d50dc018709acd Reviewed-on: https://gerrit.libreoffice.org/44865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-13Fix typosAndrea Gelmini2-2/+2
Change-Id: Ia544298334364ece3b3963a4adc00c5e01189b91 Reviewed-on: https://gerrit.libreoffice.org/44654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-10tdf#43017: Support for DOCX hyperlinks character propertiesVasily Melenchuk3-13/+45
Here goes a bunch of related changes: 1. Create new character style based on current character properties 2. Apply created style to hyperlink object 3. Fixes to predefined style names usage in w:rPr 4. Disable style usage for hyperlinks in TOC: they will receive later anoter styles Change-Id: I1a228992eb7c1e259a6a811aa7f959debaae4f35 Reviewed-on: https://gerrit.libreoffice.org/41784 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-09loplugin:unusedfieldsNoel Grandin2-4/+0
Change-Id: Ie8a2c6462ddc708140e725847199c8234ab6b592 Reviewed-on: https://gerrit.libreoffice.org/44528 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-09tdf#112352 ooxmlimport: ALWAYS treat 1st nextpage w/cols as contJustin Luth1-1/+1
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>
2017-11-07tdf#113550 RTF import: fix incorrect text indentMiklos Vajna1-0/+3
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. Change-Id: I01b202f0241b02816b2b392326737b1150caffc2 Reviewed-on: https://gerrit.libreoffice.org/44385 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-06sw: prefix members of SwScannerMiklos Vajna1-1/+1
Change-Id: I441876e73793e07d78f1eadb2b21c282845298c3 Reviewed-on: https://gerrit.libreoffice.org/44345 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-06loplugin:constparams in various(2)Noel Grandin4-5/+5
Change-Id: I533a7eb724b15e168a28dc92cd5962a39bc96e7c Reviewed-on: https://gerrit.libreoffice.org/44313 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>