From 9ad252b2e79576119c2d733a1a45fdd9e9f83140 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 21 Feb 2020 07:26:06 +0100 Subject: 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\"::' \ > -e 's/\/std::optional/g' \ > -e 's/\/std::make_optional/g' "$i" > done > for i in $(git grep -Flw o3tl::nullopt); do > sed -i -e 's/\/std::nullopt/g' "$i" > done (though that causes some of the resulting #include 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 --- .../source/engine/activities/activitiesfactory.cxx | 6 ++-- .../source/engine/activities/activitybase.hxx | 2 +- .../engine/activities/activityparameters.hxx | 6 ++-- .../engine/animationnodes/animationbasenode.cxx | 4 +-- slideshow/source/engine/shapes/drawshape.hxx | 4 +-- slideshow/source/engine/shapes/viewshape.cxx | 2 +- slideshow/source/engine/slideshowimpl.cxx | 8 ++--- .../source/engine/transitions/combtransition.cxx | 2 +- .../source/engine/transitions/combtransition.hxx | 2 +- .../source/engine/transitions/slidechangebase.cxx | 6 ++-- .../source/engine/transitions/slidechangebase.hxx | 8 ++--- .../engine/transitions/slidetransitionfactory.cxx | 34 +++++++++++----------- slideshow/source/inc/activitiesfactory.hxx | 6 ++-- slideshow/source/inc/animatedsprite.hxx | 6 ++-- 14 files changed, 48 insertions(+), 48 deletions(-) (limited to 'slideshow/source') 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 +#include #include #include @@ -101,7 +101,7 @@ class FromToByActivity : public BaseType { public: typedef typename AnimationType::ValueType ValueType; - typedef o3tl::optional OptionalValueType; + typedef std::optional 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 OptionalValueType; + typedef std::optional 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 const maRepeats; + ::std::optional 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 #include -#include +#include #include namespace slideshow { @@ -80,7 +80,7 @@ struct ActivityParameters EventQueue& rEventQueue, ActivitiesQueue& rActivitiesQueue, double nMinDuration, - ::o3tl::optional const& rRepeats, + ::std::optional 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 const& mrRepeats; + ::std::optional 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 #include -#include +#include #include using namespace com::sun::star; @@ -397,7 +397,7 @@ AnimationBaseNode::fillCommonParameters() const const bool bAutoReverse( mxAnimateNode->getAutoReverse() ); - o3tl::optional aRepeats; + std::optional 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 -#include +#include #include class Graphic; @@ -292,7 +292,7 @@ namespace slideshow mutable int mnCurrMtfLoadFlags; /// Contains the current shape bounds, in unit rect space - mutable ::o3tl::optional maCurrentShapeUnitBounds; + mutable ::std::optional 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 aClip; + std::optional 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 maUserPaintColor; + std::optional maUserPaintColor; double maUserPaintStrokeWidth; //changed for the eraser project - o3tl::optional maEraseAllInk; - o3tl::optional maEraseInk; + std::optional maEraseAllInk; + std::optional maEraseInk; //end changed std::shared_ptr mpPresTimer; @@ -840,7 +840,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( nTransitionDuration, nMinFrames, false, - o3tl::optional(1.0), + std::optional(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 const & leavingSlide, + std::optional 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 const & leavingSlide, + CombTransition( ::std::optional 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 const & leavingSlide, +SlideChangeBase::SlideChangeBase( std::optional 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(mpEnteringSlide) ); + std::optional(mpEnteringSlide) ); return rViewEntry.mpEnteringBitmap; } SlideBitmapSharedPtr SlideChangeBase::createBitmap( const UnoViewSharedPtr& rView, - const o3tl::optional& rSlide ) const + const std::optional& 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 #include -#include +#include namespace cppcanvas { @@ -73,7 +73,7 @@ protected: entering slides. */ SlideChangeBase( - ::o3tl::optional const & leavingSlide, + ::std::optional 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& rSlide_ ) const; + const std::optional& rSlide_ ) const; ::basegfx::B2ISize getEnteringSlideSizePixel( const UnoViewSharedPtr& pView ) const; @@ -184,7 +184,7 @@ private: EventMultiplexer& mrEventMultiplexer; ScreenUpdater& mrScreenUpdater; - ::o3tl::optional maLeavingSlide; + ::std::optional 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 const& leavingSlide_, + std::optional 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(), + std::optional(), pEnteringSlide, pSoundPlayer, rViewContainer, @@ -331,9 +331,9 @@ public: entering slides, which applies a fade effect. */ FadingSlideChange( - o3tl::optional const & leavingSlide, + std::optional const & leavingSlide, const SlideSharedPtr& pEnteringSlide, - o3tl::optional const& rFadeColor, + std::optional 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 const & leavingSlide, + std::optional 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& leavingSlide, + const std::optional& leavingSlide, const SlideSharedPtr& pEnteringSlide, const SoundPlayerSharedPtr& pSoundPlayer, const UnoViewContainer& rViewContainer, @@ -651,7 +651,7 @@ void MovingSlideChange::performOut( NumberAnimationSharedPtr createPushWipeTransition( - o3tl::optional const & leavingSlide_, + std::optional const & leavingSlide_, const SlideSharedPtr& pEnteringSlide, const UnoViewContainer& rViewContainer, ScreenUpdater& rScreenUpdater, @@ -661,7 +661,7 @@ NumberAnimationSharedPtr createPushWipeTransition( bool /*bTransitionDirection*/, const SoundPlayerSharedPtr& pSoundPlayer ) { - o3tl::optional leavingSlide; // no bitmap + std::optional leavingSlide; // no bitmap if (leavingSlide_ && *leavingSlide_ != nullptr) { // opt: only page, if we've an @@ -752,7 +752,7 @@ NumberAnimationSharedPtr createPushWipeTransition( } NumberAnimationSharedPtr createSlideWipeTransition( - o3tl::optional const & leavingSlide, + std::optional const & leavingSlide, const SlideSharedPtr& pEnteringSlide, const UnoViewContainer& rViewContainer, ScreenUpdater& rScreenUpdater, @@ -814,7 +814,7 @@ NumberAnimationSharedPtr createSlideWipeTransition( return std::make_shared( - o3tl::optional() /* no slide */, + std::optional() /* no slide */, pEnteringSlide, pSoundPlayer, rViewContainer, @@ -844,7 +844,7 @@ NumberAnimationSharedPtr createSlideWipeTransition( NumberAnimationSharedPtr createPluginTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubType, - o3tl::optional const& pLeavingSlide, + std::optional 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 leavingSlide; - o3tl::optional aFadeColor; + std::optional leavingSlide; + std::optional 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 +#include /* Definition of ActivitiesFactory class */ @@ -55,7 +55,7 @@ namespace ActivitiesFactory double nMinDuration, sal_uInt32 nMinNumberOfFrames, bool bAutoReverse, - ::o3tl::optional const& aRepeats, + ::std::optional const& aRepeats, double nAcceleration, double nDeceleration, const ShapeSharedPtr& rShape, @@ -110,7 +110,7 @@ namespace ActivitiesFactory unspecified, the activity will repeat indefinitely. */ - ::o3tl::optional const maRepeats; + ::std::optional 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 +#include #include @@ -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; }; -- cgit