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 /oox | |
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 'oox')
-rw-r--r-- | oox/inc/drawingml/table/tablestylepart.hxx | 10 | ||||
-rw-r--r-- | oox/inc/drawingml/textbodyproperties.hxx | 12 | ||||
-rw-r--r-- | oox/inc/drawingml/textparagraphproperties.hxx | 14 | ||||
-rw-r--r-- | oox/inc/pch/precompiled_oox.hxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraphproperties.cxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraphpropertiescontext.cxx | 4 | ||||
-rw-r--r-- | oox/source/shape/WpsContext.cxx | 4 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 6 |
9 files changed, 30 insertions, 30 deletions
diff --git a/oox/inc/drawingml/table/tablestylepart.hxx b/oox/inc/drawingml/table/tablestylepart.hxx index 056b79b393f1..f79591f35206 100644 --- a/oox/inc/drawingml/table/tablestylepart.hxx +++ b/oox/inc/drawingml/table/tablestylepart.hxx @@ -21,7 +21,7 @@ #define INCLUDED_OOX_DRAWINGML_TABLE_TABLESTYLEPART_HXX #include <rtl/ustring.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <oox/drawingml/color.hxx> #include <drawingml/textfont.hxx> #include <oox/drawingml/shape.hxx> @@ -40,8 +40,8 @@ public: TableStylePart(); ::oox::drawingml::Color& getTextColor(){ return maTextColor; } - ::o3tl::optional< bool >& getTextBoldStyle(){ return maTextBoldStyle; } - ::o3tl::optional< bool >& getTextItalicStyle(){ return maTextItalicStyle; } + ::std::optional< bool >& getTextBoldStyle(){ return maTextBoldStyle; } + ::std::optional< bool >& getTextItalicStyle(){ return maTextItalicStyle; } ::oox::drawingml::TextFont& getAsianFont(){ return maAsianFont; } ::oox::drawingml::TextFont& getComplexFont(){ return maComplexFont; } ::oox::drawingml::TextFont& getSymbolFont(){ return maSymbolFont; } @@ -55,8 +55,8 @@ public: private: ::oox::drawingml::Color maTextColor; - ::o3tl::optional< bool > maTextBoldStyle; - ::o3tl::optional< bool > maTextItalicStyle; + ::std::optional< bool > maTextBoldStyle; + ::std::optional< bool > maTextItalicStyle; ::oox::drawingml::TextFont maAsianFont; ::oox::drawingml::TextFont maComplexFont; ::oox::drawingml::TextFont maSymbolFont; diff --git a/oox/inc/drawingml/textbodyproperties.hxx b/oox/inc/drawingml/textbodyproperties.hxx index 4c378cf094a0..eddf78a5f97f 100644 --- a/oox/inc/drawingml/textbodyproperties.hxx +++ b/oox/inc/drawingml/textbodyproperties.hxx @@ -23,7 +23,7 @@ #include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <oox/helper/helper.hxx> #include <oox/helper/propertymap.hxx> -#include <o3tl/optional.hxx> +#include <optional> namespace oox { namespace drawingml { @@ -35,11 +35,11 @@ struct TextBodyProperties OptValue< sal_Int32 > moRotation; bool mbAnchorCtr; OptValue< sal_Int32 > moVert; - o3tl::optional< sal_Int32 > moInsets[4]; - o3tl::optional< sal_Int32 > moTextOffUpper; - o3tl::optional< sal_Int32 > moTextOffLeft; - o3tl::optional< sal_Int32 > moTextOffLower; - o3tl::optional< sal_Int32 > moTextOffRight; + std::optional< sal_Int32 > moInsets[4]; + std::optional< sal_Int32 > moTextOffUpper; + std::optional< sal_Int32 > moTextOffLeft; + std::optional< sal_Int32 > moTextOffLower; + std::optional< sal_Int32 > moTextOffRight; css::drawing::TextVerticalAdjust meVA; OUString msPrst; /// Number of requested columns. diff --git a/oox/inc/drawingml/textparagraphproperties.hxx b/oox/inc/drawingml/textparagraphproperties.hxx index 6b9d93ccdf78..ccca29a0750d 100644 --- a/oox/inc/drawingml/textparagraphproperties.hxx +++ b/oox/inc/drawingml/textparagraphproperties.hxx @@ -27,7 +27,7 @@ #include <com/sun/star/style/ParagraphAdjust.hpp> #include <drawingml/textfont.hxx> #include <drawingml/textspacing.hxx> -#include <o3tl/optional.hxx> +#include <optional> namespace com { namespace sun { namespace star { namespace graphic { class XGraphic; } @@ -90,10 +90,10 @@ public: TextSpacing& getParaTopMargin() { return maParaTopMargin; } TextSpacing& getParaBottomMargin() { return maParaBottomMargin; } - o3tl::optional< sal_Int32 >& getParaLeftMargin(){ return moParaLeftMargin; } - o3tl::optional< sal_Int32 >& getFirstLineIndentation(){ return moFirstLineIndentation; } + std::optional< sal_Int32 >& getParaLeftMargin(){ return moParaLeftMargin; } + std::optional< sal_Int32 >& getFirstLineIndentation(){ return moFirstLineIndentation; } - o3tl::optional< css::style::ParagraphAdjust >& getParaAdjust() { return moParaAdjust; } + std::optional< css::style::ParagraphAdjust >& getParaAdjust() { return moParaAdjust; } void setParaAdjust( css::style::ParagraphAdjust nParaAdjust ) { moParaAdjust = nParaAdjust; } TextSpacing& getLineSpacing() { return maLineSpacing; } @@ -124,9 +124,9 @@ protected: BulletList maBulletList; TextSpacing maParaTopMargin; TextSpacing maParaBottomMargin; - o3tl::optional< sal_Int32 > moParaLeftMargin; - o3tl::optional< sal_Int32 > moFirstLineIndentation; - o3tl::optional< css::style::ParagraphAdjust > moParaAdjust; + std::optional< sal_Int32 > moParaLeftMargin; + std::optional< sal_Int32 > moFirstLineIndentation; + std::optional< css::style::ParagraphAdjust > moParaAdjust; sal_Int16 mnLevel; TextSpacing maLineSpacing; }; diff --git a/oox/inc/pch/precompiled_oox.hxx b/oox/inc/pch/precompiled_oox.hxx index db3a2b78ff43..637a6b7b560f 100644 --- a/oox/inc/pch/precompiled_oox.hxx +++ b/oox/inc/pch/precompiled_oox.hxx @@ -171,7 +171,7 @@ #include <filter/msfilter/msfilterdllapi.h> #include <i18nlangtag/lang.h> #include <o3tl/cow_wrapper.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/safeint.hxx> #include <o3tl/typed_flags_set.hxx> #include <sax/fshelper.hxx> diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index d055513686bd..0cf633369959 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1167,7 +1167,7 @@ Reference< XShape > const & Shape::createAndInsert( xPropertySet->setPropertyValue(aGrabBagPropName, uno::makeAny(aGrabBag)); } // TextFrames have ShadowFormat, not individual shadow properties. - o3tl::optional<sal_Int32> oShadowDistance; + std::optional<sal_Int32> oShadowDistance; if (aShapeProps.hasProperty(PROP_ShadowXDistance)) { oShadowDistance = aShapeProps.getProperty(PROP_ShadowXDistance).get<sal_Int32>(); @@ -1178,7 +1178,7 @@ Reference< XShape > const & Shape::createAndInsert( // There is a single 'dist' attribute, so no need to count the avg of x and y. aShapeProps.erase(PROP_ShadowYDistance); } - o3tl::optional<sal_Int32> oShadowColor; + std::optional<sal_Int32> oShadowColor; if (aShapeProps.hasProperty(PROP_ShadowColor)) { oShadowColor = aShapeProps.getProperty(PROP_ShadowColor).get<sal_Int32>(); diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index 1af30b047267..bb708b0d5395 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -412,8 +412,8 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p if ( maParaBottomMargin.bHasValue || bPushDefaultValues ) aPropSet.setProperty( PROP_ParaBottomMargin, maParaBottomMargin.toMargin( fCharacterSize != 0.0 ? fCharacterSize : getCharHeightPoints ( 12.0 ) ) ); - o3tl::optional< sal_Int32 > noParaLeftMargin( moParaLeftMargin ); - o3tl::optional< sal_Int32 > noFirstLineIndentation( moFirstLineIndentation ); + std::optional< sal_Int32 > noParaLeftMargin( moParaLeftMargin ); + std::optional< sal_Int32 > noFirstLineIndentation( moFirstLineIndentation ); if ( nNumberingType != NumberingType::NUMBER_NONE ) { diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx index e59a2babb392..f4b8ec5e62a6 100644 --- a/oox/source/drawingml/textparagraphpropertiescontext.cxx +++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx @@ -91,7 +91,7 @@ TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H if ( rAttribs.hasAttribute( XML_indent ) ) { sValue = rAttribs.getString( XML_indent ).get(); - mrTextParagraphProperties.getFirstLineIndentation() = o3tl::optional< sal_Int32 >( sValue.isEmpty() ? 0 : GetCoordinate( sValue ) ); + mrTextParagraphProperties.getFirstLineIndentation() = std::optional< sal_Int32 >( sValue.isEmpty() ? 0 : GetCoordinate( sValue ) ); } // ST_TextIndentLevelType @@ -114,7 +114,7 @@ TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H if ( rAttribs.hasAttribute( XML_marL ) ) { sValue = rAttribs.getString( XML_marL ).get(); - mrTextParagraphProperties.getParaLeftMargin() = o3tl::optional< sal_Int32 >( sValue.isEmpty() ? 0 : GetCoordinate( sValue ) ); + mrTextParagraphProperties.getParaLeftMargin() = std::optional< sal_Int32 >( sValue.isEmpty() ? 0 : GetCoordinate( sValue ) ); } // ParaRightMargin diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index 28c0a1f7cafc..f78c38ff91e9 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -25,7 +25,7 @@ #include <oox/token/tokens.hxx> #include <oox/drawingml/shape.hxx> -#include <o3tl/optional.hxx> +#include <optional> using namespace com::sun::star; @@ -100,7 +100,7 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken { // Handle inset attributes for Writer textframes. sal_Int32 aInsets[] = { XML_lIns, XML_tIns, XML_rIns, XML_bIns }; - o3tl::optional<sal_Int32> oInsets[4]; + std::optional<sal_Int32> oInsets[4]; for (std::size_t i = 0; i < SAL_N_ELEMENTS(aInsets); ++i) { OptValue<OUString> oValue = rAttribs.getString(aInsets[i]); diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 70b673258dc6..c28f9c44ca5d 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -20,7 +20,7 @@ #include <algorithm> #include <cassert> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/safeint.hxx> #include <oox/vml/vmlshape.hxx> @@ -526,7 +526,7 @@ void ShapeBase::convertShapeProperties( const Reference< XShape >& rxShape ) con aPropMap.erase(PROP_FillTransparence); } // And no LineColor property; individual borders can have colors and widths - o3tl::optional<sal_Int32> oLineWidth; + std::optional<sal_Int32> oLineWidth; if (maTypeModel.maStrokeModel.moWeight.has()) oLineWidth = ConversionHelper::decodeMeasureToHmm( rGraphicHelper, maTypeModel.maStrokeModel.moWeight.get(), 0, false, false); @@ -660,7 +660,7 @@ static void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rType Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const awt::Rectangle& rShapeRect ) const { awt::Rectangle aShapeRect(rShapeRect); - o3tl::optional<sal_Int32> oRotation; + std::optional<sal_Int32> oRotation; bool bFlipX = false, bFlipY = false; if (!maTypeModel.maRotation.isEmpty()) oRotation = ConversionHelper::decodeRotation(maTypeModel.maRotation); |