summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper_Impl.hxx
AgeCommit message (Collapse)Author
2019-10-31tdf#125038 DOCX import: better support for linebreaks in IF fieldsMiklos Vajna
IF fields can't contain linebreaks, so instead of just calling finishParagraph() and hoping it does something sane, explicitly handle them: remember the properties and perform the call only once the field is closed. Change-Id: I676aa2c83f12cb600829177a0eb25558822b1d94 Reviewed-on: https://gerrit.libreoffice.org/81847 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-10-28Related: tdf#125038 DOCX import: fix unexpected MERGEFIELD result inside IFMiklos Vajna
The problem is that DOCX supports nesting MERGEFIELD fields inside IF fields, while SwHiddenTextField only supports a single string as a condition. This means in case there are MERGEFIELD fields inside the IF field, those fields will be inserted to the doc model before the IF field, exposing their value, while Word only uses their value during the evaluation of the IF expression. Fix the problem by inspecting the parent field command before setting the MERGEFIELD result. Change-Id: Ieca098f16f756bab5d23f219fa4ca30d077d4bb7 Reviewed-on: https://gerrit.libreoffice.org/81615 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-10-28related tdf#99602 writerfilter TODO: subscript - use CharStyle fontsizeJustin Luth
GetAnyProperty was missing a check for character style properties. This patch depends on commit 875793d841165aaaaefa2c34b855e8f0f8a8c214 related tdf#99602 writerfilter TODO: subscript - use ParaStyle fontsize and on commit 5e97d1a57717f8dbf69b987d2bda8616972eec52 NFC writerfilter: preparation for adding CharProps to GetAnyProperty Change-Id: I4e28589917e41fa545d5aab05f97a67502486136 Reviewed-on: https://gerrit.libreoffice.org/80216 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-10-28tdf#121441 improve DOCX footnote importJan-Marek Glogowski
ODF represents footnotes by using a fixed string for the label (text:note-citation) and a flexible body (text:note-body) for the representation in the footnote area. The only formatting of the footnote reference is done by changing the character class assigned to the anchor (which is the text range of the label in the text). For most of the setting, the footnote area label just follows the footnote body character formatting. OTOH MS Word has no such "restrictions". It handles the label just as concated, formated text runs with the same style. On top of it, DOCX completely splits the reference from the footnote area part, including its own label, which can easily result in completely different labels for the footnote and the reference, as I happened to repoduce for my test documents. At this point it's quite obvious that for any complex footnotes, LibreOffice won't be able to represent them. IMHO ODF should offer the same flexibility for the label and the body and allow all the normal formatting in the label. I'm not sure that getting footnote area and reference label out of sync is a good idea. So this patch tries to improve the situation in the current constraints set by ODF. 1. It imports all runs of the whole custom DOCX footnote label. 2. If any run contains a symbol, switches the font of the whole label to the referenced symbol font. 3. Completely ignores the label of the footnote area and overrides the font of the footnote area label with the font of the reference. Other problems I found while testing this code: 1. LO edit field correctly gets the font and character set, but displays empty glyphs. So no real way to edit the label. 2. Normally the font of the footnote area label would follow the footnote font. This doesn't work anymore when the font is overridden for the label. Setting the whole font of the label to Symbol doesn't seem like a good solution either. 3. You can't mix multiple fonts, or even symbols and letters, as you can just select one font for the label. 4. You can't change the footnote are label font at all and since it doesn't follow the footnote area anymore, there is basically no way to change it. Change-Id: Iafa16936be81e1866c610ebf0f71ab15e74dd059 Reviewed-on: https://gerrit.libreoffice.org/81370 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-10-23writerfilter: add config to import all fields as generic, incl. commandsMichael Stahl
Change-Id: I02d178de3672200b69e60ba5841c993fa0d797f9 Reviewed-on: https://gerrit.libreoffice.org/80076 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-12tdf#127741 DOCX import: format hyperlink with Default character styleTünde Tóth
according to correct hyperlink handling, avoiding various editing and layout problems; "sticky" and not easily removable character style around the hyperlink and multiple blue hyperlink colors. Set also Visited/Unvisited link character styles when the style of the hyperlink is not the requested "Internet Link". Change-Id: I3d7ba8dd225c693cc9f521b37767cf1e1e09d7c0 Reviewed-on: https://gerrit.libreoffice.org/80449 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2019-10-09tdf#120336 DOCX import: fix page break after tracked deletionLászló Németh
Actual text content lost its page break, when the last paragraph of the section was empty and preceded only with tracked deletion. See also commit b696600821d8aafb63b6a88016d299ef89478f56 "n#766481 dmapper: don't import fake paragraph containing sectpr only, take two" Change-Id: I6b1c47da2b618f10ca4887f050469f94efa2a7cb Reviewed-on: https://gerrit.libreoffice.org/80540 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-10-09NFC writerfilter: preparation for adding CharProps to GetAnyPropertyJustin Luth
...for tdf#99602 specifically, but I've intended to do this for a long time. Currently GetAnyProperty doesn't look in Character Styles for the requested property. But it should. GetPropertyFromCharStySheet can re-use a lot of the code for GetPropertyFromStyleSheet, so split that up and explicitly identify the existing function as ParaStyle. Change-Id: I9843153a6c09a10d63a575cb1f35a56c21c9cb9c Reviewed-on: https://gerrit.libreoffice.org/80180 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Miklos Vajna <vmiklos@collabora.com>
2019-10-09loplugin:redundantpointerops check other pointer typesNoel Grandin
as well as unique_ptr Change-Id: I54842bca161ee460fb96c46ca31b6f9c0a7dbbdf Reviewed-on: https://gerrit.libreoffice.org/80455 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-03loplugin:unusedmethodsNoel Grandin
Change-Id: I9790d053248ae6bd58ecc026c774014c4e5e04aa Reviewed-on: https://gerrit.libreoffice.org/80115 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-02loplugin:stringadd in writerfilter..xmloffNoel Grandin
Change-Id: Ib5292f4c702cc1e2994c736250a93e6fb18d1a20 Reviewed-on: https://gerrit.libreoffice.org/79988 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-28loplugin:constmethod in writerfilterNoel Grandin
Change-Id: I1e1c4e574e910ef9683520ae950b14eb4ebbc63f Reviewed-on: https://gerrit.libreoffice.org/79784 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-02tdf#124491 DOCX: import tracked changes of empty paragraphsLászló Németh
Formatting changes of empty paragraphs weren't imported. Change-Id: Ife7c83d52549563ab4c3a00a3daff4d8f4fa8386 Reviewed-on: https://gerrit.libreoffice.org/78233 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-08-24loplugin:returnconstval in test..writerfilterNoel Grandin
Change-Id: Iea7d15f0a54921514cc4b71c5dc8caaa2ee573c8 Reviewed-on: https://gerrit.libreoffice.org/78063 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20tdf#76260 cache next page style numberNoel Grandin
to speed up loading document with lots of footnotes. Takes the load time from 29s to 27.3s for me Change-Id: I911e4a7d7db8a2cdff1271d04e5535e76fd137a0 Reviewed-on: https://gerrit.libreoffice.org/77778 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-05Fix typosAndrea Gelmini
Change-Id: I63ab268d908477f8847b315f44f6ffd543b17794 Reviewed-on: https://gerrit.libreoffice.org/76969 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-25tdf#123627 DOCX import: fix relative hyperlinks to documentsTünde Tóth
Revert "tdf#86087 DOCX Import link as relative if preferred" This reverts commit 40acf8d6447065077acba9e800c56239f58c8262. Relative urls aren't converted to absolute urls, if the "Save URLs relative to filesystem" setting is checked. Change-Id: I209fa57e508dd425772e0019c1749a2bdc92e3ed Reviewed-on: https://gerrit.libreoffice.org/75863 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-07-21loplugin:referencecasting in writerfilter..xmlhelpNoel Grandin
Change-Id: I84954e35f285d968e3a83591c476b3c814c2a13f Reviewed-on: https://gerrit.libreoffice.org/76033 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-18tdf#125894: DOCX: import tracked changes in framesLászló Németh
Tracked changes weren't imported in frames, losing also the actual text content: also tracked deletion reappeared as normal text here, not only the tracked insertions. Change-Id: I5fc8135cfb7402ad71c5c24eae606aa7ed707dfc Reviewed-on: https://gerrit.libreoffice.org/75779 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-07-18Revert "tdf#123627 DOCX import: fix relative hyperlinks to documents"László Németh
This reverts commit 217a80fd205c7f61794c863898cb7cfd1a17e78f. Change-Id: Ic6c9c68dff800f0969187bdd46b51f8e71c0c618 Reviewed-on: https://gerrit.libreoffice.org/75825 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2019-07-17tdf#123627 DOCX import: fix relative hyperlinks to documentsTünde Tóth
Revert "tdf#86087 DOCX Import link as relative if preferred" This reverts commit 40acf8d6447065077acba9e800c56239f58c8262. Relativ urls aren't converted to absolute urls, if the "Save URLs relative to filesystem" setting is checked. Change-Id: Ie6d277e54e5f0136fed6e2804a56d29bc78e202f Reviewed-on: https://gerrit.libreoffice.org/75682 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2019-07-12MSForms: DOCX import of text-based date fieldTamás Zolnai
* Before the date content control was imported as LO specific date form control, but now I changed it to be imported into the compatible text-based date field. * Also removed the things stored in the grabbag, which are useless now. * Disabled some unit tests, I'll update them for the new field in other patches. Change-Id: Ide8f4b27ec6b2dbb182abb4180229736bf9c434f Reviewed-on: https://gerrit.libreoffice.org/75447 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-07-10tdf#121663 DOCX import: fix missing space in line numberingLászló Németh
Auto distance of line numbering is 0.5 cm, not zero. Change-Id: Ic451424bffb3eb3fe386bcaef5a476a5679faff2 Reviewed-on: https://gerrit.libreoffice.org/75317 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-07-05sw btlr writing mode: handle import from VMLMiklos Vajna
Instead of the character-level rotation added in commit 8738ded7bb1bb6262fe1038e310b5110407f4cfa (fdo#69636 VML import: handle mso-layout-flow-alt shape prop for sw frames, 2013-09-26) which does not work for multiple paragraphs. Change-Id: Ibe9a85d7f880846edfd1f4594c03b0617d83a965 Reviewed-on: https://gerrit.libreoffice.org/75104 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-29tdf#123460 DOCX track changes: moveFrom completelyLászló Németh
also with the paragraph mark, not leaving an empty paragraph at the original place of the moved text. Note: as desktop version of MSO does, but its online version leaves empty paragraphs interestingly. Change-Id: I03dda8997df3efbc82e936bd31a3813323e6b5ab Reviewed-on: https://gerrit.libreoffice.org/71382 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2019-03-13DOCX import: fix unexpected page break on autotext insert at end of docMiklos Vajna
The problem was that the page style was set on the first paragraph, which means a page break on the UI. So if you used a multi-paragraph autotext twice (insert autotext, press enter, insert autotext again) then you ended up with 2 pages instead of just 1. Fix the problem by tracking when we are in autotext import mode, and similar to pasting, don't set the page style in autotext import mode. Change-Id: I4fc551b3c1b999687eb80242e261f186fd1b6f13 Reviewed-on: https://gerrit.libreoffice.org/69214 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-11loplugin:indentation in writerfilter..xmloffNoel Grandin
Change-Id: Ibda157508e92ab5fb222daf79a38941c30a8057e Reviewed-on: https://gerrit.libreoffice.org/67611 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-09sw: DOCX: recognize TOC title during importSerge Krot
Change-Id: Ifa4fb59858d61580f76e3d104aa4caa6b5902d1b Reviewed-on: https://gerrit.libreoffice.org/64735 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-12-29tdf#120511 writerfilter: track inserted frame per sectionJustin Luth
The logic using IsTextFrameInserted is worried about whether a frame has been inserted before a table *in this section*, so track frame's existence per section, not per document. Change-Id: I8aa8a695b89727832e65535adae3fc3c94f95be5 Reviewed-on: https://gerrit.libreoffice.org/65720 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-30tdf#116989: disable conversion of tables in footers to floating for nowMike Kaganski
As the floating objects anchored to footers aren't wrapped around properly (they behave as if they are wrapped through unconditionally), which makes imported tables to overlap the page body text making the document unusable, let's just disable the conversion for the time being (until the actual bug fixed properly). Change-Id: I06c984ff7157b71fff2aa8122cc475a1199994c6 Reviewed-on: https://gerrit.libreoffice.org/62523 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-09-13loplugin:constfields in writerfilterNoel Grandin
Change-Id: Ibe380e1fb35d9defc478d459a988f9f6df13bf35 Reviewed-on: https://gerrit.libreoffice.org/60427 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-02tdf#104354 writerfilter: rewrite AutospacingJustin Luth
which also resolves a regression from tdf#113258. The previous code segments were being spread out all over the place. It all consolidates nicely in finishParagraph, and the code is much easier to read using the new GetAnyProperty function. Plus there were regressions creeping in. The mere presense of the Autospacing property normally, but not necessarily means that it is on. Verify that it is enabled, and update grabbag if autoSpacing changes. Additionally, support was added for a zero top margin for the first paragraph of the document. This will be too hard to backport since it depends on 150c12fc0fba2c2f4b08b4298678ee49676ebae0 from tdf#72560 and the many code fixes related to GetPropertyFromStyleSheets. Change-Id: Iaf1600fffea54e9800e215e89cad40006d5bcdda Reviewed-on: https://gerrit.libreoffice.org/59705 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2018-08-28writerfilter: not FirstParaInSection if IsInShapeJustin Luth
Since anchored objects can contain paragraphs, considering all of them to be "firstParagraphs" would generally be considered an incorrect result. Browsing through the existing uses of IsFirstPara.*InSection I didn't see any that looked like it should be considered true if IsInShape. Since this is the kind of gotcha that that the programmer should be aware of, add it directly into the function instead of requiring each use to have an additional qualification. The following ooxml unit tests match these conditions, but only one was fixed - the rest were unaffected since they just avoided adding/removing dummy paragraphs. fdo79540.docx - 5 tblppr-shape.docx - 5 ooo47778-3.odt- 5 ooo47778-4.odt- 5 textbox-rounded-corners.docx - 7 n780563.docx - 8 missing-path.docx - 10 floating-tables-anchor.docx - 10 tdf117805.odt - 11 (fixed - prevented extra section paragraphs) Change-Id: I841475e214c194a673321c1229d9254dd07205f8 Reviewed-on: https://gerrit.libreoffice.org/59659 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-08-16tdf#113608 DOCX import: don't use numbering of removed paragraphsLászló Németh
to avoid direct numbering of the unnumbered paragraphs later using numbering of the removed w:r-less paragraph incorrectly. Test file and clean up by Justin Luth. Change-Id: I821eed11f96e56e945aa88da03cc84e29322195a Reviewed-on: https://gerrit.libreoffice.org/59117 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-07-23tdf#72560 writerfilter: check my style, not default styleJustin Luth
The default style is only relevant if no style is defined for the paragraph, so it should not be hard-coded into any general operation. The intention of that code was to look for an inherited value, which can properly be found with GetPropertyFromStyleSheet(). Change-Id: Ie2805d2516b43b45e702ee860deabe89d50ec031 Reviewed-on: https://gerrit.libreoffice.org/57804 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-07-21writerfilter: default style is the last oneJustin Luth
Documentation states, and the examples confirm that "If this attribute (w:default) is specified by multiple styles, then the last instance of a style with this property shall be used." Change-Id: I17f06ab8944a39341a00c479117e978a01d6af7a Reviewed-on: https://gerrit.libreoffice.org/57510 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-07-17tdf#104354 DOCX import: fix paragraph auto spacing in tablesLászló Németh
Top margin of first paragraph of a table cell with auto spacing, and bottom margin of last paragraph of a table cell with auto spacing are zero (except in numbered last paragraphs), but LibreOffice set 14pt instead of them, resulting much longer tables. Following cases needed special handling: - auto spacing in style - direct top and bottom auto spacing - direct top and bottom margins - footnotes in cell paragraphs Change-Id: I462847616dd43b4ba30fae2c4eb99abb49bfb9a3 Reviewed-on: https://gerrit.libreoffice.org/57352 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-07-10tdf#79877 perf loading docx file, writerfilter/ improvementsNoel Grandin
this improves load time by 20%. We switch from shared_ptr to tools::SvRef to manage the objects I noticed some double inheritance like this: DomainMapper LoggedProperties Properties SvRefBase LoggedTable Table SvRefBase so to be safe I made all the ref-count-base-class inheritance virtual. Change-Id: Ia3de9733f5c6966e8171f43d083dcc087040b8cd Reviewed-on: https://gerrit.libreoffice.org/57022 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-27tdf#96099 Remove *HandlerPtr typedefs in writerfilterArkadiy Illarionov
See https://bugs.documentfoundation.org/show_bug.cgi?id=96099#c44 Change-Id: Ib2d828a66bc14faa4f341eec9210e1effdebd7c1 Reviewed-on: https://gerrit.libreoffice.org/56541 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-16tdf#117504 ooxmlimport: check paragraph props for actual styleJustin Luth
m_sCurrentParaStyleName sounds like a nice idea, and has been around since the initial fork, but by the time finishParagraph() rolls around, the chances that it is still accurate are rather low. Anything that contains a paragraph (like comments, textboxes, shapes, tables, flys etc) might have modified that value. This fix queries the current paragraph itself to see if PROP_PARA_STYLE_NAME is set, which it typically is by lcl_startParagraphGroup() except when IsInShape(). If it isn't specified, then fallback to the previous result, which still may not be accurate, but at least it won't be a regression. It is too late in the development cycle to look into fully eliminating m_sCurrentParaStyleName. I hope to investigate that in the 6.2 development cycle. Change-Id: I124688d864f553dd5778b3593f511cc41d31c262 Reviewed-on: https://gerrit.libreoffice.org/54085 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-14writerfilter NFC: save ConvertedParaStyleName, not WW8NameJustin Luth
and rename m_sCurrentParaStyleId -> m_sCurrentParaStyleName This is prep work for tdf#117504, where the value saved in m_sCurrentParaStyleId is not accurate. Since the actual value saved inside the paragraph properties is the ConvertStyleName(), lets use the LO-version of the style name, so that FindStyleSheetByConvertedStyleName() can be used for either the paragraph's PropertyValue or m_pImpl->m_sCurrentParaStyleName. Change-Id: I8aed80094417ea91f2515e666dc05ecbb021a128 Reviewed-on: https://gerrit.libreoffice.org/54084 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-28loplugin:countusersofdefaultparamsNoel Grandin
Change-Id: I84868b3115c534a8240394283cc3beedf8cb3a80 Reviewed-on: https://gerrit.libreoffice.org/53543 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-24tdf#106062 ooxmlimport: skip fake tab only on hanging indentJustin Luth
Export has changed, so that it only exports a tab when the footnote paragraph has a hanging indent. Adjusting the import code to match that change. Please test with MSO before flagging this patch as a regression. Certainly there will be some documents previously saved by LO which will now, in LO, show an extra tab character after the footnote. Any previously saved document without a hanging indent will display this extra tab. However, MSO has always seen that extra tab, so these patches are enhancing compatibility. This patch corrects several incorrect assumptions: -The paragraph style is not necessarily "Footnote". -The paragraph may have directly defined a hanging margin. -An aesthetic tab is needed on a hanging indent, not a defined margin. Change-Id: Ieaa76448ce202d92efdb8d1fc04ba2674ed120ba Reviewed-on: https://gerrit.libreoffice.org/52172 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-02-14tdf#115719 DOCX import: increase paragraph spacing for anchored objectsMiklos Vajna
... 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.) Change-Id: Ibad28d27e4bcbe1991a3be1c686064e18e9ffa4d Reviewed-on: https://gerrit.libreoffice.org/49733 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-13tdf#113258 DOCX import: fix beforeAutospacing for shape first paragraphMiklos Vajna
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. Change-Id: I9d99b9cfabae2c9a7c33eefefb5a9f008669e93d Reviewed-on: https://gerrit.libreoffice.org/49617 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-07tdf#114217: Consider relative width when importing floating tableMike Kaganski
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>
2018-01-25ooxmlimport: support inherited listidJustin Luth
This is prep work for tdf#95377. This unit test avoids the unique chapter-numbering style (from the heading paragraph styles) and just has a basic, user-created style inheriting from Default. Also unique about this unit test is that the numbering is specified by the "Default Style" which takes a rather unique code path and exposes even more problems. We already know the listId through a recursive function, and GetCurrentNumberingRules only looks at the current style which isn't good enough. Moved that modified function into DomainMapper_Impl since I will need it there for bug 95377. Additionally, ensure that directly applied paragraph properties are not overwritten. That also meant changing the order, so that paraStyle properties are directly applied to the paragraph before applying RightMargin and friends. Change-Id: I5c1fb71d64727be9d9105f287150daf4e0ff413d Reviewed-on: https://gerrit.libreoffice.org/48457 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-31loplugin:passstuffbyref improved return in emfio,writerfilterNoel Grandin
Change-Id: I237936d62d0f1b17574dd88b5c9de932dc03238e Reviewed-on: https://gerrit.libreoffice.org/47214 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łos
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-10tdf#43017: Support for DOCX hyperlinks character propertiesVasily Melenchuk
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>