summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-02-21 07:26:06 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-02-21 14:50:28 +0100
commit9ad252b2e79576119c2d733a1a45fdd9e9f83140 (patch)
tree87fee16145d457b6799a05c389d85270476f7f35 /oox/source
parent3aca35f1505fa552eaa316a2d47a60ef52646525 (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 "&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>
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/shape.cxx4
-rw-r--r--oox/source/drawingml/textparagraphproperties.cxx4
-rw-r--r--oox/source/drawingml/textparagraphpropertiescontext.cxx4
-rw-r--r--oox/source/shape/WpsContext.cxx4
-rw-r--r--oox/source/vml/vmlshape.cxx6
5 files changed, 11 insertions, 11 deletions
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);