Commit Graph

7960 Commits

Author SHA1 Message Date
Desmin Alpaslan
f17f9bf0b3 tdf#96505: Get rid of cargo cult long integer literals
Change-Id: Id64855e3879d21106930a4dc9c36b246deb3c6e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85818
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-03 15:45:39 +01:00
Noel Grandin
c82efb610b clang-tidy modernize-concat-nested-namespace
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-31 18:36:09 +01:00
Caolán McNamara
f0c2e0d27c cid#1458020 Untrusted loop bound
cid#1458018 Untrusted loop bound
cid#1242844 Untrusted loop bound

Change-Id: I9062240290708f4b51b0ce42a30897b50d1a2677
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87702
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-29 20:24:02 +01:00
Caolán McNamara
090cf1e3bb ofz#20366 OOM
Change-Id: If658720502739e6ad88c3cf73ac6674e0313a48b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87648
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-28 21:36:48 +01:00
Onur Yilmaz
b44ad15cd7 tdf#96505: Get rid of cargo cult long integer literals
I checked return values.
Long variables didn't affect the calculation.

Change-Id: Ia3713eedf275de71b1096d1fe7e22da012a7f94e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87493
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-28 16:53:27 +01:00
Stephan Bergmann
aef7feb3e6 New loplugin:unsignedcompare
"Find explicit casts from signed to unsigned integer in comparison against
unsigned integer, where the cast is presumably used to avoid warnings about
signed vs. unsigned comparisons, and could thus be replaced with
o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx)

o3tl::make_unsigned requires its argument to be non-negative, and there is a
chance that some original code like

  static_cast<sal_uInt32>(n) >= c

used the explicit cast to actually force a (potentially negative) value of
sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the
cast to avoid a false "signed vs. unsigned comparison" warning in a case where
n is known to be non-negative.  It appears that restricting this plugin to non-
equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=)
is a useful heuristic to avoid such false positives.  The only remainging false
positive I found was 0288c8ffec "Rephrase cast
from sal_Int32 to sal_uInt32".

But which of course does not mean that there were no further false positivies
that I missed.  So this commit may accidentally introduce some false hits of the
assert in o3tl::make_unsigned.  At least, it passed a full (Linux ASan+UBSan
--enable-dbgutil) `make check && make screenshot`.

It is by design that o3tl::make_unsigned only accepts signed integer parameter
types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses
which would in general be suspicious.  But the STATIC_ARRAY_SELECT macro in
include/oox/helper/helper.hxx is used with both signed and unsigned types, so
needs a little oox::detail::make_unsigned helper function for now.  (The
ultimate fix being to get rid of the macro in the first place.)

Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-28 07:42:15 +01:00
Noel Grandin
65f007c629 remove some unused local vars
found by my new aggressive unused var plugin. these are unused return
values from function calls

Change-Id: I3359c583f535828f192cb833762dfedc008d82f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87439
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-28 07:19:46 +01:00
Sarper Akdemir
4b723bf58c tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor
Change-Id: I37a8b72895e75bf1f0e7e1b1574353b3317ca031
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87500
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-27 21:55:17 +01:00
Stephan Bergmann
dc96e0b87a Use properly typed variable for iteration
Change-Id: I5fa9a889922f41be3f124ae0f66afac35130f41a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87490
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-27 13:49:51 +01:00
Noel Grandin
51b5b93092 remove some unused local vars
found by a more aggressive variant of loplugin:unusedvariables.

This is my first pass, committing the simplest and most obviously
unnecessary vars

Change-Id: I9676a6e39a101937097788548764506c93811c57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87414
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-26 08:01:42 +01:00
Noel Grandin
b9fe4f26ea rename some local variables
mostly to make the job of my very aggressive unused local vars plugin
easier

