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 --- svx/inc/pch/precompiled_svx.hxx | 2 +- svx/inc/pch/precompiled_svxcore.hxx | 2 +- svx/source/accessibility/AccessibleEmptyEditSource.cxx | 2 +- svx/source/dialog/ClassificationEditView.cxx | 2 +- svx/source/dialog/ClassificationEditView.hxx | 2 +- svx/source/dialog/weldeditview.cxx | 8 ++++---- svx/source/form/fmmodel.cxx | 4 ++-- svx/source/svdraw/svdedxv.cxx | 4 ++-- svx/source/svdraw/svdobj.cxx | 6 +++--- svx/source/svdraw/svdomeas.cxx | 2 +- svx/source/svdraw/svdotxfl.cxx | 2 +- svx/source/svdraw/svdoutl.cxx | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) (limited to 'svx') diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index f08526683f9f..74ded456eab0 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -266,7 +266,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/svx/inc/pch/precompiled_svxcore.hxx b/svx/inc/pch/precompiled_svxcore.hxx index 4d9b28ba20df..1de3d34c0636 100644 --- a/svx/inc/pch/precompiled_svxcore.hxx +++ b/svx/inc/pch/precompiled_svxcore.hxx @@ -350,7 +350,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx index 297315a32bb7..7a8598cc1806 100644 --- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx +++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx @@ -121,7 +121,7 @@ namespace accessibility //XTextCopy void CopyText(const SvxTextForwarder& ) override {} - OUString CalcFieldValue( const SvxFieldItem& /*rField*/, sal_Int32 /*nPara*/, sal_Int32 /*nPos*/, o3tl::optional& /*rpTxtColor*/, o3tl::optional& /*rpFldColor*/ ) override + OUString CalcFieldValue( const SvxFieldItem& /*rField*/, sal_Int32 /*nPara*/, sal_Int32 /*nPos*/, std::optional& /*rpTxtColor*/, std::optional& /*rpFldColor*/ ) override { return OUString(); } diff --git a/svx/source/dialog/ClassificationEditView.cxx b/svx/source/dialog/ClassificationEditView.cxx index e7e80f58c356..4dd5c337ebb4 100644 --- a/svx/source/dialog/ClassificationEditView.cxx +++ b/svx/source/dialog/ClassificationEditView.cxx @@ -23,7 +23,7 @@ ClassificationEditEngine::ClassificationEditEngine(SfxItemPool* pItemPool) {} OUString ClassificationEditEngine::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 /*nPara*/, - sal_Int32 /*nPos*/, o3tl::optional& /*rTxtColor*/, o3tl::optional& /*rFldColor*/) + sal_Int32 /*nPos*/, std::optional& /*rTxtColor*/, std::optional& /*rFldColor*/) { OUString aString; const ClassificationField* pClassificationField = dynamic_cast(rField.GetField()); diff --git a/svx/source/dialog/ClassificationEditView.hxx b/svx/source/dialog/ClassificationEditView.hxx index dda6e8aff6e3..96adf83abfe9 100644 --- a/svx/source/dialog/ClassificationEditView.hxx +++ b/svx/source/dialog/ClassificationEditView.hxx @@ -24,7 +24,7 @@ class ClassificationEditEngine final : public EditEngine public: ClassificationEditEngine(SfxItemPool* pItemPool); - virtual OUString CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, o3tl::optional& rTxtColor, o3tl::optional& rFldColor) override; + virtual OUString CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional& rTxtColor, std::optional& rFldColor) override; }; class ClassificationEditView final : public WeldEditView diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index fe7872ac6eba..ff9fc741564e 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -241,8 +241,8 @@ public: virtual SfxItemPool* GetPool() const override; virtual OUString CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, - o3tl::optional& rpTxtColor, - o3tl::optional& rpFldColor) override; + std::optional& rpTxtColor, + std::optional& rpFldColor) override; virtual void FieldClicked(const SvxFieldItem&) override; virtual bool IsValid() const override; @@ -905,8 +905,8 @@ bool WeldTextForwarder::IsValid() const } OUString WeldTextForwarder::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, - sal_Int32 nPos, o3tl::optional& rpTxtColor, - o3tl::optional& rpFldColor) + sal_Int32 nPos, std::optional& rpTxtColor, + std::optional& rpFldColor) { EditEngine* pEditEngine = m_rEditAcc.GetEditEngine(); return pEditEngine ? pEditEngine->CalcFieldValue(rField, nPara, nPos, rpTxtColor, rpFldColor) diff --git a/svx/source/form/fmmodel.cxx b/svx/source/form/fmmodel.cxx index 5942abfa6454..908fdd193cb0 100644 --- a/svx/source/form/fmmodel.cxx +++ b/svx/source/form/fmmodel.cxx @@ -28,7 +28,7 @@ #include -#include +#include using ::com::sun::star::uno::Reference; using ::com::sun::star::container::XNameContainer; @@ -39,7 +39,7 @@ struct FmFormModelImplData { rtl::Reference mxUndoEnv; bool bOpenInDesignIsDefaulted; - o3tl::optional aControlsUseRefDevice; + std::optional aControlsUseRefDevice; FmFormModelImplData() :bOpenInDesignIsDefaulted( true ) diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 2d0a58749e5e..91f7d2101139 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1008,8 +1008,8 @@ IMPL_LINK(SdrObjEditView, ImpOutlinerCalcFieldValueHdl, EditFieldInfo*, pFI, voi SdrTextObj* pTextObj = mxTextEditObj.get(); if (pTextObj != nullptr) { - o3tl::optional pTxtCol; - o3tl::optional pFldCol; + std::optional pTxtCol; + std::optional pFldCol; bOk = pTextObj->CalcFieldValue(pFI->GetField(), pFI->GetPara(), pFI->GetPos(), true, pTxtCol, pFldCol, rStr); if (bOk) diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 59ffc2ee9a8d..bf8650439aa3 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -138,7 +138,7 @@ #include -#include +#include #include #include @@ -207,8 +207,8 @@ struct SdrObject::Impl { sdr::ObjectUserVector maObjectUsers; std::shared_ptr mpDiagramData; - o3tl::optional mnRelativeWidth; - o3tl::optional mnRelativeHeight; + std::optional mnRelativeWidth; + std::optional mnRelativeHeight; sal_Int16 meRelativeWidthRelation; sal_Int16 meRelativeHeightRelation; diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 6facde80b742..18e964a01830 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -550,7 +550,7 @@ basegfx::B2DPolyPolygon SdrMeasureObj::ImpCalcXPoly(const ImpMeasurePoly& rPol) bool SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, bool bEdit, - o3tl::optional& rpTxtColor, o3tl::optional& rpFldColor, OUString& rRet) const + std::optional& rpTxtColor, std::optional& rpFldColor, OUString& rRet) const { const SvxFieldData* pField=rField.GetField(); const SdrMeasureField* pMeasureField=dynamic_cast( pField ); diff --git a/svx/source/svdraw/svdotxfl.cxx b/svx/source/svdraw/svdotxfl.cxx index 11fe15d6eedd..4992c6017677 100644 --- a/svx/source/svdraw/svdotxfl.cxx +++ b/svx/source/svdraw/svdotxfl.cxx @@ -22,7 +22,7 @@ #include bool SdrTextObj::CalcFieldValue(const SvxFieldItem& /*rField*/, sal_Int32 /*nPara*/, sal_uInt16 /*nPos*/, - bool /*bEdit*/, o3tl::optional& /*rpTxtColor*/, o3tl::optional& /*rpFldColor*/, OUString& /*rRet*/) const + bool /*bEdit*/, std::optional& /*rpTxtColor*/, std::optional& /*rpFldColor*/, OUString& /*rRet*/) const { return false; } diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx index 31fb093bedb2..d283af395772 100644 --- a/svx/source/svdraw/svdoutl.cxx +++ b/svx/source/svdraw/svdoutl.cxx @@ -72,7 +72,7 @@ void SdrOutliner::SetTextObjNoInit( const SdrTextObj* pObj ) } OUString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, - o3tl::optional& rpTxtColor, o3tl::optional& rpFldColor) + std::optional& rpTxtColor, std::optional& rpFldColor) { bool bOk = false; OUString aRet; -- cgit