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 /sw | |
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 'sw')
65 files changed, 172 insertions, 172 deletions
diff --git a/sw/inc/anchoreddrawobject.hxx b/sw/inc/anchoreddrawobject.hxx index 2524994f07f9..bd74d6ea479a 100644 --- a/sw/inc/anchoreddrawobject.hxx +++ b/sw/inc/anchoreddrawobject.hxx @@ -20,7 +20,7 @@ #define INCLUDED_SW_INC_ANCHOREDDRAWOBJECT_HXX #include "anchoredobject.hxx" -#include <o3tl/optional.hxx> +#include <optional> namespace tools { class Rectangle; } @@ -33,7 +33,7 @@ class SwAnchoredDrawObject final : public SwAnchoredObject bool mbValidPos; // rectangle, keeping the last object rectangle after the positioning - o3tl::optional<tools::Rectangle> maLastObjRect; + std::optional<tools::Rectangle> maLastObjRect; // boolean, indicating that anchored drawing object hasn't been attached // to an anchor frame yet. Once, it is attached to an anchor frame the @@ -120,7 +120,7 @@ class SwAnchoredDrawObject final : public SwAnchoredObject // accessors to the object area and its position virtual SwRect GetObjRect() const override; - o3tl::optional<tools::Rectangle> const & GetLastObjRect() const { return maLastObjRect;} + std::optional<tools::Rectangle> const & GetLastObjRect() const { return maLastObjRect;} void SetLastObjRect( const tools::Rectangle& _rNewObjRect ); /** adjust positioning and alignment attributes for new anchor frame diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 3c49316b74f3..f18050eec156 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -129,7 +129,7 @@ bool ReplaceImpl(SwPaM & rCursor, OUString const& rReplacement, bool const bRegExp, SwDoc & rDoc, SwRootFrame const*const pLayout); /// Helperfunction to resolve backward references in regular expressions -o3tl::optional<OUString> ReplaceBackReferences(const i18nutil::SearchOptions2& rSearchOpt, +std::optional<OUString> ReplaceBackReferences(const i18nutil::SearchOptions2& rSearchOpt, SwPaM* pPam, SwRootFrame const* pLayout ); bool GetRanges(std::vector<std::shared_ptr<SwUnoCursor>> & rRanges, diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx index 9b5a59702952..887ddbcf49e1 100644 --- a/sw/inc/fmtpdsc.hxx +++ b/sw/inc/fmtpdsc.hxx @@ -24,7 +24,7 @@ #include "hintids.hxx" #include "format.hxx" #include "calbck.hxx" -#include <o3tl/optional.hxx> +#include <optional> #include "pagedesc.hxx" class IntlWrapper; @@ -34,7 +34,7 @@ class IntlWrapper; class SW_DLLPUBLIC SwFormatPageDesc : public SfxPoolItem, public SwClient { - ::o3tl::optional<sal_uInt16> m_oNumOffset; ///< Offset page number. + ::std::optional<sal_uInt16> m_oNumOffset; ///< Offset page number. SwModify* m_pDefinedIn; /**< Points to the object in which the attribute was set (ContentNode/Format). */ protected: @@ -62,8 +62,8 @@ public: SwPageDesc *GetPageDesc() { return static_cast<SwPageDesc*>(GetRegisteredIn()); } const SwPageDesc *GetPageDesc() const { return static_cast<const SwPageDesc*>(GetRegisteredIn()); } - const ::o3tl::optional<sal_uInt16>& GetNumOffset() const { return m_oNumOffset; } - void SetNumOffset( const ::o3tl::optional<sal_uInt16>& oNum ) { m_oNumOffset = oNum; } + const ::std::optional<sal_uInt16>& GetNumOffset() const { return m_oNumOffset; } + void SetNumOffset( const ::std::optional<sal_uInt16>& oNum ) { m_oNumOffset = oNum; } /// Query / set where attribute is anchored. const SwModify* GetDefinedIn() const { return m_pDefinedIn; } diff --git a/sw/inc/pch/precompiled_msword.hxx b/sw/inc/pch/precompiled_msword.hxx index 92377e666028..3e8c55bf5942 100644 --- a/sw/inc/pch/precompiled_msword.hxx +++ b/sw/inc/pch/precompiled_msword.hxx @@ -340,7 +340,7 @@ #include <i18nutil/transliteration.hxx> #include <o3tl/cow_wrapper.hxx> #include <o3tl/enumarray.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/safeint.hxx> #include <o3tl/sorted_vector.hxx> #include <o3tl/strong_int.hxx> diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index 83ced7f22e1c..bfd07f24abad 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -274,7 +274,7 @@ #include <o3tl/any.hxx> #include <o3tl/cow_wrapper.hxx> #include <o3tl/deleter.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/safeint.hxx> #include <o3tl/sorted_vector.hxx> #include <o3tl/strong_int.hxx> diff --git a/sw/inc/pch/precompiled_swui.hxx b/sw/inc/pch/precompiled_swui.hxx index f84dfe35cd5c..39909eb342bc 100644 --- a/sw/inc/pch/precompiled_swui.hxx +++ b/sw/inc/pch/precompiled_swui.hxx @@ -367,7 +367,7 @@ #include <i18nutil/transliteration.hxx> #include <o3tl/cow_wrapper.hxx> #include <o3tl/deleter.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/safeint.hxx> #include <o3tl/sorted_vector.hxx> #include <o3tl/strong_int.hxx> diff --git a/sw/inc/pch/precompiled_vbaswobj.hxx b/sw/inc/pch/precompiled_vbaswobj.hxx index b19ca8c76888..26ed24e28f76 100644 --- a/sw/inc/pch/precompiled_vbaswobj.hxx +++ b/sw/inc/pch/precompiled_vbaswobj.hxx @@ -247,7 +247,7 @@ #include <editeng/svxenum.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/sw/inc/redline.hxx b/sw/inc/redline.hxx index 8503eca4f7f9..5bbccc87dc93 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -29,7 +29,7 @@ #include <cstddef> #include <memory> #include <vector> -#include <o3tl/optional.hxx> +#include <optional> class SfxItemSet; @@ -158,7 +158,7 @@ class SW_DLLPUBLIC SwRangeRedline : public SwPaM bool m_bIsVisible : 1; sal_uInt32 const m_nId; - o3tl::optional<long> m_oLOKLastNodeTop; + std::optional<long> m_oLOKLastNodeTop; void MoveToSection(); void CopyToSection(); diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index dfe31d8978f6..45edeb57e28b 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -23,7 +23,7 @@ #include <sfx2/sfxdlg.hxx> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Sequence.h> -#include <o3tl/optional.hxx> +#include <optional> #include "dbmgr.hxx" #include <cnttab.hxx> #include "tblenum.hxx" @@ -232,7 +232,7 @@ protected: public: virtual OUString GetTemplateName() = 0; virtual sal_uInt16 GetKind() = 0; - virtual ::o3tl::optional<sal_uInt16> GetPageNumber() = 0; + virtual ::std::optional<sal_uInt16> GetPageNumber() = 0; }; diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 4b9b0f48ee51..80f90e302db6 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -27,7 +27,7 @@ #include "SwRewriter.hxx" #include "swundo.hxx" #include <o3tl/typed_flags_set.hxx> -#include <o3tl/optional.hxx> +#include <optional> class SwHistory; class SwPaM; @@ -58,7 +58,7 @@ class SwUndo protected: bool m_bCacheComment; - mutable o3tl::optional<OUString> maComment; + mutable std::optional<OUString> maComment; static void RemoveIdxFromSection( SwDoc&, sal_uLong nSttIdx, const sal_uLong* pEndIdx = nullptr ); static void RemoveIdxFromRange( SwPaM& rPam, bool bMoveNext ); diff --git a/sw/source/core/crsr/BlockCursor.hxx b/sw/source/core/crsr/BlockCursor.hxx index dfbb71abdce1..28b09e0e84c9 100644 --- a/sw/source/core/crsr/BlockCursor.hxx +++ b/sw/source/core/crsr/BlockCursor.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_SW_SOURCE_CORE_CRSR_BLOCKCURSOR_HXX #define INCLUDED_SW_SOURCE_CORE_CRSR_BLOCKCURSOR_HXX -#include <o3tl/optional.hxx> +#include <optional> #include <tools/gen.hxx> #include <viscrs.hxx> @@ -39,8 +39,8 @@ struct SwPosition; class SwBlockCursor { SwShellCursor maCursor; - o3tl::optional<Point> maStartPt; - o3tl::optional<Point> maEndPt; + std::optional<Point> maStartPt; + std::optional<Point> maEndPt; public: SwBlockCursor( const SwCursorShell& rCursorSh, const SwPosition &rPos ) : @@ -69,12 +69,12 @@ public: @return 0, if no start point has been set */ - o3tl::optional<Point> const & getStartPoint() const { return maStartPt; } + std::optional<Point> const & getStartPoint() const { return maStartPt; } /** The document coordinates where the block selection ends (at the moment) @return 0, if no end point has been set */ - o3tl::optional<Point> const & getEndPoint() const { return maEndPt; } + std::optional<Point> const & getEndPoint() const { return maEndPt; } /** Deletion of the mouse created rectangle When start and end points exist, the block cursor depends on this. If the diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index f299436eeb61..796da73697af 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -55,7 +55,7 @@ namespace sw::mark sal_uLong const nStartNode(rStartPos.nNode.GetIndex()); sal_uLong const nEndNode(rEndPos.nNode.GetIndex()); int nFields(0); - o3tl::optional<SwPosition> ret; + std::optional<SwPosition> ret; for (sal_uLong n = nEndNode; nStartNode <= n; --n) { SwNode *const pNode(rNodes[n]); diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index d58cedfbf919..29ff1e41edd9 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -40,7 +40,7 @@ #include <pamtyp.hxx> #include <txtfrm.hxx> #include <swundo.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <algorithm> #include <memory> @@ -64,9 +64,9 @@ static bool CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 ) return static_cast<const SvxColorItem&>(rItem1).GetValue().IsRGBEqual( static_cast<const SvxColorItem&>(rItem2).GetValue() ); case RES_PAGEDESC: - ::o3tl::optional<sal_uInt16> const oNumOffset1 = + ::std::optional<sal_uInt16> const oNumOffset1 = static_cast<const SwFormatPageDesc&>(rItem1).GetNumOffset(); - ::o3tl::optional<sal_uInt16> const oNumOffset2 = + ::std::optional<sal_uInt16> const oNumOffset2 = static_cast<const SwFormatPageDesc&>(rItem2).GetNumOffset(); if (oNumOffset1 != oNumOffset2) @@ -1302,7 +1302,7 @@ int SwFindParaAttr::DoFind(SwPaM & rCursor, SwMoveFnCollection const & fnMove, const_cast<SwPaM &>(rRegion).GetRingContainer().merge( m_rCursor.GetRingContainer() ); } - o3tl::optional<OUString> xRepl; + std::optional<OUString> xRepl; if (bRegExp) xRepl = sw::ReplaceBackReferences(*pSearchOpt, &rCursor, m_pLayout); sw::ReplaceImpl(rCursor, diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index cda6ef6161b3..0f8d83f3a035 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -140,7 +140,7 @@ public: class MaybeMergedIter { - o3tl::optional<sw::MergedAttrIter> m_oMergedIter; + std::optional<sw::MergedAttrIter> m_oMergedIter; SwTextNode const*const m_pNode; size_t m_HintIndex; @@ -951,7 +951,7 @@ int SwFindParaText::DoFind(SwPaM & rCursor, SwMoveFnCollection const & fnMove, const_cast<SwPaM&>(rRegion).GetRingContainer().merge( m_rCursor.GetRingContainer() ); } - o3tl::optional<OUString> xRepl; + std::optional<OUString> xRepl; if (bRegExp) xRepl = sw::ReplaceBackReferences(m_rSearchOpt, &rCursor, m_pLayout); bool const bReplaced = sw::ReplaceImpl(rCursor, @@ -1094,10 +1094,10 @@ bool ReplaceImpl( return bReplaced; } -o3tl::optional<OUString> ReplaceBackReferences(const i18nutil::SearchOptions2& rSearchOpt, +std::optional<OUString> ReplaceBackReferences(const i18nutil::SearchOptions2& rSearchOpt, SwPaM *const pPam, SwRootFrame const*const pLayout) { - o3tl::optional<OUString> xRet; + std::optional<OUString> xRet; if( pPam && pPam->HasMark() && SearchAlgorithms2::REGEXP == rSearchOpt.AlgorithmType2 ) { diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 6a9b4d290096..cdc449943fca 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -526,7 +526,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) else if (dynamic_cast<const SdrMeasureField*>( pField)) { // Clear measure field - pInfo->SetFieldColor(o3tl::optional<Color>()); + pInfo->SetFieldColor(std::optional<Color>()); } else if ( auto pTimeField = dynamic_cast<const SvxExtTimeField*>( pField) ) { diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx index ac914db0bb68..819fd1d4cb32 100644 --- a/sw/source/core/frmedt/fedesc.cxx +++ b/sw/source/core/frmedt/fedesc.cxx @@ -55,7 +55,7 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc ) SwPageFrame *pPage = GetCurrFrame()->FindPageFrame(); const SwFrame *pFlow = nullptr; - ::o3tl::optional<sal_uInt16> oPageNumOffset; + ::std::optional<sal_uInt16> oPageNumOffset; OSL_ENSURE( !GetCursor()->HasMark(), "ChgCurPageDesc only without selection!"); diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index b608d2e8e4a8..1751c9d913e0 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -408,7 +408,7 @@ sal_uInt16 SwFEShell::GetPageOffset() const { if ( pFlow->IsInTab() ) pFlow = pFlow->FindTabFrame(); - ::o3tl::optional<sal_uInt16> oNumOffset = pFlow->GetPageDescItem().GetNumOffset(); + ::std::optional<sal_uInt16> oNumOffset = pFlow->GetPageDescItem().GetNumOffset(); if ( oNumOffset ) return *oNumOffset; } diff --git a/sw/source/core/inc/UndoDelete.hxx b/sw/source/core/inc/UndoDelete.hxx index 210c7f668d5e..2049d8b502f2 100644 --- a/sw/source/core/inc/UndoDelete.hxx +++ b/sw/source/core/inc/UndoDelete.hxx @@ -23,7 +23,7 @@ #include <undobj.hxx> #include <rtl/ustring.hxx> #include <memory> -#include <o3tl/optional.hxx> +#include <optional> class SwRedlineSaveDatas; class SwTextNode; @@ -38,7 +38,7 @@ class SwUndoDelete , private SwUndoSaveContent { std::unique_ptr<SwNodeIndex> m_pMvStt; // Position of Nodes in UndoNodes-Array - o3tl::optional<OUString> m_aSttStr, m_aEndStr; + std::optional<OUString> m_aSttStr, m_aEndStr; std::unique_ptr<SwRedlineSaveDatas> m_pRedlSaveData; std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; diff --git a/sw/source/core/inc/UndoInsert.hxx b/sw/source/core/inc/UndoInsert.hxx index 8d1cf55c78d6..1e62a0a30c9c 100644 --- a/sw/source/core/inc/UndoInsert.hxx +++ b/sw/source/core/inc/UndoInsert.hxx @@ -27,7 +27,7 @@ #include <rtl/ustring.hxx> #include <swtypes.hxx> #include <IDocumentContentOperations.hxx> -#include <o3tl/optional.hxx> +#include <optional> class Graphic; class SwGrfNode; @@ -41,8 +41,8 @@ class SwUndoInsert: public SwUndo, private SwUndoSaveContent { /// start of Content in UndoNodes for Redo std::unique_ptr<SwNodeIndex> m_pUndoNodeIndex; - o3tl::optional<OUString> maText; - o3tl::optional<OUString> maUndoText; + std::optional<OUString> maText; + std::optional<OUString> maUndoText; std::unique_ptr<SwRedlineData> m_pRedlData; sal_uLong m_nNode; sal_Int32 m_nContent, m_nLen; @@ -59,7 +59,7 @@ class SwUndoInsert: public SwUndo, private SwUndoSaveContent SwDoc * m_pDoc; void Init(const SwNodeIndex & rNode); - o3tl::optional<OUString> GetTextFromDoc() const; + std::optional<OUString> GetTextFromDoc() const; public: SwUndoInsert( const SwNodeIndex& rNode, sal_Int32 nContent, sal_Int32 nLen, @@ -135,8 +135,8 @@ private: class SwUndoReRead : public SwUndo { std::unique_ptr<Graphic> mpGraphic; - o3tl::optional<OUString> maNm; - o3tl::optional<OUString> maFltr; + std::optional<OUString> maNm; + std::optional<OUString> maFltr; sal_uLong mnPosition; MirrorGraph mnMirror; diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 53e1027f488d..7603efb463a2 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -28,7 +28,7 @@ #include <swtypes.hxx> #include "drawfont.hxx" #include <editeng/borderline.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/enumarray.hxx> class SfxItemSet; @@ -140,10 +140,10 @@ class SwFont Color m_aOverColor; // color of the overlining // character borders - o3tl::optional<editeng::SvxBorderLine> m_aTopBorder; - o3tl::optional<editeng::SvxBorderLine> m_aBottomBorder; - o3tl::optional<editeng::SvxBorderLine> m_aRightBorder; - o3tl::optional<editeng::SvxBorderLine> m_aLeftBorder; + std::optional<editeng::SvxBorderLine> m_aTopBorder; + std::optional<editeng::SvxBorderLine> m_aBottomBorder; + std::optional<editeng::SvxBorderLine> m_aRightBorder; + std::optional<editeng::SvxBorderLine> m_aLeftBorder; // border distance sal_uInt16 m_nTopBorderDist; @@ -336,19 +336,19 @@ public: void SetRightBorder( const editeng::SvxBorderLine* pRightBorder ); void SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder ); - const o3tl::optional<editeng::SvxBorderLine>& GetTopBorder() const { return m_aTopBorder; } - const o3tl::optional<editeng::SvxBorderLine>& GetBottomBorder() const { return m_aBottomBorder; } - const o3tl::optional<editeng::SvxBorderLine>& GetRightBorder() const { return m_aRightBorder; } - const o3tl::optional<editeng::SvxBorderLine>& GetLeftBorder() const { return m_aLeftBorder; } + const std::optional<editeng::SvxBorderLine>& GetTopBorder() const { return m_aTopBorder; } + const std::optional<editeng::SvxBorderLine>& GetBottomBorder() const { return m_aBottomBorder; } + const std::optional<editeng::SvxBorderLine>& GetRightBorder() const { return m_aRightBorder; } + const std::optional<editeng::SvxBorderLine>& GetLeftBorder() const { return m_aLeftBorder; } // Get absolute border correspond to the layout verticality and orientation. - const o3tl::optional<editeng::SvxBorderLine>& + const std::optional<editeng::SvxBorderLine>& GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const; - const o3tl::optional<editeng::SvxBorderLine>& + const std::optional<editeng::SvxBorderLine>& GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const; - const o3tl::optional<editeng::SvxBorderLine>& + const std::optional<editeng::SvxBorderLine>& GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const; - const o3tl::optional<editeng::SvxBorderLine>& + const std::optional<editeng::SvxBorderLine>& GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const; void SetTopBorderDist( const sal_uInt16 nTopDist ); diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx index 4d063cace493..c5b4df884b9e 100644 --- a/sw/source/core/inc/wrong.hxx +++ b/sw/source/core/inc/wrong.hxx @@ -29,7 +29,7 @@ #include <vector> -#include <o3tl/optional.hxx> +#include <optional> #include <tools/color.hxx> #include <swtypes.hxx> @@ -407,7 +407,7 @@ public: WrongListIteratorCounter(SwWrongList const& rWrongList); sal_uInt16 GetElementCount(); - o3tl::optional<std::pair<TextFrameIndex, TextFrameIndex>> GetElementAt(sal_uInt16 nIndex); + std::optional<std::pair<TextFrameIndex, TextFrameIndex>> GetElementAt(sal_uInt16 nIndex); }; } // namespace sw diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index b1553c36bcd5..78f47d47d731 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -701,7 +701,7 @@ bool SwFormatPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { case MID_PAGEDESC_PAGENUMOFFSET: { - ::o3tl::optional<sal_uInt16> oOffset = GetNumOffset(); + ::std::optional<sal_uInt16> oOffset = GetNumOffset(); if (oOffset) { rVal <<= static_cast<sal_Int16>(*oOffset); @@ -745,7 +745,7 @@ bool SwFormatPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int16 nOffset = 0; if (!rVal.hasValue()) { - SetNumOffset(o3tl::nullopt); + SetNumOffset(std::nullopt); } else if (rVal >>= nOffset) SetNumOffset( nOffset ); diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index ce5d753524f6..5094c145c217 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -408,8 +408,8 @@ void SwFrame::PrepareCursor() std::list<FlowFrameJoinLockGuard> tabGuard; std::list<SwFrameDeleteGuard> rowGuard; #else - o3tl::optional<FlowFrameJoinLockGuard> tabGuard; - o3tl::optional<SwFrameDeleteGuard> rowGuard; + std::optional<FlowFrameJoinLockGuard> tabGuard; + std::optional<SwFrameDeleteGuard> rowGuard; #endif SwFlowFrame* pThis = bCnt ? static_cast<SwContentFrame*>(this) : nullptr; diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index a10239af226f..6a4b853196ca 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -848,7 +848,7 @@ bool SwFrame::WrongPageDesc( SwPageFrame* pNew ) //My Pagedesc doesn't count if I'm a follow! const SwPageDesc *pDesc = nullptr; - o3tl::optional<sal_uInt16> oTmp; + std::optional<sal_uInt16> oTmp; SwFlowFrame *pFlow = SwFlowFrame::CastFlowFrame( this ); if ( !pFlow || !pFlow->IsFollow() ) { @@ -2531,7 +2531,7 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat ) #if BOOST_VERSION < 105600 std::list<SwFrameDeleteGuard> g; #else - ::o3tl::optional<SwFrameDeleteGuard> g; + ::std::optional<SwFrameDeleteGuard> g; #endif if (m_rThis.GetUpper()->IsCellFrame()) { diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 94c2ff2ae12a..2f0608056008 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -654,7 +654,7 @@ bool SwLayHelper::CheckInsertPage() if ( bBrk || pDesc ) { - ::o3tl::optional<sal_uInt16> oPgNum; + ::std::optional<sal_uInt16> oPgNum; if ( !pDesc ) { pDesc = mrpPage->GetPageDesc()->GetFollow(); diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index a712007f8c49..2827a5ca68de 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -462,7 +462,7 @@ void SwRootFrame::Init( SwFrameFormat* pFormat ) // Get hold of PageDesc (either via FrameFormat of the first node or the initial one). SwPageDesc *pDesc = nullptr; - ::o3tl::optional<sal_uInt16> oPgNum; + ::std::optional<sal_uInt16> oPgNum; if ( pTableNd ) { diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 588b650fb920..b93b5a23440b 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1303,7 +1303,7 @@ SwPageFrame *SwFrame::InsertPage( SwPageFrame *pPrevPage, bool bFootnote ) pDesc = rDesc.GetPageDesc(); if ( rDesc.GetNumOffset() ) { - ::o3tl::optional<sal_uInt16> oNumOffset = rDesc.GetNumOffset(); + ::std::optional<sal_uInt16> oNumOffset = rDesc.GetNumOffset(); bWishedRightPage = sw::IsRightPageByNumber(*pRoot, *oNumOffset); // use the opportunity to set the flag at root pRoot->SetVirtPageNum( true ); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 50cc2aaac8a7..0e7969a32b93 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4759,7 +4759,7 @@ namespace drawinglayer::primitive2d namespace { -editeng::SvxBorderLine const * get_ptr(o3tl::optional<editeng::SvxBorderLine> const & opt) { +editeng::SvxBorderLine const * get_ptr(std::optional<editeng::SvxBorderLine> const & opt) { return opt ? &*opt : nullptr; } diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 6e2c7fba14c9..f8a5a3b423e0 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1716,7 +1716,7 @@ bool SwFrame::WannaRightPage() const const SwFrame *pFlow = pPage->FindFirstBodyContent(); const SwPageDesc *pDesc = nullptr; - ::o3tl::optional<sal_uInt16> oPgNum; + ::std::optional<sal_uInt16> oPgNum; if ( pFlow ) { if ( pFlow->IsInTab() ) @@ -1840,7 +1840,7 @@ sal_uInt16 SwFrame::GetVirtPageNum() const } if ( pFrame ) { - ::o3tl::optional<sal_uInt16> oNumOffset = pFrame->GetPageDescItem().GetNumOffset(); + ::std::optional<sal_uInt16> oNumOffset = pFrame->GetPageDescItem().GetNumOffset(); if (oNumOffset) { return nPhyPage - pFrame->GetPhyPageNum() + *oNumOffset; diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index f69fdfbfc5b9..ec3fd196d60a 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -112,7 +112,7 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh, if( m_aRect.Bottom() > nBottom ) m_aRect.Bottom( nBottom ); } - o3tl::optional<bool> oIsRightPage; + std::optional<bool> oIsRightPage; if( bLineNum ) { /* Initializes the Members necessary for line numbering: diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 9fa74a0d4833..d572ddd45312 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -35,7 +35,7 @@ #include <com/sun/star/i18n/XBreakIterator.hpp> #include <paratr.hxx> #include <sal/log.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <editeng/adjustitem.hxx> #include <editeng/charhiddenitem.hxx> #include <svl/asiancfg.hxx> @@ -729,7 +729,7 @@ SwFontScript SwScriptInfo::WhichFont(sal_Int32 nIdx, OUString const& rText) } static void InitBookmarks( - o3tl::optional<std::vector<sw::Extent>::const_iterator> oPrevIter, + std::optional<std::vector<sw::Extent>::const_iterator> oPrevIter, std::vector<sw::Extent>::const_iterator iter, std::vector<sw::Extent>::const_iterator const end, TextFrameIndex nOffset, @@ -917,7 +917,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, { SwTextNode const* pNode(nullptr); TextFrameIndex nOffset(0); - o3tl::optional<std::vector<sw::Extent>::const_iterator> oPrevIter; + std::optional<std::vector<sw::Extent>::const_iterator> oPrevIter; for (auto iter = pMerged->extents.begin(); iter != pMerged->extents.end(); oPrevIter = iter, ++iter) { diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx index be570670593d..5a70c7be9507 100644 --- a/sw/source/core/text/wrong.cxx +++ b/sw/source/core/text/wrong.cxx @@ -875,7 +875,7 @@ sal_uInt16 WrongListIteratorCounter::GetElementCount() return 0; } -o3tl::optional<std::pair<TextFrameIndex, TextFrameIndex>> +std::optional<std::pair<TextFrameIndex, TextFrameIndex>> WrongListIteratorCounter::GetElementAt(sal_uInt16 nIndex) { if (m_pMergedPara) @@ -906,7 +906,7 @@ WrongListIteratorCounter::GetElementAt(sal_uInt16 nIndex) { if (nIndex == 0) { - return o3tl::optional<std::pair<TextFrameIndex, TextFrameIndex>>( + return std::optional<std::pair<TextFrameIndex, TextFrameIndex>>( std::pair<TextFrameIndex, TextFrameIndex>( m_CurrentIndex - TextFrameIndex(rExtent.nStart - std::max(rExtent.nStart, pWrong->mnPos)), @@ -919,17 +919,17 @@ WrongListIteratorCounter::GetElementAt(sal_uInt16 nIndex) m_CurrentIndex += TextFrameIndex(rExtent.nEnd - rExtent.nStart); ++m_CurrentExtent; } - return o3tl::optional<std::pair<TextFrameIndex, TextFrameIndex>>(); + return std::optional<std::pair<TextFrameIndex, TextFrameIndex>>(); } else if (m_pWrongList) { SwWrongArea const*const pWrong(m_pWrongList->GetElement(nIndex)); - return o3tl::optional<std::pair<TextFrameIndex, TextFrameIndex>>( + return std::optional<std::pair<TextFrameIndex, TextFrameIndex>>( std::pair<TextFrameIndex, TextFrameIndex>( TextFrameIndex(pWrong->mnPos), TextFrameIndex(pWrong->mnPos + pWrong->mnLen))); } - return o3tl::optional<std::pair<TextFrameIndex, TextFrameIndex>>(); + return std::optional<std::pair<TextFrameIndex, TextFrameIndex>>(); } } // namespace sw diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 7857b2eaa2c5..e62f8d1fb6eb 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -30,7 +30,7 @@ #include <hints.hxx> #include <calbck.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <sal/log.hxx> #include <osl/diagnose.h> @@ -817,7 +817,7 @@ lcl_SearchNextToken(const OUString & sPattern, sal_Int32 const nStt) @return the token */ -static o3tl::optional<SwFormToken> +static std::optional<SwFormToken> lcl_BuildToken(const OUString & sPattern, sal_Int32 & nCurPatternPos) { OUString sToken( lcl_SearchNextToken(sPattern, nCurPatternPos) ); @@ -827,7 +827,7 @@ lcl_BuildToken(const OUString & sPattern, sal_Int32 & nCurPatternPos) if (TOKEN_END == eTokenType) // invalid input? skip it { nCurPatternPos = sPattern.getLength(); - return o3tl::optional<SwFormToken>(); + return std::optional<SwFormToken>(); } // at this point sPattern contains the @@ -906,7 +906,7 @@ SwFormTokensHelper::SwFormTokensHelper(const OUString & rPattern) while (nCurPatternPos < rPattern.getLength()) { - o3tl::optional<SwFormToken> const oToken( + std::optional<SwFormToken> const oToken( lcl_BuildToken(rPattern, nCurPatternPos)); if (oToken) m_Tokens.push_back(*oToken); diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 8d7a4f42468e..b8789594bb84 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -121,7 +121,7 @@ void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder ) m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } -const o3tl::optional<editeng::SvxBorderLine>& +const std::optional<editeng::SvxBorderLine>& SwFont::GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) @@ -145,7 +145,7 @@ SwFont::GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) cons } } -const o3tl::optional<editeng::SvxBorderLine>& +const std::optional<editeng::SvxBorderLine>& SwFont::GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) @@ -169,7 +169,7 @@ SwFont::GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) c } } -const o3tl::optional<editeng::SvxBorderLine>& +const std::optional<editeng::SvxBorderLine>& SwFont::GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) @@ -193,7 +193,7 @@ SwFont::GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) con } } -const o3tl::optional<editeng::SvxBorderLine>& +const std::optional<editeng::SvxBorderLine>& SwFont::GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx index be497b5b8889..4609bd8412e7 100644 --- a/sw/source/core/txtnode/txatbase.cxx +++ b/sw/source/core/txtnode/txatbase.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <o3tl/optional.hxx> +#include <optional> #include <libxml/xmlwriter.h> #include <svl/itempool.hxx> #include <txatbase.hxx> @@ -95,7 +95,7 @@ void SwTextAttr::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterWriteAttribute(pWriter, BAD_CAST("end"), BAD_CAST(OString::number(*End()).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); const char* pWhich = nullptr; - o3tl::optional<OString> oValue; + std::optional<OString> oValue; switch (Which()) { case RES_TXTATR_AUTOFMT: diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index f299aed85456..51d859b5b5d5 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -773,7 +773,7 @@ SwRewriter SwUndoDelete::GetRewriter() const } else { - o3tl::optional<OUString> aTmpStr; + std::optional<OUString> aTmpStr; if (m_aSttStr) aTmpStr = m_aSttStr; else if (m_aEndStr) diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 46e0f55a4725..10ca3470938d 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -56,9 +56,9 @@ using namespace ::com::sun::star; // INSERT -o3tl::optional<OUString> SwUndoInsert::GetTextFromDoc() const +std::optional<OUString> SwUndoInsert::GetTextFromDoc() const { - o3tl::optional<OUString> aResult; + std::optional<OUString> aResult; SwNodeIndex aNd( m_pDoc->GetNodes(), m_nNode); SwContentNode* pCNd = aNd.GetNode().GetContentNode(); @@ -448,7 +448,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext) SwRewriter SwUndoInsert::GetRewriter() const { SwRewriter aResult; - o3tl::optional<OUString> aStr; + std::optional<OUString> aStr; bool bDone = false; if (maText) @@ -794,7 +794,7 @@ void SwUndoReRead::SetAndSave(::sw::UndoRedoContext & rContext) // cache the old values std::unique_ptr<Graphic> pOldGrf( mpGraphic ? new Graphic(*mpGraphic) : nullptr); - o3tl::optional<OUString> aOldNm = maNm; + std::optional<OUString> aOldNm = maNm; MirrorGraph nOldMirr = mnMirror; // since all of them are cleared/modified by SaveGraphicData: SaveGraphicData( *pGrfNd ); diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 3b4b9bac0ac5..3250307078b4 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1085,7 +1085,7 @@ class HTMLEndPosLst SwDoc *pDoc; // the current document SwDoc* const pTemplate; // the HTML template (or 0) - o3tl::optional<Color> xDfltColor;// the default foreground colors + std::optional<Color> xDfltColor;// the default foreground colors std::set<OUString>& rScriptTextStyles; sal_uLong const nHTMLMode; @@ -1129,7 +1129,7 @@ class HTMLEndPosLst public: - HTMLEndPosLst( SwDoc *pDoc, SwDoc* pTemplate, o3tl::optional<Color> xDfltColor, + HTMLEndPosLst( SwDoc *pDoc, SwDoc* pTemplate, std::optional<Color> xDfltColor, bool bOutStyles, sal_uLong nHTMLMode, const OUString& rText, std::set<OUString>& rStyles ); ~HTMLEndPosLst(); @@ -1577,7 +1577,7 @@ const SwHTMLFormatInfo *HTMLEndPosLst::GetFormatInfo( const SwFormat& rFormat, return pFormatInfo; } -HTMLEndPosLst::HTMLEndPosLst(SwDoc* pD, SwDoc* pTempl, o3tl::optional<Color> xDfltCol, +HTMLEndPosLst::HTMLEndPosLst(SwDoc* pD, SwDoc* pTempl, std::optional<Color> xDfltCol, bool bStyles, sal_uLong nMode, const OUString& rText, std::set<OUString>& rStyles) : pDoc(pD) diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index 5d17081fdfd4..f23a5d67acd4 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -296,7 +296,7 @@ public: css::uno::Reference<css::container::XIndexContainer> mxFormComps; // current form rtl::Reference<SwDoc> m_xTemplate; // HTML template - o3tl::optional<Color> m_xDfltColor; // default colour + std::optional<Color> m_xDfltColor; // default colour SwNodeIndex *m_pStartNdIdx; // index of first paragraph const SwPageDesc *m_pCurrPageDesc;// current page style const SwFormatFootnote *m_pFormatFootnote; diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index b05c6804c7da..3a0b157e7b1b 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -27,7 +27,7 @@ #include <rtl/textenc.h> #include <editeng/svxenum.hxx> #include <tools/solar.h> -#include <o3tl/optional.hxx> +#include <optional> #include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <swtypes.hxx> @@ -339,7 +339,7 @@ public: /// The style of the page numbers. /// - virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional<sal_uInt16>& oPageRestartNumber ) = 0; + virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::std::optional<sal_uInt16>& oPageRestartNumber ) = 0; /// The type of breaking. virtual void SectionType( sal_uInt8 nBreakCode ) = 0; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index dc56f3664e66..4b46844e0e6e 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2455,7 +2455,7 @@ const NameToId constNameToIdMapping[] = { OUString("styleSet"), FSNS( XML_w14, XML_styleSet ) }, }; -o3tl::optional<sal_Int32> lclGetElementIdForName(const OUString& rName) +std::optional<sal_Int32> lclGetElementIdForName(const OUString& rName) { for (auto const & i : constNameToIdMapping) { @@ -2464,7 +2464,7 @@ o3tl::optional<sal_Int32> lclGetElementIdForName(const OUString& rName) return i.maId; } } - return o3tl::optional<sal_Int32>(); + return std::optional<sal_Int32>(); } void lclProcessRecursiveGrabBag(sal_Int32 aElementId, const css::uno::Sequence<css::beans::PropertyValue>& rElements, sax_fastparser::FSHelperPtr const & pSerializer) @@ -2494,7 +2494,7 @@ void lclProcessRecursiveGrabBag(sal_Int32 aElementId, const css::uno::Sequence<c aValue = OUStringToOString(aAny.get<OUString>(), RTL_TEXTENCODING_ASCII_US); } - o3tl::optional<sal_Int32> aSubElementId = lclGetElementIdForName(rAttribute.Name); + std::optional<sal_Int32> aSubElementId = lclGetElementIdForName(rAttribute.Name); if(aSubElementId) pAttributes->add(*aSubElementId, aValue.getStr()); } @@ -2507,7 +2507,7 @@ void lclProcessRecursiveGrabBag(sal_Int32 aElementId, const css::uno::Sequence<c { css::uno::Sequence<css::beans::PropertyValue> aSumElements; - o3tl::optional<sal_Int32> aSubElementId = lclGetElementIdForName(rElement.Name); + std::optional<sal_Int32> aSubElementId = lclGetElementIdForName(rElement.Name); if(aSubElementId) { rElement.Value >>= aSumElements; @@ -2571,7 +2571,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties() m_pColorAttrList.clear(); for (const beans::PropertyValue & i : m_aTextEffectsGrabBag) { - o3tl::optional<sal_Int32> aElementId = lclGetElementIdForName(i.Name); + std::optional<sal_Int32> aElementId = lclGetElementIdForName(i.Name); if(aElementId) { uno::Sequence<beans::PropertyValue> aGrabBagSeq; @@ -6317,13 +6317,13 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut } -void DocxAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional<sal_uInt16>& oPageRestartNumber ) +void DocxAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::std::optional<sal_uInt16>& oPageRestartNumber ) { // FIXME Not called properly with page styles like "First Page" FastAttributeList* pAttr = FastSerializerHelper::createAttrList(); - // o3tl::nullopt means no restart: then don't output that attribute if it is negative + // std::nullopt means no restart: then don't output that attribute if it is negative if ( oPageRestartNumber ) pAttr->add( FSNS( XML_w, XML_start ), OString::number( *oPageRestartNumber ) ); @@ -8312,9 +8312,9 @@ void DocxAttributeOutput::FormatAnchor( const SwFormatAnchor& ) // Fly frames: anchors here aren't matching the anchors in docx } -static o3tl::optional<sal_Int32> lcl_getDmlAlpha(const SvxBrushItem& rBrush) +static std::optional<sal_Int32> lcl_getDmlAlpha(const SvxBrushItem& rBrush) { - o3tl::optional<sal_Int32> oRet; + std::optional<sal_Int32> oRet; sal_Int32 nTransparency = rBrush.GetColor().GetTransparency(); if (nTransparency) { @@ -8333,7 +8333,7 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) { const Color aColor = rBrush.GetColor(); OString sColor = msfilter::util::ConvertColor( aColor.GetRGBColor() ); - o3tl::optional<sal_Int32> oAlpha = lcl_getDmlAlpha(rBrush); + std::optional<sal_Int32> oAlpha = lcl_getDmlAlpha(rBrush); if (m_rExport.SdrExporter().getTextFrameSyntax()) { // Handle 'Opacity' diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 894b24ba1a36..ebcff8966b37 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -37,7 +37,7 @@ #include <fldbas.hxx> #include <vector> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/sorted_vector.hxx> #include <oox/export/vmlexport.hxx> #include <oox/export/drawingml.hxx> @@ -300,7 +300,7 @@ public: /// The style of the page numbers. /// - virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional<sal_uInt16>& oPageRestartNumber ) override; + virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::std::optional<sal_uInt16>& oPageRestartNumber ) override; /// The type of breaking. virtual void SectionType( sal_uInt8 nBreakCode ) override; @@ -934,7 +934,7 @@ private: std::vector<sal_Int32> lastOpenCell; std::vector<sal_Int32> lastClosedCell; - o3tl::optional<css::drawing::FillStyle> m_oFillStyle; + std::optional<css::drawing::FillStyle> m_oFillStyle; /// If FormatBox() already handled fill style / gradient. bool m_bIgnoreNextFill; diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx index 487ec6bb3052..cae179d416fa 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.cxx +++ b/sw/source/filter/ww8/docxtablestyleexport.cxx @@ -15,7 +15,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <sax/fastattribs.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -525,8 +525,8 @@ void DocxTableStyleExport::Impl::tableStyleTablePr( uno::Sequence<beans::PropertyValue> aTableInd; uno::Sequence<beans::PropertyValue> aTableBorders; uno::Sequence<beans::PropertyValue> aTableCellMar; - o3tl::optional<sal_Int32> oTableStyleRowBandSize; - o3tl::optional<sal_Int32> oTableStyleColBandSize; + std::optional<sal_Int32> oTableStyleRowBandSize; + std::optional<sal_Int32> oTableStyleColBandSize; for (const auto& rProp : rTablePr) { if (rProp.Name == "tblStyleRowBandSize") diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 4e729a4adb26..36b03f6a0d94 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1291,8 +1291,8 @@ void RtfAttributeOutput::SectionBiDi(bool bBiDi) : OOO_STRING_SVTOOLS_RTF_LTRSECT); } -void RtfAttributeOutput::SectionPageNumbering( - sal_uInt16 nNumType, const ::o3tl::optional<sal_uInt16>& oPageRestartNumber) +void RtfAttributeOutput::SectionPageNumbering(sal_uInt16 nNumType, + const ::std::optional<sal_uInt16>& oPageRestartNumber) { if (oPageRestartNumber) { @@ -3214,7 +3214,7 @@ void RtfAttributeOutput::FormatSurround(const SwFormatSurround& rSurround) { // See DocxSdrExport::startDMLAnchorInline() for SwFormatSurround -> WR / WRK mappings. sal_Int32 nWr = -1; - o3tl::optional<sal_Int32> oWrk; + std::optional<sal_Int32> oWrk; switch (rSurround.GetValue()) { case css::text::WrapTextMode_NONE: diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index b96887479273..2bf4cd6450f6 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -30,7 +30,7 @@ #include <rtl/strbuf.hxx> -#include <o3tl/optional.hxx> +#include <optional> class SwGrfNode; class SwOLENode; @@ -193,7 +193,7 @@ public: /// The style of the page numbers. /// void SectionPageNumbering(sal_uInt16 nNumType, - const ::o3tl::optional<sal_uInt16>& oPageRestartNumber) override; + const ::std::optional<sal_uInt16>& oPageRestartNumber) override; /// The type of breaking. void SectionType(sal_uInt8 nBreakCode) override; @@ -610,7 +610,7 @@ private: std::vector<std::pair<OString, OString>> m_aFlyProperties; - o3tl::optional<css::drawing::FillStyle> m_oFillStyle; + std::optional<css::drawing::FillStyle> m_oFillStyle; /// If we're in the process of exporting a hyperlink, then its URL. OUString m_sURL; diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 0e3625d708c7..4d297bfb475f 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1378,7 +1378,7 @@ void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirst // numbering type AttrOutput().SectionPageNumbering(m_pCurrentPageDesc->GetNumType().GetNumberingType(), - o3tl::nullopt); + std::nullopt); m_pCurrentPageDesc = pSave; SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 49b1edc946af..9b1bcf33026b 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1098,7 +1098,7 @@ void MSWordSections::AppendSection( const SwPageDesc* pPd, if (HeaderFooterWritten()) { return; // #i117955# prevent new sections in endnotes } - aSects.emplace_back( pPd, pSectionFormat, nLnNumRestartNo, o3tl::nullopt, nullptr, bIsFirstParagraph ); + aSects.emplace_back( pPd, pSectionFormat, nLnNumRestartNo, std::nullopt, nullptr, bIsFirstParagraph ); NeedsDocumentProtected( aSects.back() ); } @@ -1419,7 +1419,7 @@ void WW8AttributeOutput::SectionBiDi( bool bBiDi ) m_rWW8Export.pO->push_back( bBiDi? 1: 0 ); } -void WW8AttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional<sal_uInt16>& oPageRestartNumber ) +void WW8AttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::std::optional<sal_uInt16>& oPageRestartNumber ) { // sprmSNfcPgn sal_uInt8 nb = WW8Export::GetNumId( nNumType ); diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 21df13a16f6c..ef34318a3ec3 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -38,7 +38,7 @@ #include <vcl/graph.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/typed_flags_set.hxx> #include <cstddef> @@ -179,11 +179,11 @@ struct WW8_SepInfo const SwSectionFormat* pSectionFormat; const SwNode* pPDNd; sal_uLong const nLnNumRestartNo; - ::o3tl::optional<sal_uInt16> const oPgRestartNo; + ::std::optional<sal_uInt16> const oPgRestartNo; bool const bIsFirstParagraph; WW8_SepInfo( const SwPageDesc* pPD, const SwSectionFormat* pFormat, - sal_uLong nLnRestart, ::o3tl::optional<sal_uInt16> oPgRestart = o3tl::nullopt, + sal_uLong nLnRestart, ::std::optional<sal_uInt16> oPgRestart = std::nullopt, const SwNode* pNd = nullptr, bool bIsFirstPara = false ) : pPageDesc( pPD ), pSectionFormat( pFormat ), pPDNd( pNd ), nLnNumRestartNo( nLnRestart ), oPgRestartNo( oPgRestart ), diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index ead32361bb2d..ac4e931ecf0d 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -180,7 +180,7 @@ public: /// The style of the page numbers. /// - virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional<sal_uInt16>& oPageRestartNumber ) override; + virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::std::optional<sal_uInt16>& oPageRestartNumber ) override; /// The type of breaking. virtual void SectionType( sal_uInt8 nBreakCode ) override; diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 1f8319562bef..cddcb6650b51 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -984,7 +984,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId ) { - ::o3tl::optional<sal_uInt16> oNumOffset = rPageDesc.GetNumOffset(); + ::std::optional<sal_uInt16> oNumOffset = rPageDesc.GetNumOffset(); if (oNumOffset && *oNumOffset > 0) { // #i114163# positiveInteger only! diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index f97290a0d2e8..b73e844555b3 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -377,7 +377,7 @@ sal_uInt16 AbstractSwBreakDlg_Impl:: GetKind() return m_xDlg->GetKind(); } -::o3tl::optional<sal_uInt16> AbstractSwBreakDlg_Impl:: GetPageNumber() +::std::optional<sal_uInt16> AbstractSwBreakDlg_Impl:: GetPageNumber() { return m_xDlg->GetPageNumber(); } diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index c0e1aeeffde0..c34c16b80660 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -75,7 +75,7 @@ class SwTOXMark; class SwSplitTableDlg; #include <itabenum.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/deleter.hxx> namespace sw @@ -183,7 +183,7 @@ public: virtual short Execute() override; virtual OUString GetTemplateName() override; virtual sal_uInt16 GetKind() override; - virtual ::o3tl::optional<sal_uInt16> GetPageNumber() override; + virtual ::std::optional<sal_uInt16> GetPageNumber() override; }; class AbstractSwTableWidthDlg_Impl : public VclAbstractDialog diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx index 3e264f5bb0a4..26fa4bdeb564 100644 --- a/sw/source/ui/misc/titlepage.cxx +++ b/sw/source/ui/misc/titlepage.cxx @@ -28,7 +28,7 @@ namespace const SfxPoolItem* pItem(nullptr); if (SfxItemState::SET == aSet.GetItemState( RES_PAGEDESC, true, &pItem ) && pItem) { - ::o3tl::optional<sal_uInt16> oNumOffset = static_cast<const SwFormatPageDesc *>(pItem)->GetNumOffset(); + ::std::optional<sal_uInt16> oNumOffset = static_cast<const SwFormatPageDesc *>(pItem)->GetNumOffset(); if (oNumOffset) rPageNo = *oNumOffset; if (ppPageFormatDesc) @@ -59,7 +59,7 @@ namespace { if (pPageFormatDesc) { - ::o3tl::optional<sal_uInt16> oNumOffset = pPageFormatDesc->GetNumOffset(); + ::std::optional<sal_uInt16> oNumOffset = pPageFormatDesc->GetNumOffset(); if (oNumOffset) { nPgNo = *oNumOffset; diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index fcf8f5490a2e..9844f96a2321 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -1321,8 +1321,8 @@ bool SwTextFlowPage::FillItemSet( SfxItemSet* rSet ) } sal_uInt16 nPgNum = static_cast<sal_uInt16>(m_xPageNoNF->get_value()); bool const usePageNo(bState && m_xPageNoCB->get_active()); - o3tl::optional<sal_uInt16> const oPageNum( - usePageNo ? nPgNum : o3tl::optional<sal_Int16>()); + std::optional<sal_uInt16> const oPageNum( + usePageNo ? nPgNum : std::optional<sal_Int16>()); if (!pDesc || !pDesc->GetPageDesc() || (pDesc->GetPageDesc()->GetName() != sPage) || (pDesc->GetNumOffset() != oPageNum)) @@ -1449,7 +1449,7 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet ) OUString sPageDesc; const SwPageDesc* pDesc = static_cast<const SwFormatPageDesc*>(pItem)->GetPageDesc(); - ::o3tl::optional<sal_uInt16> oNumOffset = static_cast<const SwFormatPageDesc*>(pItem)->GetNumOffset(); + ::std::optional<sal_uInt16> oNumOffset = static_cast<const SwFormatPageDesc*>(pItem)->GetNumOffset(); if (oNumOffset) { m_xPageNoCB->set_active(true); diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index 7cff9685aa93..fc9b46af4a79 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -288,7 +288,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) else { OUString sFollowName(pFollow->GetName()); - pSh->InsertPageBreak(&sFollowName, o3tl::nullopt); + pSh->InsertPageBreak(&sFollowName, std::nullopt); } pSh->SttEndDoc(true); } diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 9bae7b6f2b84..0630071bb16c 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -326,7 +326,7 @@ void SwPageBreakWin::Activate( ) MenuButton::Activate(); } -void SwPageBreakWin::UpdatePosition(const o3tl::optional<Point>& xEvtPt) +void SwPageBreakWin::UpdatePosition(const std::optional<Point>& xEvtPt) { if ( xEvtPt ) { diff --git a/sw/source/uibase/inc/PageBreakWin.hxx b/sw/source/uibase/inc/PageBreakWin.hxx index 395006103614..982c81e157a4 100644 --- a/sw/source/uibase/inc/PageBreakWin.hxx +++ b/sw/source/uibase/inc/PageBreakWin.hxx @@ -13,7 +13,7 @@ #include "FrameControl.hxx" #include <vcl/builder.hxx> #include <vcl/timer.hxx> -#include <o3tl/optional.hxx> +#include <optional> class Menu; class SwPageFrame; @@ -34,7 +34,7 @@ class SwPageBreakWin : public SwFrameMenuButtonBase Timer m_aFadeTimer; bool m_bDestroyed; - o3tl::optional<Point> m_xMousePt; + std::optional<Point> m_xMousePt; public: SwPageBreakWin( SwEditWin* pEditWin, const SwFrame *pFrame ); @@ -46,7 +46,7 @@ public: virtual void MouseMove( const MouseEvent& rMEvt ) override; virtual void Activate( ) override; - void UpdatePosition(const o3tl::optional<Point>& xEvtPt = o3tl::optional<Point>()); + void UpdatePosition(const std::optional<Point>& xEvtPt = std::optional<Point>()); virtual void ShowAll( bool bShow ) override; virtual bool Contains( const Point &rDocPt ) const override; diff --git a/sw/source/uibase/inc/break.hxx b/sw/source/uibase/inc/break.hxx index 18c5069f6fbb..1d6bc7ee5970 100644 --- a/sw/source/uibase/inc/break.hxx +++ b/sw/source/uibase/inc/break.hxx @@ -21,7 +21,7 @@ #define INCLUDED_SW_SOURCE_UIBASE_INC_BREAK_HXX #include <vcl/weld.hxx> -#include <o3tl/optional.hxx> +#include <optional> class SwWrtShell; @@ -39,7 +39,7 @@ class SwBreakDlg : public weld::GenericDialogController SwWrtShell &rSh; OUString m_aTemplate; sal_uInt16 nKind; - ::o3tl::optional<sal_uInt16> oPgNum; + ::std::optional<sal_uInt16> oPgNum; bool const bHtmlMode; @@ -56,7 +56,7 @@ public: virtual short run() override; const OUString& GetTemplateName() const { return m_aTemplate; } sal_uInt16 GetKind() const { return nKind; } - const ::o3tl::optional<sal_uInt16>& GetPageNumber() const { return oPgNum; } + const ::std::optional<sal_uInt16>& GetPageNumber() const { return oPgNum; } }; #endif diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index acd463ad74ed..3059ee609a1c 100644 --- a/sw/source/uibase/inc/edtwin.hxx +++ b/sw/source/uibase/inc/edtwin.hxx @@ -92,7 +92,7 @@ class SW_DLLPUBLIC SwEditWin final : public vcl::Window, std::unique_ptr<SdrDropMarkerOverlay> m_pUserMarker; SdrObject *m_pUserMarkerObj; std::unique_ptr<SwShadowCursor, o3tl::default_delete<SwShadowCursor>> m_pShadCursor; - o3tl::optional<Point> m_xRowColumnSelectionStart; // save position where table row/column selection has been started + std::optional<Point> m_xRowColumnSelectionStart; // save position where table row/column selection has been started SwView &m_rView; diff --git a/sw/source/uibase/inc/toxmgr.hxx b/sw/source/uibase/inc/toxmgr.hxx index e9a49e71f8f5..057181f6026b 100644 --- a/sw/source/uibase/inc/toxmgr.hxx +++ b/sw/source/uibase/inc/toxmgr.hxx @@ -24,7 +24,7 @@ #include <tox.hxx> #include <authfld.hxx> #include <memory> -#include <o3tl/optional.hxx> +#include <optional> class SwWrtShell; class SwForm; @@ -38,9 +38,9 @@ class SW_DLLPUBLIC SwTOXDescription OUString m_sSequenceName; OUString m_sMainEntryCharStyle; OUString m_sAutoMarkURL; - o3tl::optional<OUString> + std::optional<OUString> m_aTitle; - o3tl::optional<OUString> + std::optional<OUString> m_aTOUName; std::unique_ptr<SwForm> m_pForm; @@ -98,10 +98,10 @@ public: void SetAutoMarkURL(const OUString& rSet) {m_sAutoMarkURL = rSet;} void SetTitle(const OUString& rSet) { m_aTitle = rSet; } - o3tl::optional<OUString> const & GetTitle() const {return m_aTitle; } + std::optional<OUString> const & GetTitle() const {return m_aTitle; } void SetTOUName(const OUString& rSet) { m_aTOUName = rSet; } - o3tl::optional<OUString> const & GetTOUName() const { return m_aTOUName; } + std::optional<OUString> const & GetTOUName() const { return m_aTOUName; } void SetForm(const SwForm& rSet) { m_pForm.reset( new SwForm(rSet) );} const SwForm* GetForm() const {return m_pForm.get();} @@ -172,14 +172,14 @@ class SwTOXMarkDescription int mnLevel; bool mbMainEntry; - o3tl::optional<OUString> maPrimKey; - o3tl::optional<OUString> maSecKey; - o3tl::optional<OUString> maAltStr; - o3tl::optional<OUString> maTOUName; + std::optional<OUString> maPrimKey; + std::optional<OUString> maSecKey; + std::optional<OUString> maAltStr; + std::optional<OUString> maTOUName; - o3tl::optional<OUString> maPhoneticReadingOfAltStr; - o3tl::optional<OUString> maPhoneticReadingOfPrimKey; - o3tl::optional<OUString> maPhoneticReadingOfSecKey; + std::optional<OUString> maPhoneticReadingOfAltStr; + std::optional<OUString> maPhoneticReadingOfPrimKey; + std::optional<OUString> maPhoneticReadingOfSecKey; SwTOXMarkDescription(SwTOXMarkDescription const &) = delete; SwTOXMarkDescription & operator= (SwTOXMarkDescription const &) = delete; @@ -202,25 +202,25 @@ public: bool IsMainEntry() const {return mbMainEntry;} void SetPrimKey(const OUString& rSet) { maPrimKey = rSet; } - o3tl::optional<OUString> const & GetPrimKey() const { return maPrimKey; } + std::optional<OUString> const & GetPrimKey() const { return maPrimKey; } void SetSecKey(const OUString& rSet) { maSecKey = rSet; } - o3tl::optional<OUString> const & GetSecKey() const { return maSecKey; } + std::optional<OUString> const & GetSecKey() const { return maSecKey; } void SetAltStr(const OUString& rSet) { maAltStr = rSet; } - o3tl::optional<OUString> const & GetAltStr() const { return maAltStr; } + std::optional<OUString> const & GetAltStr() const { return maAltStr; } void SetTOUName(const OUString& rSet) { maTOUName = rSet; } - o3tl::optional<OUString> const & GetTOUName() const { return maTOUName; } + std::optional<OUString> const & GetTOUName() const { return maTOUName; } void SetPhoneticReadingOfAltStr(const OUString& rSet) { maPhoneticReadingOfAltStr = rSet; } - o3tl::optional<OUString> const & GetPhoneticReadingOfAltStr() const { return maPhoneticReadingOfAltStr; } + std::optional<OUString> const & GetPhoneticReadingOfAltStr() const { return maPhoneticReadingOfAltStr; } void SetPhoneticReadingOfPrimKey(const OUString& rSet) { maPhoneticReadingOfPrimKey = rSet; } - o3tl::optional<OUString> const & GetPhoneticReadingOfPrimKey() const { return maPhoneticReadingOfPrimKey; } + std::optional<OUString> const & GetPhoneticReadingOfPrimKey() const { return maPhoneticReadingOfPrimKey; } void SetPhoneticReadingOfSecKey(const OUString& rSet) { maPhoneticReadingOfSecKey = rSet; } - o3tl::optional<OUString> const & GetPhoneticReadingOfSecKey() const { return maPhoneticReadingOfSecKey; } + std::optional<OUString> const & GetPhoneticReadingOfSecKey() const { return maPhoneticReadingOfSecKey; } }; class SW_DLLPUBLIC SwTOXMgr diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 61c4389da489..c661225c604c 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -24,7 +24,7 @@ #include <swurl.hxx> #include <IMark.hxx> #include "navmgr.hxx" -#include <o3tl/optional.hxx> +#include <optional> #include <o3tl/typed_flags_set.hxx> #include <svx/swframetypes.hxx> #include <vcl/weld.hxx> @@ -308,7 +308,7 @@ typedef bool (SwWrtShell:: *FNSimpleMove)(); RndStdIds nAnchorType = RndStdIds::FLY_AT_PARA); void InsertByWord( const OUString & ); - void InsertPageBreak(const OUString *pPageDesc = nullptr, const ::o3tl::optional<sal_uInt16>& rPgNum = o3tl::nullopt); + void InsertPageBreak(const OUString *pPageDesc = nullptr, const ::std::optional<sal_uInt16>& rPgNum = std::nullopt); void InsertLineBreak(); void InsertColumnBreak(); void InsertFootnote(const OUString &, bool bEndNote = false, bool bEdit = true ); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 88d8fbcd2557..89df49393efa 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -598,7 +598,7 @@ void SwTextShell::Execute(SfxRequest &rReq) case FN_INSERT_BREAK_DLG: { sal_uInt16 nKind=0; - ::o3tl::optional<sal_uInt16> oPageNumber; + ::std::optional<sal_uInt16> oPageNumber; OUString aTemplateName; if ( pItem ) { diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index 152954534ea0..55ca1a9c5f06 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -297,7 +297,7 @@ void SwView::ExecSearch(SfxRequest& rReq) m_pWrtShell->Push(); OUString aReplace( s_pSrchItem->GetReplaceString() ); i18nutil::SearchOptions2 aTmp( s_pSrchItem->GetSearchOptions() ); - o3tl::optional<OUString> xBackRef = sw::ReplaceBackReferences(aTmp, + std::optional<OUString> xBackRef = sw::ReplaceBackReferences(aTmp, m_pWrtShell->GetCursor(), m_pWrtShell->GetLayout()); if( xBackRef ) s_pSrchItem->SetReplaceString( *xBackRef ); diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index cf82118f8ace..b8362420d276 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -648,7 +648,7 @@ void SwToSfxPageDescAttr( SfxItemSet& rCoreSet ) { const SfxPoolItem* pItem = nullptr; OUString aName; - ::o3tl::optional<sal_uInt16> oNumOffset; + ::std::optional<sal_uInt16> oNumOffset; bool bPut = true; switch( rCoreSet.GetItemState( RES_PAGEDESC, true, &pItem ) ) { diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 4225c59b68ec..89211d49f581 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -867,7 +867,7 @@ void SwWrtShell::ConnectObj( svt::EmbeddedObjectRef& xObj, const SwRect &rPrt, // Insert hard page break; // Selections will be overwritten -void SwWrtShell::InsertPageBreak(const OUString *pPageDesc, const ::o3tl::optional<sal_uInt16>& oPgNum ) +void SwWrtShell::InsertPageBreak(const OUString *pPageDesc, const ::std::optional<sal_uInt16>& oPgNum ) { ResetCursorStack(); if( CanInsert() ) |