Change-Id: Ifc21a920841f8589f8b7e10de39dba6622a5d501
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87399
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-26 08:01:13 +01:00
Noel Grandin
6b4fe3e44b loplugin:makeshared in drawinglayer..fpicker
Change-Id: Ib20fec3a7b6bfe2f94c6f5f2f9fa0be6f7c21e97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87320
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-24 09:04:45 +01:00
Miklos Vajna
3b9797671c PDF export: don't ignore FilterData specified by UNO clients
The data was given to the PDF filter, but then we stopped iterating
right after finding our output stream. Seems this was always like this,
ever since commit 4111b430a0 (#101570#:
added pdf filter, 2002-08-13).

Change-Id: If26661935c22a7b7959fda5f92b4d50b15f13a35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87152
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2020-01-21 17:51:04 +01:00
Caolán McNamara
6095612850 ofz#20160 Integer-overflow
since...

commit cf82475c78
Date:   Sun Dec 8 19:46:45 2019 +0530

    tdf#114441 Changing sal_uLong to appropriate integer type in filters module

Change-Id: I1f29e764c6405bb05dfd27da06bdc08cf8ae13cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86947
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2020-01-16 22:30:58 +01:00
Caolán McNamara
ed4a1a71f0 ofz#20150 unknown read
since...

commit cf82475c78
Date:   Sun Dec 8 19:46:45 2019 +0530

    tdf#114441 Changing sal_uLong to appropriate integer type in filters module

Change-Id: I22b56d9a0084e7d55a2299143eae3d806f976d5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86936
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-16 20:30:25 +01:00
shashikdm
cf82475c78 tdf#114441 Changing sal_uLong to appropriate integer type in filters module
changed sal_uLong to one of {size_t, sal_uInt64, sal_uInt32, sal_uInt16, sal_uInt8} in flash/impswfdialog.cxx and graphicsfilter

   changed PS_* in file filter/source/eps/eps.cxx to enum and overloaded bitwise or (|)
   made types of nSize, nParseThis, nComp and nBytesRead to sal_uInt32 as Michael Stahl suggested

   changes suggested by Michael Stahl
   changed x, y, j to sal_uInt32 in filter/source/graphicfilter/etiff/etiff.cxx
   changed nMinPercent, nMaxPercent, nLastPercent, nMainEntitiesCount to sal_uInt16 in filter/source/graphicfilter/idxf/dxf2mtf.hxx
   removed nGcount variable from filter/source/graphicfilter/idxf/dxfgrprd.hxx and filter/source/graphicfilter/idxf/dxfgrprd.cxx
   removed static_cast in filter/source/graphicfilter/idxf/dxf2mtf.cxx
   changed nComp in filter/source/graphicfilter/ieps/ieps.cxx to size_t
   changed mnCol to sal_uInt16 in filter/source/graphicfilter/ipbm/ipbm.cxx

   revised a number of datatypes as suggested by michael stahl in his reviews

   removed redundant static casts which caused test to fail

Change-Id: Id892ee7e9c1ef3cf75c9d768b790ced9c2ce3f3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84726
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-15 19:12:37 +01:00
Noel Grandin
52fece1234 tweak GetBitmap methods in BitmapEx
so we return a const& for the normal case, just like other methods,
which reduces copying.

This revealed that CreateDisplayBitmap in Bitmap can be const.

Change-Id: I9f9b9ff0c52d7e95eaae62af152218be8847dd63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86836
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15 14:33:52 +01:00
Caolán McNamara
40887f3844 ofz#20087 Invalid-enum-value
Change-Id: I32966a6b3973a0db9e186260225ded216607efbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86809
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-14 22:16:38 +01:00
Caolán McNamara
bfb7fef85f ofz#20051 if duplicate exists then m_ObjToRecMap points to deleted element
Change-Id: I854410ba1d5c0a622b5ba9c6816a24a3477e5089
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86681
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-13 14:22:34 +01:00
Yusuf Keten
dd3e75758f tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor
Change-Id: I9b285a80e0d52f412e2738995d66aa65cf93d16a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86606
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-12 17:07:31 +01:00
Caolán McNamara
3cd738d52e ofz#20031 Abrt
Change-Id: I54451cdda29b9683fc8adf8374cb611bbebf0097
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86627
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-12 15:40:17 +01:00
Caolán McNamara
f189d87c37 ofz#20025 Invalid-enum-value
Change-Id: Ia1972a283b7d1d27a60ac763498eb175530b0c4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86612
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-11 21:24:51 +01:00
Noel Grandin
175a2063ef use more std::make_shared
found using 'git grep', I tried using clang-tidy, but it only
successfully found a tiny fraction of these

