summaryrefslogtreecommitdiff
path: root/writerfilter/inc
AgeCommit message (Collapse)AuthorFilesLines
9 daysmove writerfilter inside swNoel Grandin9-1004/+0
writerfilter wants to convert incoming RTF and OOXML files into writer's document model. But it currently has to do so by manipulating the limited subset that we expose through the UNO API. This is both slower and less accurate than having access to the full document model. So move it inside, and then we can strip out various hacks, and optimise imports. Change-Id: Ie1114d28130ef5f9a786531bc552cb8ee7768015 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165953 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-01tdf#159158 writerfilter: headers always under other z-ordersJustin Luth1-3/+7
I guessed that a negative z-order will be below a positive relativeHeight when it is in the header. It seems like a reasonable assumption. No unit tests hit this situation AFAIK. make CppunitTest_sw_ooxmlexport18 \ CPPUNIT_TEST_NAME=testTdf159158_zOrder_headerBehind Change-Id: I06e31f3df413ad9c32791c8f4b940831630131dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164105 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-01-17tdf#135083: make sure to apply pending paragraph properties, even withoutMike Kaganski1-0/+1
... trailing \par. Commit a6ae84cc296d4d28e9a48a57406e955138c87a80 (tdf#70318: Prevent extra empty paragraph in clipboard RTF content, 2015-11-10) made sure to not emit trailing \par for RTF clipboard content. The problem was, that in the absense of the \par, the settings of the last paragraph were not applied (this happens in DomainMapper_Impl::finishParagraph). This change makes sure to call dispatchSymbol(RTFKeyword::PAR) (which eventually calls the mentioned method and applies pending para properties). Since this also adds a new paragraph (which needs to be avoided), a new flag is introduced, set by Stream::markLastParagraph. Its purpose is to make sure that all properties are applied to para, as opposed to bRemove argument to DomainMapper::finishParagraph, which prevents setting some properties (e.g., related to numbering - see DomainMapper::lcl_utext). Change-Id: Ia5e368e540c30f95058c81a280a62205aa85398b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162154 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-16tdf#159158 writerfilter: duplicate relativeHeights? last one wins #2Justin Luth1-1/+0
Revert the previous solution and replace it with this simpler one. This version of the patch is riskier, but from what I can see last one always wins for GraphicImport. I assume that Miklos just limited it to a certain situation as a sanity check to try to avoid causing regressions outside of the scope he was working on. The fact that all DOCX and RTF unit tests pass is a good sign. The only way I would expect this to cause problems is if z-index somehow can come into play with a GraphicImport (since both z-index and relativeHeight feed into zOrder). However, an assert didn't turn up any instances where applyZOrder was called without a relativeHeight being set. assert(m_rDomainMapper.IsRTFImport() || bOldStyle || UsedRelativeHeight); Change-Id: I28e8acd5997eed0e82d5853c85b672c62b21afe5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162036 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-01-16tdf#159158 writerfilter: duplicate relativeHeights? last one winsJustin Luth1-0/+1
[When MS Word 2019 round-trips a file with a duplicate relativeHeight it replaces them with unique relativeHeights in the export.] My THEORY is that bOldStyle should always be true for GraphicImport, so a follow-up commit will basically revert all of this, but at least if my theory is wrong, I'll still have fixed this problem. Notice that there are two things that feed into zOrder, the other being z-Index. I assume the very explicit code that says that (except for bOldStyle) first one wins must be the standard for z-Index. make CppunitTest_sw_ooxmlexport18 \ CPPUNIT_TEST_NAME=testTdf159158_zOrder_duplicate Change-Id: I842d016a7922427ce1290a7134d4e19fed52880f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161989 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-12-22cid#1546500 COPY_INSTEAD_OF_MOVECaolán McNamara1-3/+3
and cid#1546492 COPY_INSTEAD_OF_MOVE cid#1546468 COPY_INSTEAD_OF_MOVE cid#1546431 COPY_INSTEAD_OF_MOVE cid#1546382 COPY_INSTEAD_OF_MOVE cid#1546350 COPY_INSTEAD_OF_MOVE cid#1546336 COPY_INSTEAD_OF_MOVE cid#1546314 COPY_INSTEAD_OF_MOVE cid#1546152 COPY_INSTEAD_OF_MOVE cid#1546094 COPY_INSTEAD_OF_MOVE cid#1546077 COPY_INSTEAD_OF_MOVE cid#1546047 COPY_INSTEAD_OF_MOVE cid#1545213 COPY_INSTEAD_OF_MOVE Change-Id: Ia51df9f9cbde755db4d2685e34f22676ed5eceff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161141 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-11cid#1545577 COPY_INSTEAD_OF_MOVECaolán McNamara1-1/+1
and cid#1545679 COPY_INSTEAD_OF_MOVE cid#1545691 COPY_INSTEAD_OF_MOVE cid#1545697 COPY_INSTEAD_OF_MOVE cid#1545711 COPY_INSTEAD_OF_MOVE cid#1545730 COPY_INSTEAD_OF_MOVE Change-Id: Ic0777a8ba532b00b021ffed81243505fbb7250f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160568 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-16writerfilter: fix utext()'s dumb sal_uInt8* parameterMichael Stahl1-1/+1
This removes all but 4 reinterpret_cast in the module! TableManager::utext() even assumed that the bytes are little-endian. Change-Id: I12031336cabedfd6c0fb614ee0e3400810f98e2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159486 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-01Revert "Convert XFastParser into a normal C++ interface"Noel Grandin1-3/+2
This reverts commit 5e68d6cfade45f40b1ad46025a81afe4cb8dd337. Reason for revert: Seems like outside users have been using this API Change-Id: I8814cf1eb4f000eeb4cbbb5db9c282d001465993 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-01Convert XFastParser into a normal C++ interfaceNoel Grandin1-2/+3
There is no need for it to be an UNO interface anymore (ever since we started supporting dynamic_cast on UNO objects). Which means that XImportFilter2 also needs become a C++ interface. Change-Id: Ice2db0f098271bba32b199bd083b08cb8410ce93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152388 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-13writerfilter: prefix members of DomainMapper, GraphicZOrderHelper, ...Miklos Vajna1-1/+1
... RTFSprms_compare and TagLogger See tdf#94879 for motivation. Change-Id: I94c432a3aa592f2deb32175938e19047cc65fa44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146852 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-02-13Fix typo, improve code readability, fix commentParis Oplopoios1-2/+2
Change-Id: I7221222e8c84ee40e4edaec5325565dae4193aff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145825 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-01-18tdf#119229 docx: Preserve w15:paraIdParent attribute in commentsExtendedParis Oplopoios1-2/+4
w15:paraIdParent attribute indicates that the comment is a reply to the value id Change-Id: I9e6eca6a656594c956629c1434b8e5c3aa573c60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145314 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-01-01sw: read theme from OOXML file and set it to the draw pageTomaž Vajngerl1-0/+3
This change extends writerfilter to use oox::ThemeFragmentHandler to read the theme properties, and sets that to the one and only draw page of a Writer document. This change also removes ThemeTable and replaces it with the ThemeHandler, which takes theme font data from svx::Theme instead. In addition, a test has been writen, which loads a document with a theme, and asserts the draw page has the theme and the theme properties currently supported. Change-Id: Iff0048cd21ea030ac55287707852acc463ec3cb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143699 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-12-10tdf#152203 DOCX import: fix mixed footnotes/endnotesLászló Németh1-0/+3
Footnotes (like endnotes) were imported in the order of their w:footnote elements in footnotes.xml, resulting mixed footnote text content during loading documents exported from Google Docs. Import them in the order of their w:id attributes. Regression from commit 9b39ce0e66acfe812e1d50e530dc2ccdef3e1357 "tdf#76260 DOCX import: fix slow footnote import". Change-Id: I7d9ed36fe96b2b90c4d62fb1ca7201318581775d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143824 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-11-30tdf#152289: implement external glossary relations roundtripMike Kaganski1-1/+2
Change-Id: I20f4439abfbf73485734fd8373fffb2916d390f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143470 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-29use more string_view in writerfilterNoel Grandin1-1/+1
Change-Id: Idd4582138e8da9cc60e0a728bdea5542a509a4f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140711 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann1-1/+1
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-06tdf#66039 DOCX: import textboxes (with tables, images etc.) in group shapesAttila Bakos (NISZ)1-0/+7
Text boxes in group shapes were imported as shapes, losing complex text content: tables (tdf#66039), colors (tdf#73022), images (tdf#81958), lists, paragraph styles, hyperlinks (tdf#122960) and track changes. Note: a few unit tests have been deactivated temporarily. Test document "groupshape-trackedchanges.docx" of testGroupshapeTrackedchanges is imported correctly now: with track changes, and the test was modified accordingly. Follow-up to commit 2951cbdf3a6e2b62461665546b47e1d253fcb834 "tdf#143574 OOXML export/import of textboxes in group shapes". Change-Id: I6eb918dbf64393fd723fe43f798f93b5b9a12575 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125051 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-12-29be more exact about the type of pDocumentCaolán McNamara1-1/+6
Change-Id: Iab0d23e8ee691ac6ed3381bd7e1ee02bb59dc64f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127661 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-12-18tdf#104823: basic support for reading field data from databindingVasily Melenchuk1-0/+2
Change-Id: Ie45eb18205c1c54a631303b45887e54e456b6d5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125550 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-08-23update some pchesCaolán McNamara1-5/+10
Change-Id: I3f823924b276cd18eddba74f108dd577970084db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120847 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-10Clean up remaining uses of boost::logic::triboolStephan Bergmann1-1/+0
obFitShapeToText and obRelFlipV can just as well be modelled with std::optional<bool>, and obFlipH and obFlipV apparently only need two states anyway (as for a boost::logic::tribool x, bool(x == true) is true iff x has the value true) Change-Id: Ic35e33ffa4ee30d1c2cdf9f8d4aa3bae29ece2af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120281 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-28[API CHANGE] drop ShapeContextHandler service and interfaceNoel Grandin1-3/+3
There is zero chance an extension is using this, because it is so intimately tired together with the oox and writerfilter interactions. I'm removing this so I can expose the ShapeContextHandler and then override it's implementation in a more fashion without jumping through UNO hoops. Change-Id: I79ef30247f4642303dfdb92bbf8f6e6226234829 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117996 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-20Document the new classes added in d8c0b63355af6caf3f0145dd1c10a93d63134a88Mike Kaganski1-0/+8
Change-Id: Ib7421dd9dfe9245f3b6d98b772c74f22ab7f983f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114333 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-16tdf#122222: add DOCX import of resolved comments as "done"Mike Kaganski3-1/+26
Change-Id: Id596d18965de2d8c98853c281188fe8d749055f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114204 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-14tdf#100961 rtf import: fldlock is FIXEDFLDJustin Luth1-0/+1
This depends on another fix in this bug report for exporting. I'm not sure why I even bother trying to work on RTF stuff. I'm not really into black magic. Change-Id: If596cae011a261a80ca13962932bf25561c0f63f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114062 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-06update pchesCaolán McNamara1-1/+4
Change-Id: I835c8fcc237ece5cf9d7a3b261645139d022e9b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113652 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-23tdf#124176 Use pragma once in w*Vincent LE GARREC6-23/+6
Change-Id: I693f6dafb743d39afd8e41e66a8066f04043f8a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112052 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-21update pchesCaolán McNamara1-1/+1
Change-Id: I60e61133c305673bb305e41957f5414820c7c358 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112790 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-13update pchesJulien Nabet1-3/+2
Change-Id: Id6dfae9fb97fbe3fc89b9f2e083d7a3d5c1d36d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112411 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-03-06update pchesJulien Nabet1-4/+1
Change-Id: Id892e426343746df2f01f4cdc5f470351bdb6a12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112099 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-03-06update pchesJulien Nabet1-1/+4
I just used ./bin/update_pch.sh Change-Id: I06a7f36eb4c511b8d6c6477fd87e57f0d9702457 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112097 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-12-15update pchesCaolán McNamara1-4/+2
Change-Id: I280dea8fe5f346a5555f4bf479896877579d63e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107748 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-04update pchesCaolán McNamara1-1/+2
Change-Id: I3e22c2000da03f6f3345353846213203993aa865 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107192 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-19tdf#123936 Formatting files in module writerfilter with clang-formatPhilipp Hofer2-28/+20
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-09-21update pchesCaolán McNamara1-1/+2
Change-Id: I41a204fbc5e2c9b819fb948c5288f8d7b4195489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103117 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-27remove some unused includes and update pchesCaolán McNamara1-1/+4
Change-Id: I786548bef39fa711aabcff32b592b3fdc4a6f9fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101486 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-12SvTreeListBox can move into toolkit headers nowCaolán McNamara1-4/+2
Change-Id: I6b3b6ef1530a192f4b6bf87aa9688687063683ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100591 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-20compact namespace: writerfilterNoel Grandin4-18/+8
Change-Id: I1dd3aff6c08fb2bce031abd6e88603a4ec9077fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99012 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-12update pchesCaolán McNamara1-2/+3
Change-Id: I75602277a5a26b012a12f2c4f4b7ff5bb663b0b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-20writerfilter: clang-format these filesMiklos Vajna2-8/+8
I added these files more or less recently and they have long lines. Use clang-format to break at a sane column limit. (And I now promise I won't remove more files from the clang-format blacklist for a while.) Change-Id: I7eae945defe67fa19c4bd9f4789d7918bb45bf9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94585 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-04-26update pchesCaolán McNamara1-1/+5
Change-Id: I83a61da7dda6c72552eecd377f1c3744c92a797e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92909 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-22uiobject.hxx only needs forward declaresCaolán McNamara1-9/+3
and update pches accordingly Change-Id: I411712532fd85961bffe6678416fcdc1d9c7f53d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92617 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-08simplify QNameToStringNoel Grandin1-22/+3
no need for it to be a class, and no need for the data to be allocated at runtime Change-Id: I80bca34b2af221534eae5a6e90de369fa29037e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91878 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-20tdf#42949 Fix IWYU warnings in writerfilter/Gabor Kelemen3-5/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I47ff7eecabc87081eb953c5970a3cbd56c86d728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88897 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák1-6/+5
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-12-22loplugin:finalclasses in UnoControls..writerperfectNoel Grandin1-1/+1
Change-Id: I751c9a45503326dfdaeb471967a688a95d4fa090 Reviewed-on: https://gerrit.libreoffice.org/85711 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann1-1/+1
...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-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák1-3/+5
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>