summaryrefslogtreecommitdiff
path: root/canvas
AgeCommit message (Collapse)Author
2020-07-24tdf#135078: let vclcanvas::SpriteCanvas implement css::lang::XServiceInfoMike Kaganski
In Skia mode, OGLTransitionerImpl::initWindowFromSlideShowView obtains vclcanvas::SpriteCanvas from passed xView; it's passed to getDeviceInfo, which needs a css::lang::XServiceInfo to fill the device params sequence. vclcanvas::SpriteCanvas did not implement it, the sequence stayed empty, and dereferencing its elements later crashed. When Skia is disabled (VCL:win), xView provides a dxcanvas::SpriteCanvas instead, which implements css::lang::XServiceInfo. This makes vclcanvas::SpriteCanvas implement css::lang::XServiceInfo. I don't know if it's better to find out why vclcanvas::SpriteCanvas is used in Skia mode, and not dxcanvas::SpriteCanvas. Change-Id: Ic0ab1323772161052a23946cfcc91e656ba6685c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99330 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2020-07-16compact namespace: basegfx,canvasNoel Grandin
Change-Id: Idc808459b403bcdcccbd86b73dd22b424e507c8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98897 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-14canvas/gdiplus: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation. Change-Id: Ie1f1736ceda372a53e1065d4829f019338f5b7bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-14canvas/directx9: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation. Change-Id: Id8d6ef240ba872f7e93752614cd2d45fc50897ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98729 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-11tdf#134647 crash going to next slide on slideshowNoel Grandin
regression from commit 1cd0e02cdf7fc5b5903320ffd24865d11465d14b cairo/canvas: create instances with uno constructors Change-Id: I4d09f8d68a24b0efa47d12df1c542f2953efed3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98530 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-10prefer 8bit bitmap masks to 1bpp masksLuboš Luňák
It's much simpler and more performant to work with 8bpp bytes rather than fiddle with 1bpp bits, and the memory savings don't really matter nowadays. E.g. the soft edges feature performs much worse when operating on 1bpp bitmaps (tdf#134237). I've looked and it seems nothing in LO code actually requires bitmap masks to really be 1bpp. As a next step we could perhaps also leave antiquity and embrace the past by dropping 1bpp masks entirely and using just alpha masks. The change also moves the workaround for #i75531, it was breaking CppunitTest_vcl_svm_test and X11-related hacks belong to the X11 code (especially with the X11 backend becoming more and more niche). Change-Id: I7848f06c8b83bbad2ea35f17f2b65855f8d1f456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97839 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-10replace usage of whitelist with allowlistThorsten Behrens
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 [API CHANGE] officecfg::Office::Common::Misc::OpenCLWhiteList -> OpenCLAllowList Change-Id: I65636b19b13e4af1e4851f70e78053f3443d6bb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98181 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-10replace usage of blacklist with denylistThorsten Behrens
.. and a few cases of instead doing blacklist->excludelist where that made more sense. Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 [API CHANGE] officecfg::Office::Canvas::DeviceBlacklist -> DeviceDenylist [API CHANGE] officecfg::Office::Canvas::BlacklistCurrentDevice -> DenylistCurrentDevice [API CHANGE] officecfg::Office::Common::Misc::OpenCLBlackList -> OpenCLDenyList Change-Id: Ia35e25496bf0cc0692d5de4cb66bfc232d3a869e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98180 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-06cairo/canvas: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation Change-Id: I02411b23136051bfd0cd02d5378297f99127017f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98189 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-05canvas/simple: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation Change-Id: I2635df49edc2124f41a557110332ce5646cc59ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98093 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-05canvas/vcl: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation Change-Id: Ifcd31616228234433d8d46fef50707de9d17f3b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98092 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-05canvas/opengl: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation Change-Id: I2189622106e0c013567662c7bd81a057da65bf92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-29Small refactorMike Kaganski
Change-Id: I14021d3e0b83dcd4fb5544239e982c8ada32d029 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97429 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-06-24use more std::container::insert instead of std::copyNoel Grandin
which is both more compact code, and more efficient, since the insert method can do smarter resizing Change-Id: I17f226660f87cdf002edccc29b4af8fd59a25f91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-15vcl canvas, don't draw bezier curves as straight lines (tdf#133905)Luboš Luňák
Change-Id: I8a5029ef7aa6e8f46b13f0713445da435b47dbed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96209 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-05-28Make loplugin:simplifypointertobool handle parenthesized expressionsStephan Bergmann
...as discussed as an open TODO in the commit message of fe6cce01c88d045a1fcf09acf049c34c22299b02 "Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptr". The necessary changes across the code base have been done fully automatically with the rewriting plugin on Linux. (All those changes apparently involve uses of macro arguments wrapped in parentheses in the macro body, but always in conditionally-converted-to-bool contexts. In other contexts, such automatic rewriting would add the "bool" to the macro body, which would be wrong in general, but we apparently get away with that sloppy coding for now.) The parenExprs_ stack that fe6cce01c88d045a1fcf09acf049c34c22299b02 had introduced to treat such (then-undetected, it had turned out) parenthesized cases now turns out to not be needed after all. Change-Id: I2021f61c2e2805be7e18b38edf8744d186cac3cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95010 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-28loplugin:simplifybool in canvas..cuiNoel Grandin
Change-Id: Ib7c3b381ce4456e3d48538ee6f762ceaf2784fe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94973 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-26Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptrStephan Bergmann
...where the get member function is defined on a std::__shared_ptr base class, so loplugin:simplifypointertobool used to miss those until now. (While e.g. using libc++ on macOS found those cases.) 366d08f2f6d4de922f6099c62bb81b49d89e0a68 "new loplugin:simplifypointertobool" was mistaken in breaking isSmartPointerType(const clang::Type* t) out of isSmartPointerType(const Expr* e); c874294ad9fb178df47c66875bfbdec466e39763 "Fix detection of std::unique_ptr/shared_ptr in loplugin:redundantpointerops" had introduced that indivisible two-step algorithm on purpose. The amount of additional hits (on Linux) apparently asked for turning loplugin:simplifypointertobool into a rewriting plugin. Which in turn showed that the naive adivce to just "drop the get()" is not sufficient in places that are not contextually converted to bool, as those places need to be wrapped in a bool(...) functional cast now. If the expression was already wrapped in parentheses, those could be reused as part of the functional cast, but implementing that showed that such cases are not yet found at all by the existing loplugin:simplifypointertobool. Lets leave that TODO for another commit. Besides the changes to compilerplugins/ itself, this change has been generated fully automatically with the rewriting plugin on Linux. Change-Id: I83107d6f634fc9ac232986f49044d7017df83e2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94888 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2020-05-24isCairoRenderable is newly unusedCaolán McNamara
Change-Id: I3234509406989661a2e5d3866bee057c17984437 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94738 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-24remove now unnecessary cairo/virtual-device syncingCaolán McNamara
Change-Id: I0dc88b1e7c6c1ac336bbfb772c8ebced5e1b432c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94737 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-24platforms using the cairo canvas use cairo for text rendering alreadyCaolán McNamara
this wasn't true at the time the canvas text rendering was written but it is true now so its better now to just simplify this to using the vcl text rendering to render the text through cairo Change-Id: I1e63496e03e2cedc3e36e2bf10b0eab90a549629 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94736 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-22remove unnecessary polypolygon subdivideLuboš Luňák
As the comment already says, it's not necessary. And it is partially responsible for tdf#133016 by splitting an area into smaller parts, which then do not line up completely when AA-ed. Change-Id: If35e2118a0cd9c9b315b9666165c51659a9434e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94578 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-05-15use for-range on Sequence in basctl..canvasNoel Grandin
Change-Id: Idad3d8fbe785c7b1b8b287a3227372adb2757de8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94260 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10new loplugin:simplifypointertoboolNoel Grandin
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-08compact namespace in canvas..cuiNoel Grandin
Change-Id: I7bd0c2a55b936896fcfe7e1a374871008a18618f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93706 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-07fix bug in extracting propertyNoel Grandin
introduced with commit 17cd7dd708631f7af9e66860b403627416e4545e tdf#43671 set emphasis mark of vcl::Font (windows). but has probably never been a problem because I guess this propertyset almost always has 0 or 1 element. Change-Id: I17c64e376ee81cc9f92173015d2632331c63ae0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93643 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-27Make upcasting css::uno::Reference ctor require complete typesStephan Bergmann
The main reason for the "home-grown" UpCast introduced with 904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for css::uno::Reference" in 2013 was probably that we could not yet rely on C++11 std::is_base_of back then. A (welcome) side effect was that the derived class could be incomplete. However, specializations of UpCast relying on whether or not T2 is incomplete are obviously an ODR violation if the type is incomplete in some TUs and complete (and derived from T1) in others. And even if UpCast had internal linkage, it would still be brittle that its behavior depends on the completeness of T2 at the point of the template's instantiation, and not necessarily at the point of use. That means we should better base that ctor on std::is_base_of (which we can do now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on Clang and GCC if the completeness requirements are not met. This change fixes all the cases where types need to be complete now, plus any resulting loplugin:referencecasting warnings ("the source reference is already a subtype of the destination reference"). Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-22tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/Gabor Kelemen
Turns out we can save about 500Mb of preprocessor input if we use rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper rtl::math::approxEqual from rtl/math.hxx and manage the fallout accordingly. Before: bin/includebloat.awk | head sum total bytes included (excluding system headers): 19017296671 After: $ bin/includebloat.awk | head sum total bytes included (excluding system headers): 18535432672 Change-Id: I1691171f3a309405a7099882ad9989d147f59118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92508 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-18loplugin:flatten in canvasNoel Grandin
Change-Id: If14af63ab4f8fc7b9807319a2100f371ee103465 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92481 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-14loplugin:buriedassign in c*Noel Grandin
Change-Id: Id14fed7e5c0f588ad3c927f12251432d12c1a7c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92190 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-23tdf#124176 Use pragma once instead of include guardsgokaysatir
Change-Id: I3077e6e3a043401e66cd527c5f69b8571e8b25d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90915 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-03-12tdf#130977 replace `rtl::math::isFinite` with `std::isfinite`.Yukio Siraichi
- make all calls look like `std::isfinite`. - change the comments referring `rtl::math::isFinite`. Change-Id: I0cde9ceb9f20150467b454cddde5e62003cfde1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90234 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-21Drop o3tl::optional wrapperStephan Bergmann
...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>
2020-02-19avoid pointless alpha->mask conversionLuboš Luňák
The code is from 2008, so I'm rather sure at least Skia is modern enough to handle alpha at least as well as a mask (if not better). Change-Id: Ic53d5740978bce106506a182100eba927a419257 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89010 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-17document CANVAS_SPRITE_BOUNDSLuboš Luňák
From 52c998be025563802a5056a15352e4608311be1d. Change-Id: I672fa3884480e251bcbd4e32587866893f5df2c3
2020-02-16draw sprite bounds in vclcanvas only if explicitly asked forLuboš Luňák
The #ifdef on debug level got reduced to normal debug builds as an Easy Hack in f0de4374fffe7f, but that means that the green debug lines are now drawn in all debug builds. The frame info debug text is at least obviously debug output, but "random" green lines look like drawing problems, so disable them, unless explicitly asked for. Change-Id: I56ebc799ca72565cabee35552c4bd2641e2393c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88713 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-12move some canvas/ headers inside the moduleNoel Grandin
Change-Id: Iaa00cff88ad756b7e084cc68fe744d387328180b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88360 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-03loplugin:makeshared (clang-cl)Stephan Bergmann
Change-Id: I0c786bf401e514f9d86e33d8ab6366fc5dd1f425 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87887 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-31new loplugin:namespaceindentationNoel Grandin
check indentation of braces in namespace decls, and the comments that often appear with them. This is my penance for messing up the indentation with clang-tidy-modernize-namespaces. As such I have limited it to new-style namespaces for now, and the check is off by default. Change-Id: I4db7f10a81c79bc0eece8f8e3ee564da8bc7f168 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-24loplugin:makeshared in basctl..canvasNoel Grandin
Change-Id: I1461da594db222abbaeccfb636194b9790f5dbe8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87271 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-14clang-tidy modernize-concat-nested-namespace in basic..canvasNoel Grandin
Change-Id: I74a575e6ca7829ee252c0e315fc337ea223c944f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86758 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-10use more std::make_sharedNoel Grandin
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>
2019-12-19Fix typoAndrea Gelmini
Change-Id: Ib72a83e595b80d6084be65b10a9ff20458175939 Reviewed-on: https://gerrit.libreoffice.org/85488 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-19Fix typoAndrea Gelmini
Change-Id: I05a1d6f745e0df1385932585947aba66981209f2 Reviewed-on: https://gerrit.libreoffice.org/85490 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-18sal_Char->char in canvas..codemakerNoel Grandin
Change-Id: Iaf46b42a17bc00da0f86daeafea7b5346c4a6360 Reviewed-on: https://gerrit.libreoffice.org/85372 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-10force vclcanvas use with Skia, like it's with OpenGL (tdf#129076)Luboš Luňák
Related to tdf#93870. Change-Id: Ie0cb64c05c0fde6a774ce8558d06943870e775fe Reviewed-on: https://gerrit.libreoffice.org/84758 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-12-05loplugin:external (clang-cl)Stephan Bergmann
...plus loplugin:consttobool and loplugin:fakebool fallout Change-Id: Ie3d8121815c080b13bea6d9deca1eb138ca56138 Reviewed-on: https://gerrit.libreoffice.org/84515 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann
...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-12-01Rewrite uses of boost::optional, Windows reduxStephan Bergmann
...like 47dd2c63f649828a833543e21d4eca5866ec9ebe "Rewrite uses of boost::optional" Change-Id: I95373e151201563dcc9eb796f15121bc81341bfd Reviewed-on: https://gerrit.libreoffice.org/84138 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>