Change-Id: I61c7d85105ff7a911722750e759d6641d578da33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-10 13:07:41 +01:00
Stephan Bergmann
6417668b3e Introduce o3tl::make_unsigned to cast from signed to unsigned type
...without having to spell out a specific type to cast to (and also making it
more obvious what the intend of such a cast is)

Change-Id: Id9c68b856a4ee52e5a40d15dc9d83e95d1c231cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86502
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-09 20:34:01 +01:00
Stephan Bergmann
6efffbbfce Improve loplugin:redundantcast for sal_Int... vs. ::sal_Int...
Change-Id: I1548a76fdc03afee68f1e5c01bc665e616f2edf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86501
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-09 20:21:59 +01:00
Tomaž Vajngerl
08886d9d01 tdf#45636 trigger accessibility check when exporting as PDF/UA
This triggers the accessibility check, when we want to export
the PDF with PDF/UA functionallity. If issues are found, it will
show the issues. OK will continue with export despite the issues
and cancel will cancel the whole PDF export.

Change-Id: I2fde97381e08e9c2c79473888caa36e8dd828979
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86387
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-01-09 17:05:05 +01:00
andreas kainz
dc527881b3 use for jpeg quality everywhere 80
Change-Id: I1744cb5e281b5d36dc9a29c85c7685730e3fbb32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86438
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2020-01-09 09:36:59 +01:00
Yusuf Keten
d66ddcffe6 tdf#75280 Convert inappropriate use of sal_uIntPtr to better integer types
Change-Id: Idf73b768671c0daa0d815b75ce71740fc0e5f5c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86310
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-08 16:24:12 +01:00
Caolán McNamara
fcf25f3b30 ofz#19901 Invalid-enum-value
Change-Id: I14273dfc695c504bd00f23f614b041207a8f2b29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86396
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-08 12:39:14 +01:00
Caolán McNamara
0ab8ae4d98 ofz#19803 check for negative values
Change-Id: I30036a16cf1651a7e27c7aefa086b3725d58933a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86250
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2020-01-06 16:45:40 +01:00
Andrea Gelmini
744903b8c8 Removed redundant semicolons
Change-Id: Ife14b8c3f7d121deb390deb5f405dd42d3016acf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86156
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-06 11:29:45 +01:00
Tomaž Vajngerl
b0a468d75f pdf: set the UniversalAccessibilityCompliance from the dialog
Change-Id: I380b760a39bcdbef271c948690b1c9a95c769b4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86213
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-01-04 17:36:54 +01:00
Caolán McNamara
be1474f51a ofz#19790 Invalid-enum-value
Change-Id: Ifca6b26b39d873f67d6161d19354be4bd6462953
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86200
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-04 16:58:49 +01:00
Tomaž Vajngerl
5a7cfe98e9 pdf: Add option for PDF/UA to the PDF export dialog
This is adding PDF/UA option to the PDF export dialog. When PDF/UA
support is enabled, it automatically enables PDFTag support as it
is required for PDF/UA.

Change-Id: Ib3dece964523d4ed9884c98a6022a91120c6065f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85921
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-12-29 17:00:44 +01:00
Caolán McNamara
3e71e97e00 ofz#19594 Invalid-enum-value
Change-Id: Iffd708aa30d8dde2badc4748d2adb53b64c376aa
Reviewed-on: https://gerrit.libreoffice.org/85534
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-20 09:54:58 +01:00
Andrea Gelmini
738b7b3d30 Fix typo
Change-Id: I90432c3d81878a43f7562e3798a9f5d8133f92ee
Reviewed-on: https://gerrit.libreoffice.org/85489
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-19 10:28:01 +01:00
Noel Grandin
343408484c sal_Char->char in filter
Change-Id: I0cec9d1f552e3350e2a2748861447a8f0afa64e8
Reviewed-on: https://gerrit.libreoffice.org/85474
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-19 09:02:45 +01:00
Gabor Kelemen
5e80d0fe63 tdf#42949 Fix IWYU warnings in filter/
Also drop inc/gfxtypes.hxx and source/svg/spirit_supplements.hxx
which are unused since commit
3ca7be0983
"Replace SVGFilter using SVGIO"

