diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-02-21 07:26:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-02-21 14:50:28 +0100 |
commit | 9ad252b2e79576119c2d733a1a45fdd9e9f83140 (patch) | |
tree | 87fee16145d457b6799a05c389d85270476f7f35 /slideshow | |
parent | 3aca35f1505fa552eaa316a2d47a60ef52646525 (diff) |
Drop o3tl::optional wrapper
...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 "<"/">" 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>
Diffstat (limited to 'slideshow')
15 files changed, 49 insertions, 49 deletions
diff --git a/slideshow/inc/pch/precompiled_slideshow.hxx b/slideshow/inc/pch/precompiled_slideshow.hxx index ace76f44f501..b813b79475c2 100644 --- a/slideshow/inc/pch/precompiled_slideshow.hxx +++ b/slideshow/inc/pch/precompiled_slideshow.hxx @@ -209,7 +209,7 @@ #include <editeng/macros.hxx> #include <i18nlangtag/lang.h> #include <o3tl/cow_wrapper.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/sorted_vector.hxx> #include <o3tl/strong_int.hxx> #include <o3tl/typed_flags_set.hxx> diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx b/slideshow/source/engine/activities/activitiesfactory.cxx index 6f5a05b197cb..4732197657ba 100644 --- a/slideshow/source/engine/activities/activitiesfactory.cxx +++ b/slideshow/source/engine/activities/activitiesfactory.cxx @@ -35,7 +35,7 @@ #include "continuousactivitybase.hxx" #include "continuouskeytimeactivitybase.hxx" -#include <o3tl/optional.hxx> +#include <optional> #include <memory> #include <vector> @@ -101,7 +101,7 @@ class FromToByActivity : public BaseType { public: typedef typename AnimationType::ValueType ValueType; - typedef o3tl::optional<ValueType> OptionalValueType; + typedef std::optional<ValueType> OptionalValueType; private: // some compilers don't inline whose definition they haven't @@ -389,7 +389,7 @@ AnimationActivitySharedPtr createFromToByActivity( const ::basegfx::B2DVector& rSlideBounds ) { typedef typename AnimationType::ValueType ValueType; - typedef o3tl::optional<ValueType> OptionalValueType; + typedef std::optional<ValueType> OptionalValueType; OptionalValueType aFrom; OptionalValueType aTo; diff --git a/slideshow/source/engine/activities/activitybase.hxx b/slideshow/source/engine/activities/activitybase.hxx index 8fdc6be71601..fdf492aca9ef 100644 --- a/slideshow/source/engine/activities/activitybase.hxx +++ b/slideshow/source/engine/activities/activitybase.hxx @@ -126,7 +126,7 @@ private: AnimatableShapeSharedPtr mpShape; // only to pass on to animation ShapeAttributeLayerSharedPtr mpAttributeLayer; // only to pass on to anim - ::o3tl::optional<double> const maRepeats; + ::std::optional<double> const maRepeats; const double mnAccelerationFraction; const double mnDecelerationFraction; diff --git a/slideshow/source/engine/activities/activityparameters.hxx b/slideshow/source/engine/activities/activityparameters.hxx index d915230fe792..a8835a4cce21 100644 --- a/slideshow/source/engine/activities/activityparameters.hxx +++ b/slideshow/source/engine/activities/activityparameters.hxx @@ -25,7 +25,7 @@ #include <expressionnode.hxx> #include <wakeupevent.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <vector> namespace slideshow { @@ -80,7 +80,7 @@ struct ActivityParameters EventQueue& rEventQueue, ActivitiesQueue& rActivitiesQueue, double nMinDuration, - ::o3tl::optional<double> const& rRepeats, + ::std::optional<double> const& rRepeats, double nAccelerationFraction, double nDecelerationFraction, sal_uInt32 nMinNumberOfFrames, @@ -117,7 +117,7 @@ struct ActivityParameters /// Total duration of activity (including all repeats) const double mnMinDuration; - ::o3tl::optional<double> const& mrRepeats; + ::std::optional<double> const& mrRepeats; const double mnAccelerationFraction; const double mnDecelerationFraction; diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index 01059ec39b77..4dcb640795aa 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx @@ -30,7 +30,7 @@ #include <delayevent.hxx> #include <framerate.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <algorithm> using namespace com::sun::star; @@ -397,7 +397,7 @@ AnimationBaseNode::fillCommonParameters() const const bool bAutoReverse( mxAnimateNode->getAutoReverse() ); - o3tl::optional<double> aRepeats; + std::optional<double> aRepeats; double nRepeats = 0; if( mxAnimateNode->getRepeatCount() >>= nRepeats ) { aRepeats = nRepeats; diff --git a/slideshow/source/engine/shapes/drawshape.hxx b/slideshow/source/engine/shapes/drawshape.hxx index a7bfa8812032..e4def440fe3d 100644 --- a/slideshow/source/engine/shapes/drawshape.hxx +++ b/slideshow/source/engine/shapes/drawshape.hxx @@ -30,7 +30,7 @@ #include "viewshape.hxx" #include <hyperlinkarea.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <vector> class Graphic; @@ -292,7 +292,7 @@ namespace slideshow mutable int mnCurrMtfLoadFlags; /// Contains the current shape bounds, in unit rect space - mutable ::o3tl::optional<basegfx::B2DRectangle> maCurrentShapeUnitBounds; + mutable ::std::optional<basegfx::B2DRectangle> maCurrentShapeUnitBounds; // The attributes of this Shape const double mnPriority; diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index 4b69c4320c45..f2d909524c06 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -542,7 +542,7 @@ namespace slideshow::internal // shape needs repaint - setup all that's needed - o3tl::optional<basegfx::B2DPolyPolygon> aClip; + std::optional<basegfx::B2DPolyPolygon> aClip; if( pAttr ) { diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 0e3d0f87e927..7125f5191895 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -400,13 +400,13 @@ private: //map of vector of Polygons, containing polygons drawn on each slide. PolygonMap maPolygons; - o3tl::optional<RGBColor> maUserPaintColor; + std::optional<RGBColor> maUserPaintColor; double maUserPaintStrokeWidth; //changed for the eraser project - o3tl::optional<bool> maEraseAllInk; - o3tl::optional<sal_Int32> maEraseInk; + std::optional<bool> maEraseAllInk; + std::optional<sal_Int32> maEraseInk; //end changed std::shared_ptr<canvas::tools::ElapsedTime> mpPresTimer; @@ -840,7 +840,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( nTransitionDuration, nMinFrames, false, - o3tl::optional<double>(1.0), + std::optional<double>(1.0), 0.0, 0.0, ShapeSharedPtr(), diff --git a/slideshow/source/engine/transitions/combtransition.cxx b/slideshow/source/engine/transitions/combtransition.cxx index d1dbe9b15db5..3fcdbb2e0d2c 100644 --- a/slideshow/source/engine/transitions/combtransition.cxx +++ b/slideshow/source/engine/transitions/combtransition.cxx @@ -65,7 +65,7 @@ basegfx::B2DPolyPolygon createClipPolygon( } CombTransition::CombTransition( - o3tl::optional<SlideSharedPtr> const & leavingSlide, + std::optional<SlideSharedPtr> const & leavingSlide, const SlideSharedPtr& pEnteringSlide, const SoundPlayerSharedPtr& pSoundPlayer, const UnoViewContainer& rViewContainer, diff --git a/slideshow/source/engine/transitions/combtransition.hxx b/slideshow/source/engine/transitions/combtransition.hxx index 2446e4923b95..082e673135b9 100644 --- a/slideshow/source/engine/transitions/combtransition.hxx +++ b/slideshow/source/engine/transitions/combtransition.hxx @@ -38,7 +38,7 @@ public: @param nNumStripes Number of comb-like stripes to show in this effect */ - CombTransition( ::o3tl::optional<SlideSharedPtr> const & leavingSlide, + CombTransition( ::std::optional<SlideSharedPtr> const & leavingSlide, const SlideSharedPtr& pEnteringSlide, const SoundPlayerSharedPtr& pSoundPlayer, const UnoViewContainer& rViewContainer, diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx index a3edf1a8e882..bee40c9480aa 100644 --- a/slideshow/source/engine/transitions/slidechangebase.cxx +++ b/slideshow/source/engine/transitions/slidechangebase.cxx @@ -32,7 +32,7 @@ using namespace com::sun::star; namespace slideshow::internal { -SlideChangeBase::SlideChangeBase( o3tl::optional<SlideSharedPtr> const & leavingSlide, +SlideChangeBase::SlideChangeBase( std::optional<SlideSharedPtr> const & leavingSlide, const SlideSharedPtr& pEnteringSlide, const SoundPlayerSharedPtr& pSoundPlayer, const UnoViewContainer& rViewContainer, @@ -71,13 +71,13 @@ SlideBitmapSharedPtr SlideChangeBase::getEnteringBitmap( const ViewEntry& rViewE { if( !rViewEntry.mpEnteringBitmap ) rViewEntry.mpEnteringBitmap = createBitmap( rViewEntry.mpView, - o3tl::optional<SlideSharedPtr>(mpEnteringSlide) ); + std::optional<SlideSharedPtr>(mpEnteringSlide) ); return rViewEntry.mpEnteringBitmap; } SlideBitmapSharedPtr SlideChangeBase::createBitmap( const UnoViewSharedPtr& rView, - const o3tl::optional<SlideSharedPtr>& rSlide ) const + const std::optional<SlideSharedPtr>& rSlide ) const { SlideBitmapSharedPtr pRet; if( !rSlide ) diff --git a/slideshow/source/engine/transitions/slidechangebase.hxx b/slideshow/source/engine/transitions/slidechangebase.hxx index 443c8ed81ebe..492bc597128c 100644 --- a/slideshow/source/engine/transitions/slidechangebase.hxx +++ b/slideshow/source/engine/transitions/slidechangebase.hxx @@ -28,7 +28,7 @@ #include <soundplayer.hxx> #include <memory> -#include <o3tl/optional.hxx> +#include <optional> namespace cppcanvas { @@ -73,7 +73,7 @@ protected: entering slides. */ SlideChangeBase( - ::o3tl::optional<SlideSharedPtr> const & leavingSlide, + ::std::optional<SlideSharedPtr> const & leavingSlide, const SlideSharedPtr& pEnteringSlide, const SoundPlayerSharedPtr& pSoundPlayer, const UnoViewContainer& rViewContainer, @@ -114,7 +114,7 @@ protected: SlideBitmapSharedPtr getEnteringBitmap( const ViewEntry& rViewEntry ) const; SlideBitmapSharedPtr createBitmap( const UnoViewSharedPtr& pView, - const o3tl::optional<SlideSharedPtr>& rSlide_ ) const; + const std::optional<SlideSharedPtr>& rSlide_ ) const; ::basegfx::B2ISize getEnteringSlideSizePixel( const UnoViewSharedPtr& pView ) const; @@ -184,7 +184,7 @@ private: EventMultiplexer& mrEventMultiplexer; ScreenUpdater& mrScreenUpdater; - ::o3tl::optional<SlideSharedPtr> maLeavingSlide; + ::std::optional<SlideSharedPtr> maLeavingSlide; SlideSharedPtr mpEnteringSlide; ViewsVecT maViewData; diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx index 6c12603836f1..e28aa070d46c 100644 --- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx @@ -108,7 +108,7 @@ public: */ PluginSlideChange( sal_Int16 nTransitionType, sal_Int16 nTransitionSubType, - o3tl::optional<SlideSharedPtr> const& leavingSlide_, + std::optional<SlideSharedPtr> const& leavingSlide_, const SlideSharedPtr& pEnteringSlide, const UnoViewContainer& rViewContainer, ScreenUpdater& rScreenUpdater, @@ -270,7 +270,7 @@ public: SlideChangeBase( // leaving bitmap is empty, we're leveraging the fact that the // old slide is still displayed in the background: - o3tl::optional<SlideSharedPtr>(), + std::optional<SlideSharedPtr>(), pEnteringSlide, pSoundPlayer, rViewContainer, @@ -331,9 +331,9 @@ public: entering slides, which applies a fade effect. */ FadingSlideChange( - o3tl::optional<SlideSharedPtr> const & leavingSlide, + std::optional<SlideSharedPtr> const & leavingSlide, const SlideSharedPtr& pEnteringSlide, - o3tl::optional<RGBColor> const& rFadeColor, + std::optional<RGBColor> const& rFadeColor, const SoundPlayerSharedPtr& pSoundPlayer, const UnoViewContainer& rViewContainer, ScreenUpdater& rScreenUpdater, @@ -364,7 +364,7 @@ public: double t ) override; private: - const o3tl::optional< RGBColor > maFadeColor; + const std::optional< RGBColor > maFadeColor; }; void FadingSlideChange::prepareForRun( @@ -429,7 +429,7 @@ public: entering slides, which applies a cut effect. */ CutSlideChange( - o3tl::optional<SlideSharedPtr> const & leavingSlide, + std::optional<SlideSharedPtr> const & leavingSlide, const SlideSharedPtr& pEnteringSlide, const RGBColor& rFadeColor, const SoundPlayerSharedPtr& pSoundPlayer, @@ -533,7 +533,7 @@ public: final slide position. The vector must have unit length. */ MovingSlideChange( - const o3tl::optional<SlideSharedPtr>& leavingSlide, + const std::optional<SlideSharedPtr>& leavingSlide, const SlideSharedPtr& pEnteringSlide, const SoundPlayerSharedPtr& pSoundPlayer, const UnoViewContainer& rViewContainer, @@ -651,7 +651,7 @@ void MovingSlideChange::performOut( NumberAnimationSharedPtr createPushWipeTransition( - o3tl::optional<SlideSharedPtr> const & leavingSlide_, + std::optional<SlideSharedPtr> const & leavingSlide_, const SlideSharedPtr& pEnteringSlide, const UnoViewContainer& rViewContainer, ScreenUpdater& rScreenUpdater, @@ -661,7 +661,7 @@ NumberAnimationSharedPtr createPushWipeTransition( bool /*bTransitionDirection*/, const SoundPlayerSharedPtr& pSoundPlayer ) { - o3tl::optional<SlideSharedPtr> leavingSlide; // no bitmap + std::optional<SlideSharedPtr> leavingSlide; // no bitmap if (leavingSlide_ && *leavingSlide_ != nullptr) { // opt: only page, if we've an @@ -752,7 +752,7 @@ NumberAnimationSharedPtr createPushWipeTransition( } NumberAnimationSharedPtr createSlideWipeTransition( - o3tl::optional<SlideSharedPtr> const & leavingSlide, + std::optional<SlideSharedPtr> const & leavingSlide, const SlideSharedPtr& pEnteringSlide, const UnoViewContainer& rViewContainer, ScreenUpdater& rScreenUpdater, @@ -814,7 +814,7 @@ NumberAnimationSharedPtr createSlideWipeTransition( return std::make_shared<MovingSlideChange>( - o3tl::optional<SlideSharedPtr>() /* no slide */, + std::optional<SlideSharedPtr>() /* no slide */, pEnteringSlide, pSoundPlayer, rViewContainer, @@ -844,7 +844,7 @@ NumberAnimationSharedPtr createSlideWipeTransition( NumberAnimationSharedPtr createPluginTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubType, - o3tl::optional<SlideSharedPtr> const& pLeavingSlide, + std::optional<SlideSharedPtr> const& pLeavingSlide, const SlideSharedPtr& pEnteringSlide, const UnoViewContainer& rViewContainer, ScreenUpdater& rScreenUpdater, @@ -912,7 +912,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( createPluginTransition( nTransitionType, nTransitionSubType, - o3tl::make_optional(pLeavingSlide), + std::make_optional(pLeavingSlide), pEnteringSlide, rViewContainer, rScreenUpdater, @@ -1006,7 +1006,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( case animations::TransitionType::PUSHWIPE: { return createPushWipeTransition( - o3tl::make_optional(pLeavingSlide), + std::make_optional(pLeavingSlide), pEnteringSlide, rViewContainer, rScreenUpdater, @@ -1020,7 +1020,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( case animations::TransitionType::SLIDEWIPE: { return createSlideWipeTransition( - o3tl::make_optional(pLeavingSlide), + std::make_optional(pLeavingSlide), pEnteringSlide, rViewContainer, rScreenUpdater, @@ -1035,8 +1035,8 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( case animations::TransitionType::FADE: { // black page: - o3tl::optional<SlideSharedPtr> leavingSlide; - o3tl::optional<RGBColor> aFadeColor; + std::optional<SlideSharedPtr> leavingSlide; + std::optional<RGBColor> aFadeColor; switch( nTransitionSubType ) { diff --git a/slideshow/source/inc/activitiesfactory.hxx b/slideshow/source/inc/activitiesfactory.hxx index 1734fc1ea8b0..ce4a1d3ee0b7 100644 --- a/slideshow/source/inc/activitiesfactory.hxx +++ b/slideshow/source/inc/activitiesfactory.hxx @@ -36,7 +36,7 @@ #include "boolanimation.hxx" #include "pairanimation.hxx" -#include <o3tl/optional.hxx> +#include <optional> /* Definition of ActivitiesFactory class */ @@ -55,7 +55,7 @@ namespace ActivitiesFactory double nMinDuration, sal_uInt32 nMinNumberOfFrames, bool bAutoReverse, - ::o3tl::optional<double> const& aRepeats, + ::std::optional<double> const& aRepeats, double nAcceleration, double nDeceleration, const ShapeSharedPtr& rShape, @@ -110,7 +110,7 @@ namespace ActivitiesFactory unspecified, the activity will repeat indefinitely. */ - ::o3tl::optional<double> const maRepeats; + ::std::optional<double> const maRepeats; /// Fraction of simple time to accelerate animation double const mnAcceleration; diff --git a/slideshow/source/inc/animatedsprite.hxx b/slideshow/source/inc/animatedsprite.hxx index aa7384841412..c76b06b73bd1 100644 --- a/slideshow/source/inc/animatedsprite.hxx +++ b/slideshow/source/inc/animatedsprite.hxx @@ -26,7 +26,7 @@ #include "viewlayer.hxx" -#include <o3tl/optional.hxx> +#include <optional> #include <memory> @@ -145,8 +145,8 @@ namespace slideshow double const mnSpritePrio; double mnAlpha; - ::o3tl::optional< ::basegfx::B2DPoint > maPosPixel; - ::o3tl::optional< ::basegfx::B2DPolyPolygon > maClip; + ::std::optional< ::basegfx::B2DPoint > maPosPixel; + ::std::optional< ::basegfx::B2DPolyPolygon > maClip; bool mbSpriteVisible; }; |