summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
AgeCommit message (Collapse)AuthorFilesLines
4 daystdf#140342 sw layout: remove explicit gutter handling when positioning bordersMiklos Vajna2-4/+25
Word has two modes the specify border positions: the distance can be measured from the edge of the page or from text. Similar to how documents that have page borders but no gutter, page page border + gutter documents should be always measured "from text" by the layout. "From page" should be a concern for Word filters. "From page" was already working -- fix "from text" by changing the layout to do "from text" and then extending DOCX import/export to handle gutter while handling the "from page" page borders. This also requires allowing nominally negative top margins, because we want to have the gutter unchanged, but the border might want to be on the gutter area, which is only possible with a negative top margin. Change-Id: I7f2c9943357359e76cb554cb2a65b93a492e694b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111735 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
4 daystdf#140668 Crashfix: disregard w:textDirection tag outside frameDaniel Arato (NISZ)1-2/+1
DomainMapper_Impl::SetFrameDirection had a false assumption that a w:textDirection tag will only be encountered when the OOXML parser is already inside a frame. This is not always the case. Regression from commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43 (tdf#97128 DOCX import: fix frame direction). Change-Id: I39845599b0c7f502870e2de497df8cbdd4475594 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111594 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org>
4 daystdf#140137 Don't throw exception when w:gridCol is missing "w" attrAron Budea1-5/+13
2149e924cbc32c370128c5f87a4f55c50c99e6bd added a division-by-zero check, which caused Writer to throw an error on the bugdoc. Since the file could be loaded fine before, let's return to a working version, with the check included. The cause is the following in document.xml (originating from a non-MS generator): <w:tblGrid> <w:gridCol/> <w:gridCol/> </w:tblGrid> Word still splits such tables differently, but that difference was always there in Writer. Change-Id: I6d91a736f460394a76f035298a238c41da201cb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111723 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
8 daystdf#136570 OOXML import: fix height of OLE objectsAttila Bakos (NISZ)1-10/+19
e.g. OLE icons or math formulas by skipping unset border properties. Regression from 636d16efe45a55c1a5a7a451c46fbb8618bf0393 (tdf#135653 OOXML import: fix OLE background color). Change-Id: I64bd68037d063de81fbb302b90d65b77af50a622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111119 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
8 daystdf#140572 writerfilter: ignore position in docDefaultsJustin Luth5-1/+23
Despite the documentation saying that anything in docDefaults should apply everywhere unless it is overridden in a higher priority style, the subscript/superscript setting in docDefaults seems to be ignored. Makes sense in a way, but perhaps document those exceptions? I looked for documentation in both "docDefaults" and "position" and didn't see anything suggesting why it is ignored. Change-Id: If676415b112921e4cb8f7306b8c8ad93a6fd8cde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111442 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
10 daysloplugin:unusedmethodsNoel1-1/+0
Change-Id: Ie0534244cc7a30ad006e65baf125c59757c90d50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111388 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-18tdf#120351 DOCX import: fix slow endnote importLászló Németh4-123/+153
by parsing endnotes.xml only once instead of parsing again and again for every endnotes. This was a serious performance problem for documents with hundreds of endnotes, where the endnote import took minutes instead of seconds. Note: switch off CHECK_NOTMERGED in a debug build to measure realistic speed-up, e.g. 98 s -> 18 s for a document with thousand of endnotes. Follow-up of commit 9b39ce0e66acfe812e1d50e530dc2ccdef3e1357 "tdf#76260 DOCX import: fix slow footnote import". Change-Id: I88cdc5101c25041f985fdc23739a0dadf24a13e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111030 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-02-15tdf#74367 DOCX: fix page margins imported as border paddingAttila Szűcs2-1/+5
Trying to import non-existing "none" borders of w:pgBorders zeroed page margins, removing their values to border padding. Note: according to OOXML standard 2.6.10. pgBorders (Page Borders), "nil" should be treated the same. Co-authored-by: Tibor Nagy (NISZ) Change-Id: Ibbc9375b2f8b3daf7b4bdea84e078676ce588586 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110396 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-02-12tdf#76260 DOCX import: fix slow footnote importLászló Németh3-4/+116
by parsing footnotes.xml only once instead of parsing again and again for every footnotes. This was a serious performance problem for documents with hundreds of footnotes, where the footnote import took minutes instead of seconds. Note: switch off CHECK_NOTMERGED in a debug build to measure realistic speed-up, e.g. with the reported document: 2 min 36 sec -> 22 sec, and not 1 min 40 sec, as with CHECK_NOTMERGED. Revert commit 60dbe21f59a45889c433727d0862c9a4274d94d2 ("tdf#88126: sw_ooxmlexport15: Add unittest"), because it was a fragile table layout test, worked only by accident. Change-Id: I9460442cf0c30f2bc5ff393c947a008ca7bba6df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110811 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-02-09tdf#134592 DOCX import: preserve formatting of CREATEDATE fieldsMiklos Vajna1-0/+7
The create date of a document doesn't really change, so we can only loose if the cached result of the field is not preserved. Change-Id: I0105d9c5bb9a06cacc1f5fed2a10b6626fa80fd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110596 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-07Remove unneeded breaksAndrea Gelmini1-1/+0
Extending this: https://gerrit.libreoffice.org/c/core/+/110512 Change-Id: I9e7cf757a346d603d0acb818be0c9bc488c8d5c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110516 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-02-05tdf#91920 sw page gutter margin, from top: add DOCX filterMiklos Vajna3-0/+11
ODF filter was already working as-is. Change-Id: I71089a5d0171eba0cd4c2d14bdee6ca9b64193b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110455 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-02-03tdf#91920 sw page gutter margin: add DOCX filterMiklos Vajna7-1/+14
- import: convert the gutter twips value to mm100, then map it to the GutterMargin property of the page style - export: map SvxLRSpaceItem::m_nGutterMargin to <w:pgMar ... w:gutter="..."/> Change-Id: I971d32ffe4e67c2c5a5518b5aa63cb8514e04e2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110345 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-29loplugin:stringviewparam extend to new..Noel1-1/+1
O[U]StringBuffer methods Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-26tdf#137655 DOCX table import: fix zero para top marginLászló Németh1-3/+15
when only w:beforeAutospacing=0 was specified, but not PARA_TOP_MARGIN (see default_spacing = -1 in processing of LN_CT_Spacing_beforeAutospacing). Follow-up of commit 61821277ed4974debd05af89cb7284602512088f (tdf#104354 writerfilter: rewrite Autospacing). Change-Id: I5fff7a8b62450ebaf8ef6b552ecbb2b1cfb24381 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109914 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-01-26loplugin:passstuffbyrefNoel6-9/+9
Change-Id: I330e0ab6c9955939dad313f9d472f93e39dbd313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109924 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-22tdf#138899 DOCX import: fix removing last para of sectionLászló Németh2-5/+6
Fix regression from commit 39090afac268f9ae985832c2f08863b41e6c06f2 (tdf#120336 DOCX import: fix page break after tracked deletion), limiting the condition only for *empty* section starting paragraphs with tracked deletion. Change-Id: I020c8b0edf5d4a37a9150cccec8c25fce50327d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109779 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-01-19tdf#135153 DOCX import: avoid line-of-text relation with to-para anchoringMiklos Vajna1-0/+8
Regression from commit 8f1a1092d47947847e1d888b0284e8364c663d1f (tdf#97371 DOCX import: fix text covered by shape, 2016-01-28), the problem was that once the import decides that a shape should have no to-char anchoring, it should not leave behind vertical relation types which make no sense for to-para anchoring. text::RelOrientation::TEXT_LINE is specific to to-char anchoring, so reset the relation back to the default text::RelOrientation::FRAME. This means we'll no longer show "from top" on the UI while the doc model contains "from bottom": and those have to be in sync, otherwise pressing "down" while the shape is selected will actually move it up. Change-Id: I660a7bb30133ea866cc4ba1620ae15fea243ef8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109570 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-16tdf#116394 writerfilter: append '=' if not a formula markerJustin Luth1-0/+2
Oops - a silly mistake to throw away the character if it didn't match a special purpose. There is no point in adding a unit test for this. Change-Id: I3b48af578ae96744405ec0919ff341d1c9b43f65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109426 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-01-16make the Color constructors explicitly specify transparencyNoel4-6/+6
to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-14cid#1470700 try to help coverity see 'Using invalid iterator' is falseCaolán McNamara1-0/+1
Change-Id: I04f3d2779db32cc5ca3d6303d146d017aa4f5ef4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109265 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-12tdf#138995 DOCX import: fix handling of textbox zordersMiklos Vajna1-0/+14
Regression from commit d379d18666aa42031359ca8eb34b0021960347ae (oox: import WPS shape with text as shape with textbox, 2014-06-18), the problem was that a textbox's shape + textframe are internally 2 sdr objects, so once GraphicZOrderHelper knows the current shape should be on top of a shape+frame pair, it should suggest a larger ZOrder. This is necessary till there is no setter version of SwTextBoxHelper::getOrdNum(), which would allow import filters to ignore this complexity, but that would be a larger change. Change-Id: Ibbb1bcd9301eb369f25f211120f62be7c59b0fd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109111 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-09fix coverity parse errorsCaolán McNamara2-2/+2
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-04loplugin:stringviewparam: operator +=Stephan Bergmann2-5/+6
Change-Id: I30ce1b5bd8fb168da7067c1967c5af2569df2653 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108512 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-02introduce Degree100 strong_int typeNoel1-3/+3
Change-Id: I78f837a1340be0ca5c49097f543a481b7b43a632 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108367 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-26New loplugin:stringliteralvarStephan Bergmann2-2/+2
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for details. (Turned some affected variables in included files into inline variables, to avoid GCC warnings about unused variables.) Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-19make *String(string_view) constructors explicitNoel Grandin1-2/+2
to make it more obvious when we are constructing heap OUStrings code and potentially inadvertently throwing away performance. And fix a handful of places so revealed. Change-Id: I0cf390f78026f8a670aaab53424cd31510633051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107923 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-16tdf#138892 writerfilter: cancel style list if bNoNumberingJustin Luth4-8/+10
This fixes 6.1 regression e24e2d2fb02239753c1520a0458b44683ea4cc2e. Starting in 7.0 (tdf#131321), paragraph styles kept their numbering property. But even before that, non-paragraphs marked by bNoNumbering we having their direct numbering removed, and then finishParagraph applied para-style numbering since there was no direct numbering. So, we need to pass the bNoNumbering to finishParagraph so that it can cancel out a style-assigned numbering. Change-Id: I0c24af4e9bd0ea3712179a47ed3550f91c8f44b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107738 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-12-15tdf#118711 writerfilter: don't hardcode default page descriptionJustin Luth1-3/+7
well, at least not at the beginning of the document. The problem with specifying is that it becomes a property of the paragraph - and so if the paragraph is copied or moved, the page break comes along with it and the user has to remove the unnecessary page break wherever it lands. Since the default will be applied anyway, there is no value in specifying it. I'm not sure how, but at least one test document started with a Converted1 style, so I had to explicitly confirm that the stylename really did match the default for a first section. A unit test also indicated that it needs to be specified if an explict page number is assigned because RES_PAGEDESC contains MID_PAGEDESC_PAGEDESCNAME as well as MID_PAGEDESC_PAGENUMOFFSET. Change-Id: I0d0f6b70767f7daaf300e09c0d31ac4b17b91ed1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107555 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann5-7/+17
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-09negative return passed to parameter that cannot be negativeCaolán McNamara1-1/+2
I wonder if the test != 0 is what was really intended here, but keep that legacy logic anyway Change-Id: I4b39a2130e961c6f2ca97695e4625df5a95e00b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107460 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-08tdf#135217 DOCX import: remove no longer needed top/bottom margin syncMiklos Vajna1-9/+0
Regression from commit b7ae863efeb082816cc4fe660527a9650d90e186 (tdf#117503 DOCX import: fix out of sync first/later top margin, 2018-05-28), which adjusted the import so that the export can pair first/follow page styles and write them into a single Word section. But changing the import for pairing purposes is not a good idea after all, as it also affects the layout of the imported document. In the meantime, commit 51534ac2b9747975945acb6a1e1ba5cc6d73f5c2 (tdf#127778 DOCX import: fix unexpected heading on non-first page when the first page has a heading, 2020-05-11) already fixed the export side, so this is not even necessary, just remove it. Change-Id: I94c02517ae1e0804547f81c43bb5890327d32376 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107363 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-12-07tdf#138612 DOCX import: fix lost part of split table cellLászló Németh1-3/+0
by removing unnecessary rewriting of cell properties during import of w:tblPrEx. Regression from commit da8ea444b004a0be36964ae9a778f73e752b2673 (tdf#133455 DOCX import: fix table border regression) Change-Id: I93ce36991437644db439c8cf02e1a8503fbdfba7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107239 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-12-03Pass key by const& to the various addEmbeddedFont functionsStephan Bergmann2-2/+2
Change-Id: Id6e36a4acf34a6b8d5b7202231650066ae6cb6cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107170 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-02tdf#138345 ms formats Char highlight: no import into char-styleJustin Luth1-0/+8
MS Word ignores w:highlight in character styles, so don't import it. RES_CHRATR_HIGHLIGHT only exists in LO in order to support Microsoft's terrible idea of allowing two different attributes to define char background colour. So it should be safe to remove it from UNO. Change-Id: Ia2ee0bd61ee59dfa864e946024c8184747aa2b40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106183 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-12-01cid#1401328 Uncaught exceptionCaolán McNamara1-1/+2
and cid#1401334 Uncaught exception Change-Id: I0d489a487c4c8148da4978cb613829b9cf69d14d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106985 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-01OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTIONNoel4-18/+18
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-30loplugin:stringviewparam include comparisons with string literalsNoel3-10/+10
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-30tdf#137683 writerfilter Char highlight: import "none"Justin Luth1-1/+2
Importing a charHighlight of NONE is critical, since charHighlight can be set on a higher para-style, and so there needs to be a way to cancel it with direct formatting. DOC already imports NONE. This adds it for RTF and DOCX. (None of the formats EXPORT it though. So that needs to be done, but try not to spam NONE settings where they are not necessary, please.) Change-Id: Ic5d03ceb81a3a079c827b81561deb9068ae8259e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106314 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel9-19/+19
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-23ofz#27519 only generate bitmap preview when neededCaolán McNamara2-19/+30
Change-Id: I35d20d65b607d6441b001c7d839a793349ef3b1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106425 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-19tdf#123936 Formatting files in module writerfilter with clang-formatPhilipp Hofer18-214/+171
Change-Id: Ia60e7c5e2d3be0baa0496a6bd99c6ae98cd4ff96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105730 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-17loplugin:stringviewparam check methods tooNoel2-3/+3
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-13DOCX import: lost cached result of fields: fix leading whitespaceMiklos Vajna1-1/+9
" IF " and "IF " is the same, but "IFF " is something different. Change-Id: Ieb2d128d28ed3daa3df73128804bcc40dda9878d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105783 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-11-12DOCX import: fix lost cached result inside an IF fieldMiklos Vajna1-13/+33
This builds on top of commit d09336fbdceaafd9320466b660a2b32a07dcc16a (tdf#125038 DOCX import: fix lost MERGEFIELD result inside an IF field, 2019-10-31), and extends it for more cases. We know that DOCVARIABLE, FORMULA and IF fields inside an IF fields is not something Writer is capable of, so make sure we keep the cached result. Change-Id: I20004f97c2073309c33594e5da6f8ba89ba278ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105639 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-11-12Revert "remove Fraction::operator tools::Long()"Noel Grandin1-2/+2
This reverts commit 48b667a7e7d25f835f95df89162a7849d6972531. Reason for revert: some discussion required Change-Id: Ia0990d280837fb68b7ddc9f472ec78b1467b4311 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-12tdf#137850 writerfilter compatibilityMode15: ignore behindDoc if wrappedJustin Luth1-0/+17
This patch is based on testing results, since I couldn't find anything in the documentation that indicated a change between Word 2010 and Word 2013. But the evidence is fairly clear I think. To quote from MS documentation on relativeHeight: > This attribute shall only indicate the Z-order with respect to other objects > in the document which have an identical behindDoc attribute value. > _All_ objects with a behindDoc value of false shall be displayed > above elements with a value of true. But only wrapNone makes mention of being affected by behindDoc, so apparently MS decided to ignore it for some reason starting in Word 2013. By simply changing the compatibiltyMode value to one lower, Word 2013 again starts to honour the behindDoc setting. Change-Id: I7ef40387707ab5376cf8fa4d8a208c5b6a8b37ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105486 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-12remove Fraction::operator tools::Long()Noel1-2/+2
which was added in commit 331e2e5ed3bf4e0b2c1fab3b7bca836170317827 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Sep 14 08:49:52 2017 +0200 long->sal_Int32 in Fraction presumably to make the change impact less code. Instead, update the call sites to reflect the actual bitwidth of the data we will be receiving. Change-Id: If2a678b1cf534f39cb8cb249757462be53658309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105607 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11loplugin:stringviewNoel1-2/+2
Add new methods "subView" to O(U)String to return substring views of the underlying data. Add a clang plugin to warn when replacing existing calls to copy() would be better to use subView(). Change-Id: I03a5732431ce60808946f2ce2c923b22845689ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105420 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-10new loplugin:reducevarscopeNoel Grandin1-2/+2
Change-Id: Iefe922c2e0d605114d54673d63eccc5e4abd545d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102143 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>