Drop now unneeded pass-through header
source/graphicfilter/icgm/main.hxx too.

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I8abaf294370c98256815a226168085dd01123f3e
Reviewed-on: https://gerrit.libreoffice.org/84734
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-17 10:32:33 +01:00
Noel Grandin
20ff62d319 loplugin:expandablemethods
Change-Id: Ifc269d9996928085a3ab78033788465b4f029368
Reviewed-on: https://gerrit.libreoffice.org/85255
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-17 08:59:30 +01:00
Caolán McNamara
8a14fb988e ofz#19525 Invalid enum value
value is unused anyway, so just reflect that

Change-Id: I032f477dddd4d50c791898eb214dac2dbbb69f09
Reviewed-on: https://gerrit.libreoffice.org/85203
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-16 12:21:49 +01:00
Andrea Gelmini
8a107f3049 Fix typo
Change-Id: Ie98e584633177e6268d831abed488f1d0fa1688e
Reviewed-on: https://gerrit.libreoffice.org/85152
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-14 22:44:00 +01:00
Jan-Marek Glogowski
b06cba8f13 tdf#127493 store ExportFormFields checkbox value
... and also correctly set the initial frames sensitivity.

The commit removed the no longer needed UserSelection variant of
mbExportFormFields but forgit to actually set it now.

Regression from my commit 76fcd878da1624e73f1eb9d9405485d4faf66edf.

Change-Id: Ia5fcc1c37e2e4b4a330b59a492f817d2db8d7347
Reviewed-on: https://gerrit.libreoffice.org/84975
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-12-12 08:41:44 +01:00
Andrea Gelmini
d87f6fd46d Fix typos
Change-Id: I89ff5493c70d6e64ee6ab65b1b789a0db543c0aa
Reviewed-on: https://gerrit.libreoffice.org/84917
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-11 14:14:27 +01:00
Andrea Gelmini
a70b4f2404 Fix typos
Change-Id: I73f1f48272a95232658458dff1dc750112a4667e
Reviewed-on: https://gerrit.libreoffice.org/84898
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-10 22:52:42 +01:00
Julien Nabet
20e5399cfe Fix refs to tdf#124029
Change-Id: I451d9c1abbe0c03a3a55b3cc153ba2852a1bbc26
Reviewed-on: https://gerrit.libreoffice.org/84584
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-05 21:25:54 +01:00
Stephan Bergmann
be3a818301 Use o3tl::doAccess, prevent -Werror=maybe-uninitialized
Change-Id: Iff932423bfd1964fa5fa2dfa74de9b7c9b6701f3
Reviewed-on: https://gerrit.libreoffice.org/84423
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-04 18:00:05 +01:00
Noel Grandin
f656547d4d remove some useless comment lines
which merely announce that the next declaration is a class

Change-Id: Ifdb1398bcd99816b13e0b3769b46d0562bfbc1dc
Reviewed-on: https://gerrit.libreoffice.org/84229
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-03 12:46:27 +01:00
Caolán McNamara
8963bb0def new[]/delete mismatch
Change-Id: Ife47f111b3910c2eca322678f3f7a67b5cc2cd24
Reviewed-on: https://gerrit.libreoffice.org/84218
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-03 09:57:45 +01:00
Caolán McNamara
a322e61b51 ofz#19207 check max strlen possible
Change-Id: I5fe9fde240ef375d9de097dda47953320ecc758d
Reviewed-on: https://gerrit.libreoffice.org/84219
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-02 18:11:34 +01:00
Stephan Bergmann
7e403195e5 Introduce o3tl::optional as an alias for std::optional
...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
fed7c3deb3 "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-12-01 14:57:16 +01:00