summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/attributeoutputbase.hxx
AgeCommit message (Collapse)AuthorFilesLines
2023-12-19cid#1557601 COPY_INSTEAD_OF_MOVECaolán McNamara1-14/+14
and cid#1546498 COPY_INSTEAD_OF_MOVE cid#1546384 COPY_INSTEAD_OF_MOVE cid#1546376 COPY_INSTEAD_OF_MOVE cid#1546374 COPY_INSTEAD_OF_MOVE cid#1546373 COPY_INSTEAD_OF_MOVE cid#1546368 COPY_INSTEAD_OF_MOVE cid#1546365 COPY_INSTEAD_OF_MOVE cid#1546356 COPY_INSTEAD_OF_MOVE cid#1546340 COPY_INSTEAD_OF_MOVE cid#1546266 COPY_INSTEAD_OF_MOVE cid#1546236 COPY_INSTEAD_OF_MOVE cid#1546188 COPY_INSTEAD_OF_MOVE cid#1546178 COPY_INSTEAD_OF_MOVE cid#1546166 COPY_INSTEAD_OF_MOVE cid#1546156 COPY_INSTEAD_OF_MOVE cid#1546144 COPY_INSTEAD_OF_MOVE cid#1546143 COPY_INSTEAD_OF_MOVE cid#1546100 COPY_INSTEAD_OF_MOVE cid#1546078 COPY_INSTEAD_OF_MOVE cid#1546041 COPY_INSTEAD_OF_MOVE cid#1546036 COPY_INSTEAD_OF_MOVE cid#1546033 COPY_INSTEAD_OF_MOVE Change-Id: Ib3586d93198992e206baf5c2de5a663d5574aa3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160979 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-20tdf#148834 docxexport: also write suppressLineNumbers = falseJustin Luth1-0/+1
This code also affects DOC export, but shouldn't be detrimental. It just means that some unnecessary sprms will not be added to DOC files. RTF - similar to old DOCX - only outputs if !IsCount, but I didn't find a corresponding "enable" to offset \noline. make CppunitTest_sw_ooxmlexport18 \ CPPUNIT_TEST_NAME=testTdf148834_lineNumbering Change-Id: Ib5369c2f2c24f75dab7d02e3591a4ddefa335ebf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155858 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-07-11tdf#150408: Implement "Legal" numbering (all levels using Arabic numbers)Mike Kaganski1-1/+2
Enabling this feature on a list level makes all numbered sublevels, that constitute the number of this level, to use Arabic numerals. This doesn't change the labels of other levels: e.g., if level 1 uses A,B,C; level 2 uses i,ii,iii; level 3 uses a,b,c, and is "Legal"; and level 4 uses 1,2,3; then a list may look like A. Something A.i. Some subitem A.ii. Another subitem 1.2.1. This is a "Legal" sub-subitem A.ii.a.1. And its child This improves interoperability with Word. This change introduces document model, ODF and OOXML import and export. In ODF, a new boolean attribute of 'text:outline-level-style' element, 'loext:is-legal', is introduced; its default value is "false". Change-Id: I5ae9f970864854c7e84c4b2f7ce46634b3ef104e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154288 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-02-24tdf#78510 sw,cui: split SvxLRSpaceItem for SwTextNode, SwTextFormatCollMichael Stahl1-0/+7
Leave editengine and non-paragraph usages of SvxLRSpaceItem as-is for now. Add new items RES_MARGIN_LEFT etc., order them so that paragraphs can have 3 consecutive items RES_MARGIN_FIRSTLINE..RES_MARGIN_RIGHT and non-paragraphs also have 2-4 consecutive items RES_MARGIN_RIGHT..RES_MARGIN_LEFT (only the 3 paragraph ones are actually used now). The HTML import filter is particularly annoying because it parses CSS stuff into SfxItemSets without knowing where the items will be applied, so it can't know whether to create SvxLeftMarginItem or SvxTextLeftMarginItem... the split items are created in ParseCSS1_* functions and then converted later if necessary. WW8 import has some weird code as well, SwWW8ImplReader::Read_LR() creates 3 items and then something wants to set every item on its own so SwWW8FltControlStack::SetAttrInDoc() turned out rather weird. Convert the paragraph dialog to handle the split items (by mapping them to SID_ATTR_PARA_FIRSTLINESPACE/SID_ATTR_PARA_LEFTSPACE/ SID_ATTR_PARA_RIGHTSPACE), but the SvxRuler looks a bit more confusing so convert in sw shells for now and leave that for later (also unclear if changing these slot items like SID_ATTR_PARA_LRSPACE breaks any ABIs?). Change-Id: I40431821868fd3e1cceba121b5539ff9ae6befbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147024 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-01-03docx: export symbol characters correctlySzymon Kłos1-1/+1
Previously we had: after save: <w:t></w:t> original content: <w:sym w:font="Wingdings" w:char="F0E0"/> This patch checks if paragraph has symbol font used and exports content using w:sym mark in that case Change-Id: I74f4bb0d249cbf5dfc930e931f7d91bd0d2e9821 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143455 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144949 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-12-08Simplify management of id-to-style-to-string-id mappingMike Kaganski1-1/+1
Instead of having three container objects for that, use one vector of appropriate structures. Slots are in sync and unique automatically. Change-Id: Ibb2c48ce42bf98f84df8230439ca98cb5b75051a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143807 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-19sw content controls, plain text: enable DOCX filter with data bindingMiklos Vajna1-7/+1
- writerfilter/ had explicit code to not map plain text SDT to Writer content controls if it has data bindings specified, lift this limitation and set the value of content control from data binding, like Word does and Writer did it for input fields since b5c616d10bff3213840d4893d13b4493de71fa56 (tdf#104823: support for sdt plain text fields, 2021-11-24) - call DocxExport::AddSdtData() on the export side to do the opposite on export - give up on the idea to export content controls to DOCX by finding the text attribute in SwWW8AttrIter::OutAttrWithRange(): this needs buffering in both directions (need to start the SDT before the start of the run, need to end it after the end of the run), and solving this using marks and merges at a fast-serializer level looks like hacks on top of hacks. To be more specific, CppunitTest_sw_ooxmlexport7's testSdtAndShapeOverlapping seems to be very hard to fix with this design - instead, give not only the start position but also the length of the run to DocxAttributeOutput::EndRun(), which has random access to the doc model and can look up if there is a content control start or end that needs writing at the current position of the XML output, without any buffering, which also means less code - adapt CppunitTest_sw_ooxmlfieldexport's testSdtBeforeField, which didn't like the empty run at the start of content controls, which seems to be harmless otherwise - fix CppunitTest_sw_ooxmlfieldexport CPPUNIT_TEST_NAME=testSdtDateDuplicate by disabling the "set content control value from data binding" logic for date pickers because that logic in writerfilter/ sets the value as-is and it has to consider the requested date format before this can be enabled As a side effect, this gives PDF export for plain text SDTs, even if they have data binding set. CppunitTest_sw_ooxmlfieldexport's testTdf104823 is now updated to ensure that we import such SDTs as Writer content controls. Change-Id: I749a845b5a25454c51066b8ded892682f523b6b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140134 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-08-12clang-tidy modernize-pass-by-value in swNoel Grandin1-2/+3
Change-Id: I9a3b33595e34a264baeede33672a0c090ae85157 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-25sw content controls, plain text: add DOCX importMiklos Vajna1-1/+1
- the core of this is the writerfilter/ change to call PopSdt() for SdtControlType::plainText, which maps inline plain text SDTs to Writer content controls, not to input fields - disable the grab-bag in this case, otherwise we would run duplicated <w:sdt> elements on export - fix CppunitTest_sw_ooxmlexport7's testSdtAndShapeOverlapping by postponing the SDT start in DocxAttributeOutput::WriteContentControlStart() in case a shape is anchored at the same position as the SDT start: if the shape should start inside the content control, then it should be anchored after the dummy character - reduce the debug output in VMLExport::Commit(), which could write control characters to the terminal on test failure, potentially breaking it (requiring a 'reset' to recover) - fix CppunitTest_sw_ooxmlexport5's testSdt2Run: now we merge two runs inside a plain text content control into a single one, and there is no problem with that, so adapt the test instead - fix CppunitTest_sw_ooxmlexport17's testTdf148361: plain text inline SDT is now a content control, not a field - fix CppunitTest_sw_ooxmlfieldexport's testfdo82492: explicitly assert that there is 1 text run inside the SDT and there is a shape after it (outside). Also extend DocxAttributeOutput::EndContentControl(), so it ends the content control at the correct, earlier position in case it's followed by an as-char shape - fix CppunitTest_sw_ooxmlfieldexport's testfdo82123: again assert that the SDT has 1 run with text, and there is a drawing after the SDT - fix CppunitTest_sw_ooxmlfieldexport's testTdf104823: this revealed that some more complex logic is needed to support data bindings, so exclude text-with-databinding from the scope of this commit and continue to map those to input fields for now - fix CppunitTest_sw_ooxmlfieldexport's testFdo81945: this had a similar problem as as-char shapes, but this time a new SDT is starting right after a previous SDT. Adapt DocxAttributeOutput::EndContentControl() accordingly, though perhaps this should be generalized later, so we always close SDTs in the previous run, unless this is the last run, or something similar Change-Id: Ifaf581be884a683de6c8b932008a03ba43734b75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137399 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-04-12sw content controls: add initial DOCX exportMiklos Vajna1-0/+6
Wrap the text portions inside the content control inside <w:sdtContent> and <w:sdt>. Also map the (so far) single property of it to <w:showingPlcHdr>. This is just initial export for inline text content controls, more properties are to be added in follow-up commits. Change-Id: I21e085496b4c79114b158656c5611aff8ffdd08a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132875 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-09sw clearing breaks: add DOCX exportMiklos Vajna1-0/+3
Need to do this in two passes, because a clearing line break is a text attribute, but the DOCX markup is not a run property, so can only write it once the run properties are finished. Change-Id: I74e94dbd02ca4e6ceee0439c5eafd3c3bbe2264b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131231 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-09-27sw: paragraph styles: add DOCX filter for a linked character styleMiklos Vajna1-1/+1
And the same in the other direction: link a para style from a char style. This gets the info out of the grab-bag, so later we can store it also in ODF. No new tests, the existing testStyleInheritance in CppunitTest_sw_ooxmlexport3 covers this refactor. Change-Id: I5ada7ea471a253204984ae0466bd0f8ad70046e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122681 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-07-27sw: document the last parameter of FieldVanish() where it's not usedMiklos Vajna1-1/+1
To resolve docx vs rtf/doc inconsistency. Change-Id: I349cfb4aa9575df31c29eb35a32d72474d089c6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119527 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-07-25use officecfg to retrieve OdfDefaultVersionNoel Grandin1-2/+0
Change-Id: Id54b98d978965e7ce304b83d5eff7d6c844a41d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119474 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-16tdf#122222: add DOCX export of resolved comments as "done"Mike Kaganski1-1/+1
Since implementation of tdf#119228, Writer comments may have "Resolved" state, which is the equivalent of Word's internal "done" flag. This relies on [MS-DOCX] extensions available since Word 2013. DOCX import will be implemented in a follow-up commit. [MS-DOCX]: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-docx Change-Id: I3be1e8a096bdec41c8268974fe81328480eb0704 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114023 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-16sw: DOCX export: write hyperlinks for TOXMark TOX entriesMichael Stahl1-1/+1
* add hyperlink preprocessing in MSWordExportBase::AddLinkTarget() * <w:hyperlink> in the TOX entry * <w:bookmarkStart>/<w:bookmarkEnd> in the field command Change-Id: I4d18778d8ac594a1b4cb43bf0e1234f875eeaf95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114170 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-04-08tdf#81705 doc export: write sprmPOutLvlJustin Luth1-0/+1
but only if it is not the default value, and it isn't the same as what it inherits. Also tweaked DOCX, so that it can write out the default in order to cancel a style's outline level. RTF does nothing with ParaOutlineLevel. I am slightly confused by ::OutlineNumbering which also writes out Outline Level. This appears to be a duplication (and it also seems to duplicate ParaNumRule) which DOCX avoids by just doing nothing. Change-Id: I32dd1bf9f35dc5f7f500e65d517fad0304bf452d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113426 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-01tdf#140343 sw page rtl gutter margin: add RTF filterMiklos Vajna1-1/+1
Map to the \rtlgutter section flag. This means that now rtl gutter is handled for all Word formats. Change-Id: I4c2c12b7df2ce2109d4d638df71e6b7f322afe52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113439 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-31tdf#140343 sw page rtl gutter margin: add DOCX filterMiklos Vajna1-0/+3
Map to <w:rtlGutter> inside <w:sectPr>. Change-Id: Iaa1d9da8c1585ec31c7cbe539f49643eb972c327 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113398 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-30tdf#140336 ms formats export: export NONE background for ParaBackColorJustin Luth1-1/+1
This fixes a regression from LO 4.2 with tdf#88583's commit 60cdeb2d441a6bf5c55f511f574b2b9dd598fbb8. It isn't only SOLID that needs to be written, otherwise there is no way to cancel an inherited background. And only write out a SOLID if one is specified here. Do not duplicate a style's SOLID fill into every sub-style and paragraph. (Yikes) This fixes DOCX (seriously) and DOC (de-duplication), but not RTF (which doesn't write out transparent brushes). Surprisingly, I didn't find any examples where a NONE was specified that matched an inherited NONE. But it IS important (probably because of a bug) and also smart to determine and avoid writing NONE if there is no inheritance. So then, there is no reason not to do the last step of checking if the current brush matches the inherited brush. [That also paves the way for a potential follow-up commit to try deduplicating SOLID fills as well, although that likely adds grabbag complications into the mix. And perhaps deduplication isn't desired either, in case the user actually wanted to duplicate (if that is even possible under UI conditions).] Change-Id: I8958a68c779057d9fc5da74eca50fcf5b41d8b52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113105 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-28tdf#121666 DOCX export: fix missing page breakAttila Szűcs1-1/+1
When an empty paragraph has both page break and section break, only the section break was exported to DOCX, the page break was not, while MSO needs that to show all page breaks. The DOC and RTF exports were not changed by this fix (not sure if the problem are present with them or not). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I5deac0390666415e36a541c731dda4bc0a2ad6ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111543 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-11-24tdf#42949 Fix new IWYU warnings in directory swGabor Kelemen1-2/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I4bb84c3f401aba8a3dede9cec3a7f2187a2ba02a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106473 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-20use tools::Long in swNoel1-1/+1
Change-Id: I44be72b3a9b14823ec37a3c799cffb4fb4d6e1de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-26sw: DOCX export: don't export text frames as transparentMichael Stahl1-0/+2
Writer paints text frames without fill still as opaque but nothing is written in the DOCX file and Word by default treats DrawingML text frame as transparent (the VML fallback is opaque though). Change-Id: I0ce539ac8084c5047b4732abc5c199589ee369ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101411 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-04-22tdf#108496: DOCX: redesign of override in listsVasily Melenchuk1-1/+2
List level overrides are not just about numbering, it is about numbering restart. Thus some changes to DOCX import/export were added. Improved support for several lists referring the same abstract list, especially in situation when one list have overrides. In addition some export cleanup is made: less unnecessary list duplications, less level overrides when no properties were changed. Change-Id: Ic7a69bc2e3080b39f5205cb90b46d14247abf305 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92412 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-03-13Revert "loplugin:constfields in sw"Noel Grandin1-1/+1
This reverts commit 4969f4c0d3e2581aaa8a5b5a5769840fa6b6f8ea. Change-Id: I527e9366b05e8a20633720e334395b285991c524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90473 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-21Drop o3tl::optional wrapperStephan Bergmann1-2/+2
...now that macOS builds are guaranteed to have std::optional since 358146bbbd1b9775c12770fb5e497b6ec5adfc51 "Bump macOS build baseline to Xcode 11.3 and macOS 10.14.4". The change is done mostly mechanically with > for i in $(git grep -Fl optional); do > sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \ > -e 's/\<o3tl::optional\>/std::optional/g' \ > -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i" > done > for i in $(git grep -Flw o3tl::nullopt); do > sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i" > done (though that causes some of the resulting #include <optional> to appear at different places relative to other includes than if they had been added manually), plus a few manual modifications: * adapt bin/find-unneeded-includes * adapt desktop/IwyuFilter_desktop.yaml * remove include/o3tl/optional.hxx * quote resulting "<"/">" as "&lt;"/"&gt;" in officecfg/registry/cppheader.xsl * and then solenv/clang-format/reformat-formatted-files Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-23sal_Char->char in swNoel Grandin1-2/+2
Change-Id: I63fb87a8e8eaf9c9da7bf7b8b6f5706222ffcc07 Reviewed-on: https://gerrit.libreoffice.org/85730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann1-2/+2
...with a boost::optional fallback for Xcode < 10 (as std::optional is only available starting with Xcode 10 according to <https://en.cppreference.com/w/cpp/compiler_support>, and our baseline for iOS and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite all code to use o3tl::optional instead of boost::optional. One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus -Werror=maybe-uninitialized" should no longer be necessary (and whose check happened to no longer trigger for GCC 10 trunk, even though that compiler would still emit bogus -Wmaybe-uninitialized for uses of boost::optional under --enable-optimized, which made me ponder whether this switch from boost::optional to std::optional would be a useful thing to do; I keep that configure.ac check for now, though, and will only remove it in a follow up commit). Another longer-term benefit is that the code is now already in good shape for an eventual switch to std::optional (a switch we would have done anyway once we no longer need to support Xcode < 10). Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses boost::property_tree::ptree::get_child_optional returning boost::optional, so let it keep using boost::optional for now. After a number of preceding commits have paved the way for this change, this commit is completely mechanical, done with > git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g' (before committing include/o3tl/optional.hxx, and relying on some GNU features). It excludes some files where mention of boost::optional et al should apparently not be changed (and the sub-repo directory stubs). It turned out that all uses of boost::none across the code base were in combination with boost::optional, so had all to be rewritten as o3tl::nullopt. Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b Reviewed-on: https://gerrit.libreoffice.org/84128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-19tdf#128889: don't write "page break after" into w:pPrMike Kaganski1-1/+2
This produced invalid OOXML, which Word considers as "page before", and LibreOffice ignores when re-importing. Make sure to write it as *trailing* w:r with w:br, as Word also does when imports ODT with this atribute, and saves as DOCX. Change-Id: Ifc4f45d65d4455ecb5cd62aed1ef6a03375c8aa4 Reviewed-on: https://gerrit.libreoffice.org/83232 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-09-28loplugin:constmethod in swNoel Grandin1-5/+5
Change-Id: I73c3c6d2165287d2d581a04b23b1d3b48166a488 Reviewed-on: https://gerrit.libreoffice.org/79780 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-05Fix typosAndrea Gelmini1-1/+1
Change-Id: Ibfff5af316a2c18b5735245caf5a27a562bc0f52 Reviewed-on: https://gerrit.libreoffice.org/78664 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-05tdf#95848 sw: DOCX export: export w:lvlOverride elementsMichael Stahl1-1/+1
... when necessary; factor out MSWordExportBase::NumberingLevel() so it can be called for this purpose. Change-Id: I958210052b162c2b23f0162ffebbf5add1ed328c Reviewed-on: https://gerrit.libreoffice.org/78608 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-09-05tdf#95848 sw: DOCX export: crude implementation of abstractNum mappingMichael Stahl1-0/+4
The abstractNum needs to correspond to a SwList, not to a SwNumRule as it is currently implemented. Add a mapping to MSWordExportBase for "overriding" numbering definitions; these are added to m_pUsedNumTable, which appears to be necessary to interact with DuplicateNumRule(), but here we just add nullpointers, because we don't need to modify the SwNumrule, and neither do we want the vector to double-delete it. The mapping is created while iterating over the document, in AttributeOutputBase::ParaNumRule(). It turns out that this approach would work for WW8 too as DuplicateNumRule() was originally added for that format but it won't work easily for RTF; in the DOCX case the WriteNumbering() is called after the main text and footnotes/endnotes, but with RTF it's the other way around :( Change-Id: Ia0409f5ad0b2e089005024ef7f61850a06d4dcbe Reviewed-on: https://gerrit.libreoffice.org/78607 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-08-28Avoid dynamic_cast in AttributeOutputBase::ConvertURLMike Kaganski1-1/+5
This unifies the code for any format using the function. Note: RTF code currently doesn't use the function, so an empty string is used in its ctor. Change-Id: I8776c095d4527313d06b0620059a892a48a9eaa1 Reviewed-on: https://gerrit.libreoffice.org/78229 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-06-20tdf#42949 Fix IWYU warnings in sw/source/filter/*/*hxxGabor Kelemen1-3/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I7ccd6af737c21a50fe7df25266198ee6989c4c69 Reviewed-on: https://gerrit.libreoffice.org/74110 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-23convert nsRedlineType_t to scoped enumNoel Grandin1-1/+1
and move the auto-format embedded flag to a separate field Change-Id: I02155702389178fbfdf874f592d47a29f8759974 Reviewed-on: https://gerrit.libreoffice.org/72771 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03loplugin:constfields in swNoel Grandin1-1/+1
Change-Id: I1eb6583bb9ec815bc0564b0d7c676f5b1fb9045f Reviewed-on: https://gerrit.libreoffice.org/61177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-08loplugin:passstuffbyrefNoel Grandin1-1/+1
Change-Id: I6e6c47020073ec183c6c8ff9cd026a0bec23b177 Reviewed-on: https://gerrit.libreoffice.org/57088 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-01sw: refactor StartRuby in ww8 filter.Mark Hung1-0/+16
Refactor the copy-pasted code in StartRuby of WW8AttributeOutput, RtfAttributeOutput, so that it can be used it in DocxAttributeOutput later. Change-Id: I63631be7604a62899c5630f3e57985993f128728 Reviewed-on: https://gerrit.libreoffice.org/48764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2017-11-19tdf#86087 Save relative links in DOCXSzymon Kłos1-0/+6
Save links depending on preferences set Options -> Load/Save -> General -> Save URLs relative to ... Change-Id: I96d06cfdc405d1e1254515106926374aee279f6c Reviewed-on: https://gerrit.libreoffice.org/44785 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2017-11-10Fix typosAndrea Gelmini1-1/+1
Change-Id: I2b6f476122a1991b77e7831da225f7dc17d4061c Reviewed-on: https://gerrit.libreoffice.org/44570 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2017-11-09tdf#42346: DOC export of cross-references to objectsTamás Zolnai1-3/+7
Same solution which was used for DOCX export: 98bc7215935f1eb2e0dc6f1db826d8e729430c13 Change-Id: I8af46db003a6192c6adaae1a35dff58744919eee Reviewed-on: https://gerrit.libreoffice.org/44502 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2017-11-04tdf#42346: DOCX export of cross-references to objectsTamás Zolnai1-0/+2
* Objects means tables, images, text frames and shapes * Implementation ** MSO uses simple bookmark references as cross-references to objects ** So generate bookmarks in export time if a caption is referenced ** In some cases we also need to split some of the runs ** Implemented all types of cross-references, except the chapter reference Change-Id: I3b17753123d94a04e4f28783ad5663831e7c6c84 Reviewed-on: https://gerrit.libreoffice.org/44294 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2017-10-25tdf#105381 ww8export: support footnote numbering per pageJustin Luth1-1/+1
This is only for the benefit of MSOffice, LO already uses Dop.rncFootnote for this, but MSO requires this section sprm. LO import currently ignores sprmSRncFtn. Endnotes in LO do not currently support .eNum, so we can't support MSO's rncRstSect for sprmSRncEdn, leaving only the default - so no use writing that out. Change-Id: Iaff703e806d1cb62bc5990eb1cdfe323705bf7ee Reviewed-on: https://gerrit.libreoffice.org/43622 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-10-23tdf#38778 fix missing run properties export for fields in docxSerge Krot1-2/+2
Not all runs got their text properties written during field export - previously only the first run had them. Adds SwTextNode param to EndRun and EndRuby methods, implementation empty for rtf and doc though. Change-Id: I77f39b40689feb9664044e61824ad3bb97776638 Reviewed-on: https://gerrit.libreoffice.org/43465 Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de> Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de>
2017-09-18tdf#109310 ooxmlexport: write Xnote character styleJustin Luth1-1/+1
LibreOffice will just ignore the defined style on import (since that is statically defined by the footnote code). Microsoft Office, however, requires the character style be provided for the footnote number. It doesn't have any built-in formatting for footnotes. So, this patch is strictly for MSO's benefit. Change-Id: I6631dd0eb697589cfd3c13d7838fe14c31a71bbf Reviewed-on: https://gerrit.libreoffice.org/42035 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-08-07loplugin:constparams in sw part9Noel Grandin1-1/+1
Change-Id: I2edba9cde5a5efd06815a55632703b706ca523c7 Reviewed-on: https://gerrit.libreoffice.org/40830 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-15loplugin:constantparamNoel Grandin1-1/+1
Change-Id: Iced8ff99d52d55e6b6c3126affafbea6786e94f0 Reviewed-on: https://gerrit.libreoffice.org/30858 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-08-19loplugin:countusersofdefaultparams in swNoel Grandin1-2/+2
Change-Id: I668bfe93d77b06385544651583bcf71f6b5df2fc