From 7e403195e574be5174815a51cf5c42f06f76a87a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 30 Nov 2019 17:48:32 +0100 Subject: Introduce o3tl::optional as an alias for std::optional ...with a boost::optional fallback for Xcode < 10 (as std::optional is only available starting with Xcode 10 according to , and our baseline for iOS and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite all code to use o3tl::optional instead of boost::optional. One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus -Werror=maybe-uninitialized" should no longer be necessary (and whose check happened to no longer trigger for GCC 10 trunk, even though that compiler would still emit bogus -Wmaybe-uninitialized for uses of boost::optional under --enable-optimized, which made me ponder whether this switch from boost::optional to std::optional would be a useful thing to do; I keep that configure.ac check for now, though, and will only remove it in a follow up commit). Another longer-term benefit is that the code is now already in good shape for an eventual switch to std::optional (a switch we would have done anyway once we no longer need to support Xcode < 10). Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses boost::property_tree::ptree::get_child_optional returning boost::optional, so let it keep using boost::optional for now. After a number of preceding commits have paved the way for this change, this commit is completely mechanical, done with > git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\|o3tl/optional.hxx|g' -e 's/\/o3tl\1::\2\3optional/g' -e 's/\/o3tl\1::\2nullopt/g' (before committing include/o3tl/optional.hxx, and relying on some GNU features). It excludes some files where mention of boost::optional et al should apparently not be changed (and the sub-repo directory stubs). It turned out that all uses of boost::none across the code base were in combination with boost::optional, so had all to be rewritten as o3tl::nullopt. Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b Reviewed-on: https://gerrit.libreoffice.org/84128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sw/inc/anchoreddrawobject.hxx | 6 ++--- sw/inc/crsrsh.hxx | 2 +- sw/inc/fmtpdsc.hxx | 8 +++--- sw/inc/pch/precompiled_msword.hxx | 2 +- sw/inc/pch/precompiled_sw.hxx | 4 +-- sw/inc/pch/precompiled_swui.hxx | 2 +- sw/inc/pch/precompiled_vbaswobj.hxx | 2 +- sw/inc/redline.hxx | 4 +-- sw/inc/swabstdlg.hxx | 4 +-- sw/inc/undobj.hxx | 4 +-- sw/source/core/crsr/BlockCursor.hxx | 10 +++---- sw/source/core/crsr/bookmrk.cxx | 2 +- sw/source/core/crsr/findattr.cxx | 8 +++--- sw/source/core/crsr/findtxt.cxx | 8 +++--- sw/source/core/doc/docdraw.cxx | 2 +- sw/source/core/frmedt/fedesc.cxx | 2 +- sw/source/core/frmedt/fews.cxx | 2 +- sw/source/core/inc/UndoDelete.hxx | 4 +-- sw/source/core/inc/UndoInsert.hxx | 12 ++++----- sw/source/core/inc/swfont.hxx | 26 +++++++++--------- sw/source/core/inc/wrong.hxx | 4 +-- sw/source/core/layout/atrfrm.cxx | 4 +-- sw/source/core/layout/calcmove.cxx | 4 +-- sw/source/core/layout/flowfrm.cxx | 2 +- sw/source/core/layout/laycache.cxx | 2 +- sw/source/core/layout/newfrm.cxx | 2 +- sw/source/core/layout/pagechg.cxx | 2 +- sw/source/core/layout/paintfrm.cxx | 2 +- sw/source/core/layout/trvlfrm.cxx | 4 +-- sw/source/core/text/wrong.cxx | 10 +++---- sw/source/core/tox/tox.cxx | 8 +++--- sw/source/core/txtnode/swfont.cxx | 8 +++--- sw/source/core/txtnode/txatbase.cxx | 4 +-- sw/source/core/undo/undel.cxx | 2 +- sw/source/core/undo/unins.cxx | 10 +++---- sw/source/filter/html/htmlatr.cxx | 6 ++--- sw/source/filter/html/wrthtml.hxx | 2 +- sw/source/filter/ww8/attributeoutputbase.hxx | 4 +-- sw/source/filter/ww8/docxattributeoutput.cxx | 20 +++++++------- sw/source/filter/ww8/docxattributeoutput.hxx | 6 ++--- sw/source/filter/ww8/docxtablestyleexport.cxx | 6 ++--- sw/source/filter/ww8/rtfattributeoutput.cxx | 4 +-- sw/source/filter/ww8/rtfattributeoutput.hxx | 6 ++--- sw/source/filter/ww8/rtfexport.cxx | 2 +- sw/source/filter/ww8/wrtw8sty.cxx | 4 +-- sw/source/filter/ww8/wrtww8.hxx | 6 ++--- sw/source/filter/ww8/ww8attributeoutput.hxx | 2 +- sw/source/filter/xml/xmlexpit.cxx | 2 +- sw/source/ui/dialog/swdlgfact.cxx | 2 +- sw/source/ui/dialog/swdlgfact.hxx | 4 +-- sw/source/ui/misc/titlepage.cxx | 4 +-- sw/source/ui/table/tabledlg.cxx | 6 ++--- sw/source/uibase/app/appenv.cxx | 2 +- sw/source/uibase/docvw/PageBreakWin.cxx | 2 +- sw/source/uibase/inc/PageBreakWin.hxx | 6 ++--- sw/source/uibase/inc/break.hxx | 6 ++--- sw/source/uibase/inc/edtwin.hxx | 2 +- sw/source/uibase/inc/toxmgr.hxx | 38 +++++++++++++-------------- sw/source/uibase/inc/wrtsh.hxx | 4 +-- sw/source/uibase/shells/textsh1.cxx | 2 +- sw/source/uibase/uiview/viewsrch.cxx | 2 +- sw/source/uibase/utlui/uitool.cxx | 2 +- sw/source/uibase/wrtsh/wrtsh1.cxx | 2 +- 63 files changed, 168 insertions(+), 168 deletions(-) (limited to 'sw') diff --git a/sw/inc/anchoreddrawobject.hxx b/sw/inc/anchoreddrawobject.hxx index 8f383348277f..2524994f07f9 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 +#include namespace tools { class Rectangle; } @@ -33,7 +33,7 @@ class SwAnchoredDrawObject final : public SwAnchoredObject bool mbValidPos; // rectangle, keeping the last object rectangle after the positioning - boost::optional maLastObjRect; + o3tl::optional 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; - boost::optional const & GetLastObjRect() const { return maLastObjRect;} + o3tl::optional 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 23b3753dd938..daf784a4c86a 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 -boost::optional ReplaceBackReferences(const i18nutil::SearchOptions2& rSearchOpt, +o3tl::optional ReplaceBackReferences(const i18nutil::SearchOptions2& rSearchOpt, SwPaM* pPam, SwRootFrame const* pLayout ); bool GetRanges(std::vector> & rRanges, diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx index 4b99ccb3ad72..1db805950fed 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 +#include #include "pagedesc.hxx" class IntlWrapper; @@ -34,7 +34,7 @@ class IntlWrapper; class SW_DLLPUBLIC SwFormatPageDesc : public SfxPoolItem, public SwClient { - ::boost::optional m_oNumOffset; ///< Offset page number. + ::o3tl::optional 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(GetRegisteredIn()); } const SwPageDesc *GetPageDesc() const { return static_cast(GetRegisteredIn()); } - const ::boost::optional& GetNumOffset() const { return m_oNumOffset; } - void SetNumOffset( const ::boost::optional& oNum ) { m_oNumOffset = oNum; } + const ::o3tl::optional& GetNumOffset() const { return m_oNumOffset; } + void SetNumOffset( const ::o3tl::optional& 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 c40301871c1b..6eb4c4cf5cd4 100644 --- a/sw/inc/pch/precompiled_msword.hxx +++ b/sw/inc/pch/precompiled_msword.hxx @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index 37bcf744afe3..b9fb0e0fddbd 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -46,8 +46,8 @@ #include #include #include -#include -#include +#include +#include #include #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 diff --git a/sw/inc/pch/precompiled_swui.hxx b/sw/inc/pch/precompiled_swui.hxx index 3db3571ed8b2..48f81b6d9be3 100644 --- a/sw/inc/pch/precompiled_swui.hxx +++ b/sw/inc/pch/precompiled_swui.hxx @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 diff --git a/sw/inc/pch/precompiled_vbaswobj.hxx b/sw/inc/pch/precompiled_vbaswobj.hxx index 7b6b4f96bf4e..d0a0f44cd1dc 100644 --- a/sw/inc/pch/precompiled_vbaswobj.hxx +++ b/sw/inc/pch/precompiled_vbaswobj.hxx @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index b35353f60d89..8503eca4f7f9 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include class SfxItemSet; @@ -158,7 +158,7 @@ class SW_DLLPUBLIC SwRangeRedline : public SwPaM bool m_bIsVisible : 1; sal_uInt32 const m_nId; - boost::optional m_oLOKLastNodeTop; + o3tl::optional m_oLOKLastNodeTop; void MoveToSection(); void CopyToSection(); diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 3d4dd0d7ff29..dfe31d8978f6 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "dbmgr.hxx" #include #include "tblenum.hxx" @@ -232,7 +232,7 @@ protected: public: virtual OUString GetTemplateName() = 0; virtual sal_uInt16 GetKind() = 0; - virtual ::boost::optional GetPageNumber() = 0; + virtual ::o3tl::optional GetPageNumber() = 0; }; diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index d98507dac3b5..dc271d0cf94d 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -27,7 +27,7 @@ #include "SwRewriter.hxx" #include "swundo.hxx" #include -#include +#include class SwHistory; class SwPaM; @@ -58,7 +58,7 @@ class SwUndo protected: bool m_bCacheComment; - mutable boost::optional maComment; + mutable o3tl::optional 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 805b4a9a9bc2..dfbb71abdce1 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 +#include #include #include @@ -39,8 +39,8 @@ struct SwPosition; class SwBlockCursor { SwShellCursor maCursor; - boost::optional maStartPt; - boost::optional maEndPt; + o3tl::optional maStartPt; + o3tl::optional maEndPt; public: SwBlockCursor( const SwCursorShell& rCursorSh, const SwPosition &rPos ) : @@ -69,12 +69,12 @@ public: @return 0, if no start point has been set */ - boost::optional const & getStartPoint() const { return maStartPt; } + o3tl::optional 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 */ - boost::optional const & getEndPoint() const { return maEndPt; } + o3tl::optional 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 a16713dc295d..e5c879b7518c 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -55,7 +55,7 @@ namespace sw { namespace mark sal_uLong const nStartNode(rStartPos.nNode.GetIndex()); sal_uLong const nEndNode(rEndPos.nNode.GetIndex()); int nFields(0); - boost::optional ret; + o3tl::optional 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 3755a469dcf5..1709efbcb910 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -65,9 +65,9 @@ static bool CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 ) static_cast(rItem2).GetValue() ); case RES_PAGEDESC: bool bNumOffsetEqual = false; - ::boost::optional const oNumOffset1 = + ::o3tl::optional const oNumOffset1 = static_cast(rItem1).GetNumOffset(); - ::boost::optional const oNumOffset2 = + ::o3tl::optional const oNumOffset2 = static_cast(rItem2).GetNumOffset(); if (!oNumOffset1 && !oNumOffset2) { @@ -1315,7 +1315,7 @@ int SwFindParaAttr::DoFind(SwPaM & rCursor, SwMoveFnCollection const & fnMove, const_cast(rRegion).GetRingContainer().merge( m_rCursor.GetRingContainer() ); } - boost::optional xRepl; + o3tl::optional 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 d9658bc75335..729fef65c063 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -139,7 +139,7 @@ public: class MaybeMergedIter { - boost::optional m_oMergedIter; + o3tl::optional m_oMergedIter; SwTextNode const*const m_pNode; size_t m_HintIndex; @@ -950,7 +950,7 @@ int SwFindParaText::DoFind(SwPaM & rCursor, SwMoveFnCollection const & fnMove, const_cast(rRegion).GetRingContainer().merge( m_rCursor.GetRingContainer() ); } - boost::optional xRepl; + o3tl::optional xRepl; if (bRegExp) xRepl = sw::ReplaceBackReferences(m_rSearchOpt, &rCursor, m_pLayout); bool const bReplaced = sw::ReplaceImpl(rCursor, @@ -1093,10 +1093,10 @@ bool ReplaceImpl( return bReplaced; } -boost::optional ReplaceBackReferences(const i18nutil::SearchOptions2& rSearchOpt, +o3tl::optional ReplaceBackReferences(const i18nutil::SearchOptions2& rSearchOpt, SwPaM *const pPam, SwRootFrame const*const pLayout) { - boost::optional xRet; + o3tl::optional 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 05a4384243e7..94b71b2d998c 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -525,7 +525,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) else if (dynamic_cast( pField)) { // Clear measure field - pInfo->SetFieldColor(boost::optional()); + pInfo->SetFieldColor(o3tl::optional()); } else if ( auto pTimeField = dynamic_cast( pField) ) { diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx index 55c81cc7fc2c..ac914db0bb68 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; - ::boost::optional oPageNumOffset; + ::o3tl::optional 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 f6b338b78ca9..0f0d07082915 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(); - ::boost::optional oNumOffset = pFlow->GetPageDescItem().GetNumOffset(); + ::o3tl::optional 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 b9b52583971e..210c7f668d5e 100644 --- a/sw/source/core/inc/UndoDelete.hxx +++ b/sw/source/core/inc/UndoDelete.hxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include class SwRedlineSaveDatas; class SwTextNode; @@ -38,7 +38,7 @@ class SwUndoDelete , private SwUndoSaveContent { std::unique_ptr m_pMvStt; // Position of Nodes in UndoNodes-Array - boost::optional m_aSttStr, m_aEndStr; + o3tl::optional m_aSttStr, m_aEndStr; std::unique_ptr 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 b290cbdcbb35..eaef3609b720 100644 --- a/sw/source/core/inc/UndoInsert.hxx +++ b/sw/source/core/inc/UndoInsert.hxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include class Graphic; class SwGrfNode; @@ -41,8 +41,8 @@ class SwUndoInsert: public SwUndo, private SwUndoSaveContent { /// start of Content in UndoNodes for Redo std::unique_ptr m_pUndoNodeIndex; - boost::optional maText; - boost::optional maUndoText; + o3tl::optional maText; + o3tl::optional maUndoText; std::unique_ptr pRedlData; sal_uLong nNode; sal_Int32 nContent, nLen; @@ -59,7 +59,7 @@ class SwUndoInsert: public SwUndo, private SwUndoSaveContent SwDoc * pDoc; void Init(const SwNodeIndex & rNode); - boost::optional GetTextFromDoc() const; + o3tl::optional 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 pGrf; - boost::optional maNm; - boost::optional maFltr; + o3tl::optional maNm; + o3tl::optional maFltr; sal_uLong nPos; MirrorGraph nMirr; diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index fbec9f18a1c6..62cd74b81171 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -28,7 +28,7 @@ #include #include "drawfont.hxx" #include -#include +#include #include class SfxItemSet; @@ -140,10 +140,10 @@ class SwFont Color m_aOverColor; // color of the overlining // character borders - boost::optional m_aTopBorder; - boost::optional m_aBottomBorder; - boost::optional m_aRightBorder; - boost::optional m_aLeftBorder; + o3tl::optional m_aTopBorder; + o3tl::optional m_aBottomBorder; + o3tl::optional m_aRightBorder; + o3tl::optional 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 boost::optional& GetTopBorder() const { return m_aTopBorder; } - const boost::optional& GetBottomBorder() const { return m_aBottomBorder; } - const boost::optional& GetRightBorder() const { return m_aRightBorder; } - const boost::optional& GetLeftBorder() const { return m_aLeftBorder; } + const o3tl::optional& GetTopBorder() const { return m_aTopBorder; } + const o3tl::optional& GetBottomBorder() const { return m_aBottomBorder; } + const o3tl::optional& GetRightBorder() const { return m_aRightBorder; } + const o3tl::optional& GetLeftBorder() const { return m_aLeftBorder; } // Get absolute border correspond to the layout verticality and orientation. - const boost::optional& + const o3tl::optional& GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const; - const boost::optional& + const o3tl::optional& GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const; - const boost::optional& + const o3tl::optional& GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const; - const boost::optional& + const o3tl::optional& 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 53581720e853..4d063cace493 100644 --- a/sw/source/core/inc/wrong.hxx +++ b/sw/source/core/inc/wrong.hxx @@ -29,7 +29,7 @@ #include -#include +#include #include #include @@ -407,7 +407,7 @@ public: WrongListIteratorCounter(SwWrongList const& rWrongList); sal_uInt16 GetElementCount(); - boost::optional> GetElementAt(sal_uInt16 nIndex); + o3tl::optional> GetElementAt(sal_uInt16 nIndex); }; } // namespace sw diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 25de2a9b90d1..e214f9752a73 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -700,7 +700,7 @@ bool SwFormatPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { case MID_PAGEDESC_PAGENUMOFFSET: { - ::boost::optional oOffset = GetNumOffset(); + ::o3tl::optional oOffset = GetNumOffset(); if (oOffset) { rVal <<= static_cast(*oOffset); @@ -744,7 +744,7 @@ bool SwFormatPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int16 nOffset = 0; if (!rVal.hasValue()) { - SetNumOffset(boost::none); + SetNumOffset(o3tl::nullopt); } else if (rVal >>= nOffset) SetNumOffset( nOffset ); diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index caa81ecbd182..4c7a88543827 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -408,8 +408,8 @@ void SwFrame::PrepareCursor() std::list tabGuard; std::list rowGuard; #else - boost::optional tabGuard; - boost::optional rowGuard; + o3tl::optional tabGuard; + o3tl::optional rowGuard; #endif SwFlowFrame* pThis = bCnt ? static_cast(this) : nullptr; diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 8c1bada4012d..af97485088e8 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -2538,7 +2538,7 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat ) #if BOOST_VERSION < 105600 std::list g; #else - ::boost::optional g; + ::o3tl::optional g; #endif if (m_rThis.GetUpper()->IsCellFrame()) { diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 30b32d3a8ccf..3fff3bc54cc7 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -652,7 +652,7 @@ bool SwLayHelper::CheckInsertPage() if ( bBrk || pDesc ) { - ::boost::optional oPgNum; + ::o3tl::optional oPgNum; if ( !pDesc ) { pDesc = mrpPage->GetPageDesc()->GetFollow(); diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 90bb47890d99..90d4fbde380a 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; - ::boost::optional oPgNum; + ::o3tl::optional oPgNum; if ( pTableNd ) { diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 6d1df44ddd59..c31911594ecb 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() ) { - ::boost::optional oNumOffset = rDesc.GetNumOffset(); + ::o3tl::optional oNumOffset = rDesc.GetNumOffset(); bWishedOdd = oNumOffset && (*oNumOffset % 2) != 0; // 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 21c64087a460..13d0fe04afb4 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4766,7 +4766,7 @@ namespace drawinglayer namespace { -editeng::SvxBorderLine const * get_ptr(boost::optional const & opt) { +editeng::SvxBorderLine const * get_ptr(o3tl::optional const & opt) { return opt ? &*opt : nullptr; } diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 7dc15c10e6a5..fe131dbc51c1 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1714,7 +1714,7 @@ bool SwFrame::WannaRightPage() const const SwFrame *pFlow = pPage->FindFirstBodyContent(); const SwPageDesc *pDesc = nullptr; - ::boost::optional oPgNum; + ::o3tl::optional oPgNum; if ( pFlow ) { if ( pFlow->IsInTab() ) @@ -1846,7 +1846,7 @@ sal_uInt16 SwFrame::GetVirtPageNum() const } if ( pFrame ) { - ::boost::optional oNumOffset = pFrame->GetPageDescItem().GetNumOffset(); + ::o3tl::optional oNumOffset = pFrame->GetPageDescItem().GetNumOffset(); if (oNumOffset) { return nPhyPage - pFrame->GetPhyPageNum() + *oNumOffset; diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx index 6865884b34a8..436214ea2e86 100644 --- a/sw/source/core/text/wrong.cxx +++ b/sw/source/core/text/wrong.cxx @@ -877,7 +877,7 @@ sal_uInt16 WrongListIteratorCounter::GetElementCount() return 0; } -boost::optional> +o3tl::optional> WrongListIteratorCounter::GetElementAt(sal_uInt16 nIndex) { if (m_pMergedPara) @@ -908,7 +908,7 @@ WrongListIteratorCounter::GetElementAt(sal_uInt16 nIndex) { if (nIndex == 0) { - return boost::optional>( + return o3tl::optional>( std::pair( m_CurrentIndex - TextFrameIndex(rExtent.nStart - std::max(rExtent.nStart, pWrong->mnPos)), @@ -921,17 +921,17 @@ WrongListIteratorCounter::GetElementAt(sal_uInt16 nIndex) m_CurrentIndex += TextFrameIndex(rExtent.nEnd - rExtent.nStart); ++m_CurrentExtent; } - return boost::optional>(); + return o3tl::optional>(); } else if (m_pWrongList) { SwWrongArea const*const pWrong(m_pWrongList->GetElement(nIndex)); - return boost::optional>( + return o3tl::optional>( std::pair( TextFrameIndex(pWrong->mnPos), TextFrameIndex(pWrong->mnPos + pWrong->mnLen))); } - return boost::optional>(); + return o3tl::optional>(); } } // namespace sw diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 9d698bf0b8a1..f1df646e6bf0 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include @@ -820,7 +820,7 @@ lcl_SearchNextToken(const OUString & sPattern, sal_Int32 const nStt) @return the token */ -static boost::optional +static o3tl::optional lcl_BuildToken(const OUString & sPattern, sal_Int32 & nCurPatternPos) { OUString sToken( lcl_SearchNextToken(sPattern, nCurPatternPos) ); @@ -830,7 +830,7 @@ lcl_BuildToken(const OUString & sPattern, sal_Int32 & nCurPatternPos) if (TOKEN_END == eTokenType) // invalid input? skip it { nCurPatternPos = sPattern.getLength(); - return boost::optional(); + return o3tl::optional(); } // at this point sPattern contains the @@ -909,7 +909,7 @@ SwFormTokensHelper::SwFormTokensHelper(const OUString & rPattern) while (nCurPatternPos < rPattern.getLength()) { - boost::optional const oToken( + o3tl::optional 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 9816212aa690..55284ce3d275 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -124,7 +124,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 boost::optional& +const o3tl::optional& SwFont::GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) @@ -148,7 +148,7 @@ SwFont::GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) cons } } -const boost::optional& +const o3tl::optional& SwFont::GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) @@ -172,7 +172,7 @@ SwFont::GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) c } } -const boost::optional& +const o3tl::optional& SwFont::GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const { switch (GetOrientation(bVertLayout, bVertLayoutLRBT)) @@ -196,7 +196,7 @@ SwFont::GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) con } } -const boost::optional& +const o3tl::optional& 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 188ec6f9a663..e0293d61d881 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 +#include #include #include #include @@ -96,7 +96,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; - boost::optional oValue; + o3tl::optional oValue; switch (Which()) { case RES_TXTATR_AUTOFMT: diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index ab32dff0901c..cf822f55a4d8 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -779,7 +779,7 @@ SwRewriter SwUndoDelete::GetRewriter() const } else { - boost::optional aTmpStr; + o3tl::optional 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 4ebe984116ae..3932194f7f26 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -61,9 +61,9 @@ using namespace ::com::sun::star; // INSERT -boost::optional SwUndoInsert::GetTextFromDoc() const +o3tl::optional SwUndoInsert::GetTextFromDoc() const { - boost::optional aResult; + o3tl::optional aResult; SwNodeIndex aNd( pDoc->GetNodes(), nNode); SwContentNode* pCNd = aNd.GetNode().GetContentNode(); @@ -454,7 +454,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext) SwRewriter SwUndoInsert::GetRewriter() const { SwRewriter aResult; - boost::optional aStr; + o3tl::optional aStr; bool bDone = false; if (maText) @@ -800,8 +800,8 @@ void SwUndoReRead::SetAndSave(::sw::UndoRedoContext & rContext) // cache the old values std::unique_ptr pOldGrf( pGrf ? new Graphic(*pGrf) : nullptr); - boost::optional aOldNm = maNm; - boost::optional aOldFltr = maFltr; + o3tl::optional aOldNm = maNm; + o3tl::optional aOldFltr = maFltr; MirrorGraph nOldMirr = nMirr; // 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 72c3e20b68e8..0af993324d62 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1090,7 +1090,7 @@ class HTMLEndPosLst SwDoc *pDoc; // the current document SwDoc* const pTemplate; // the HTML template (or 0) - boost::optional xDfltColor;// the default foreground colors + o3tl::optional xDfltColor;// the default foreground colors std::set& rScriptTextStyles; sal_uLong const nHTMLMode; @@ -1134,7 +1134,7 @@ class HTMLEndPosLst public: - HTMLEndPosLst( SwDoc *pDoc, SwDoc* pTemplate, boost::optional xDfltColor, + HTMLEndPosLst( SwDoc *pDoc, SwDoc* pTemplate, o3tl::optional xDfltColor, bool bOutStyles, sal_uLong nHTMLMode, const OUString& rText, std::set& rStyles ); ~HTMLEndPosLst(); @@ -1582,7 +1582,7 @@ const SwHTMLFormatInfo *HTMLEndPosLst::GetFormatInfo( const SwFormat& rFormat, return pFormatInfo; } -HTMLEndPosLst::HTMLEndPosLst(SwDoc* pD, SwDoc* pTempl, boost::optional xDfltCol, +HTMLEndPosLst::HTMLEndPosLst(SwDoc* pD, SwDoc* pTempl, o3tl::optional xDfltCol, bool bStyles, sal_uLong nMode, const OUString& rText, std::set& rStyles) : pDoc(pD) diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index 805643817003..9743e70a6a93 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -296,7 +296,7 @@ public: css::uno::Reference mxFormComps; // current form rtl::Reference m_xTemplate; // HTML template - boost::optional m_xDfltColor; // default colour + o3tl::optional 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 70509ed47806..dfcbd9162ea4 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include @@ -339,7 +339,7 @@ public: /// The style of the page numbers. /// - virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional& oPageRestartNumber ) = 0; + virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional& 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 113d26170423..91d77e81ddbb 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2486,7 +2486,7 @@ const NameToId constNameToIdMapping[] = { OUString("styleSet"), FSNS( XML_w14, XML_styleSet ) }, }; -boost::optional lclGetElementIdForName(const OUString& rName) +o3tl::optional lclGetElementIdForName(const OUString& rName) { for (auto const & i : constNameToIdMapping) { @@ -2495,7 +2495,7 @@ boost::optional lclGetElementIdForName(const OUString& rName) return i.maId; } } - return boost::optional(); + return o3tl::optional(); } void lclProcessRecursiveGrabBag(sal_Int32 aElementId, const css::uno::Sequence& rElements, sax_fastparser::FSHelperPtr const & pSerializer) @@ -2525,7 +2525,7 @@ void lclProcessRecursiveGrabBag(sal_Int32 aElementId, const css::uno::Sequence(), RTL_TEXTENCODING_ASCII_US); } - boost::optional aSubElementId = lclGetElementIdForName(rAttribute.Name); + o3tl::optional aSubElementId = lclGetElementIdForName(rAttribute.Name); if(aSubElementId) pAttributes->add(*aSubElementId, aValue.getStr()); } @@ -2538,7 +2538,7 @@ void lclProcessRecursiveGrabBag(sal_Int32 aElementId, const css::uno::Sequence aSumElements; - boost::optional aSubElementId = lclGetElementIdForName(rElement.Name); + o3tl::optional aSubElementId = lclGetElementIdForName(rElement.Name); if(aSubElementId) { rElement.Value >>= aSumElements; @@ -2585,7 +2585,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties() for (const beans::PropertyValue & i : m_aTextEffectsGrabBag) { - boost::optional aElementId = lclGetElementIdForName(i.Name); + o3tl::optional aElementId = lclGetElementIdForName(i.Name); if(aElementId) { uno::Sequence aGrabBagSeq; @@ -6320,13 +6320,13 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut } -void DocxAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional& oPageRestartNumber ) +void DocxAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional& oPageRestartNumber ) { // FIXME Not called properly with page styles like "First Page" FastAttributeList* pAttr = FastSerializerHelper::createAttrList(); - // boost::none means no restart: then don't output that attribute if it is negative + // o3tl::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 ) ); @@ -8285,9 +8285,9 @@ void DocxAttributeOutput::FormatAnchor( const SwFormatAnchor& ) // Fly frames: anchors here aren't matching the anchors in docx } -static boost::optional lcl_getDmlAlpha(const SvxBrushItem& rBrush) +static o3tl::optional lcl_getDmlAlpha(const SvxBrushItem& rBrush) { - boost::optional oRet; + o3tl::optional oRet; sal_Int32 nTransparency = rBrush.GetColor().GetTransparency(); if (nTransparency) { @@ -8306,7 +8306,7 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) { const Color aColor = rBrush.GetColor(); OString sColor = msfilter::util::ConvertColor( aColor.GetRGBColor() ); - boost::optional oAlpha = lcl_getDmlAlpha(rBrush); + o3tl::optional 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 67561087ceb3..7f3f0e6edb57 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include #include "docxtablestyleexport.hxx" @@ -299,7 +299,7 @@ public: /// The style of the page numbers. /// - virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional& oPageRestartNumber ) override; + virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional& oPageRestartNumber ) override; /// The type of breaking. virtual void SectionType( sal_uInt8 nBreakCode ) override; @@ -932,7 +932,7 @@ private: std::vector lastOpenCell; std::vector lastClosedCell; - boost::optional m_oFillStyle; + o3tl::optional 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 6ffa14325bf5..487ec6bb3052 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.cxx +++ b/sw/source/filter/ww8/docxtablestyleexport.cxx @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include @@ -525,8 +525,8 @@ void DocxTableStyleExport::Impl::tableStyleTablePr( uno::Sequence aTableInd; uno::Sequence aTableBorders; uno::Sequence aTableCellMar; - boost::optional oTableStyleRowBandSize; - boost::optional oTableStyleColBandSize; + o3tl::optional oTableStyleRowBandSize; + o3tl::optional 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 8306c202a311..749613fa7cff 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1292,7 +1292,7 @@ void RtfAttributeOutput::SectionBiDi(bool bBiDi) } void RtfAttributeOutput::SectionPageNumbering( - sal_uInt16 nNumType, const ::boost::optional& oPageRestartNumber) + sal_uInt16 nNumType, const ::o3tl::optional& 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; - boost::optional oWrk; + o3tl::optional 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 4ea8b3845bcd..3003ec585d14 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -30,7 +30,7 @@ #include -#include +#include class SwGrfNode; class SwOLENode; @@ -193,7 +193,7 @@ public: /// The style of the page numbers. /// void SectionPageNumbering(sal_uInt16 nNumType, - const ::boost::optional& oPageRestartNumber) override; + const ::o3tl::optional& oPageRestartNumber) override; /// The type of breaking. void SectionType(sal_uInt8 nBreakCode) override; @@ -610,7 +610,7 @@ private: std::vector> m_aFlyProperties; - boost::optional m_oFillStyle; + o3tl::optional 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 db27ad412270..696172264680 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1385,7 +1385,7 @@ void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirst // numbering type AttrOutput().SectionPageNumbering(m_pCurrentPageDesc->GetNumType().GetNumberingType(), - boost::none); + o3tl::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 ed4f15cde1a6..62262700e885 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1101,7 +1101,7 @@ void MSWordSections::AppendSection( const SwPageDesc* pPd, if (HeaderFooterWritten()) { return; // #i117955# prevent new sections in endnotes } - aSects.emplace_back( pPd, pSectionFormat, nLnNumRestartNo, boost::none, nullptr, bIsFirstParagraph ); + aSects.emplace_back( pPd, pSectionFormat, nLnNumRestartNo, o3tl::nullopt, nullptr, bIsFirstParagraph ); NeedsDocumentProtected( aSects.back() ); } @@ -1422,7 +1422,7 @@ void WW8AttributeOutput::SectionBiDi( bool bBiDi ) m_rWW8Export.pO->push_back( bBiDi? 1: 0 ); } -void WW8AttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional& oPageRestartNumber ) +void WW8AttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional& 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 9824f52b7d84..44bf1870f2c1 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -38,7 +38,7 @@ #include -#include +#include #include #include @@ -179,11 +179,11 @@ struct WW8_SepInfo const SwSectionFormat* pSectionFormat; const SwNode* pPDNd; sal_uLong const nLnNumRestartNo; - ::boost::optional const oPgRestartNo; + ::o3tl::optional const oPgRestartNo; bool const bIsFirstParagraph; WW8_SepInfo( const SwPageDesc* pPD, const SwSectionFormat* pFormat, - sal_uLong nLnRestart, ::boost::optional oPgRestart = boost::none, + sal_uLong nLnRestart, ::o3tl::optional oPgRestart = o3tl::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 7e3f2a31ff20..ead32361bb2d 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 ::boost::optional& oPageRestartNumber ) override; + virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::o3tl::optional& 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 ef7ce5bcd668..bab3f526a9a4 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -986,7 +986,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId ) { - ::boost::optional oNumOffset = rPageDesc.GetNumOffset(); + ::o3tl::optional 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 05dccd0da12a..0150ee3f5674 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -379,7 +379,7 @@ sal_uInt16 AbstractSwBreakDlg_Impl:: GetKind() return m_xDlg->GetKind(); } -::boost::optional AbstractSwBreakDlg_Impl:: GetPageNumber() +::o3tl::optional AbstractSwBreakDlg_Impl:: GetPageNumber() { return m_xDlg->GetPageNumber(); } diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 579fe94562c2..c0e1aeeffde0 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -75,7 +75,7 @@ class SwTOXMark; class SwSplitTableDlg; #include -#include +#include #include namespace sw @@ -183,7 +183,7 @@ public: virtual short Execute() override; virtual OUString GetTemplateName() override; virtual sal_uInt16 GetKind() override; - virtual ::boost::optional GetPageNumber() override; + virtual ::o3tl::optional GetPageNumber() override; }; class AbstractSwTableWidthDlg_Impl : public VclAbstractDialog diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx index b000026ec775..2e4279d0dae7 100644 --- a/sw/source/ui/misc/titlepage.cxx +++ b/sw/source/ui/misc/titlepage.cxx @@ -37,7 +37,7 @@ namespace const SfxPoolItem* pItem(nullptr); if (SfxItemState::SET == aSet.GetItemState( RES_PAGEDESC, true, &pItem ) && pItem) { - ::boost::optional oNumOffset = static_cast(pItem)->GetNumOffset(); + ::o3tl::optional oNumOffset = static_cast(pItem)->GetNumOffset(); if (oNumOffset) rPageNo = *oNumOffset; if (ppPageFormatDesc) @@ -68,7 +68,7 @@ namespace { if (pPageFormatDesc) { - ::boost::optional oNumOffset = pPageFormatDesc->GetNumOffset(); + ::o3tl::optional oNumOffset = pPageFormatDesc->GetNumOffset(); if (oNumOffset) { nPgNo = *oNumOffset; diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 51ccdfbfe83a..821eb68a8f24 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -1326,8 +1326,8 @@ bool SwTextFlowPage::FillItemSet( SfxItemSet* rSet ) } sal_uInt16 nPgNum = static_cast(m_xPageNoNF->get_value()); bool const usePageNo(bState && m_xPageNoCB->get_active()); - boost::optional const oPageNum( - usePageNo ? nPgNum : boost::optional()); + o3tl::optional const oPageNum( + usePageNo ? nPgNum : o3tl::optional()); if (!pDesc || !pDesc->GetPageDesc() || (pDesc->GetPageDesc()->GetName() != sPage) || (pDesc->GetNumOffset() != oPageNum)) @@ -1454,7 +1454,7 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet ) OUString sPageDesc; const SwPageDesc* pDesc = static_cast(pItem)->GetPageDesc(); - ::boost::optional oNumOffset = static_cast(pItem)->GetNumOffset(); + ::o3tl::optional oNumOffset = static_cast(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 1bcd43c41520..23eb98f8d0ec 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -301,7 +301,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) else { OUString sFollowName(pFollow->GetName()); - pSh->InsertPageBreak(&sFollowName, boost::none); + pSh->InsertPageBreak(&sFollowName, o3tl::nullopt); } pSh->SttEndDoc(true); } diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index e50dcbbb2da8..a23ef76299b0 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -329,7 +329,7 @@ void SwPageBreakWin::Activate( ) MenuButton::Activate(); } -void SwPageBreakWin::UpdatePosition(const boost::optional& xEvtPt) +void SwPageBreakWin::UpdatePosition(const o3tl::optional& xEvtPt) { if ( xEvtPt ) { diff --git a/sw/source/uibase/inc/PageBreakWin.hxx b/sw/source/uibase/inc/PageBreakWin.hxx index 9b07dd3ac133..395006103614 100644 --- a/sw/source/uibase/inc/PageBreakWin.hxx +++ b/sw/source/uibase/inc/PageBreakWin.hxx @@ -13,7 +13,7 @@ #include "FrameControl.hxx" #include #include -#include +#include class Menu; class SwPageFrame; @@ -34,7 +34,7 @@ class SwPageBreakWin : public SwFrameMenuButtonBase Timer m_aFadeTimer; bool m_bDestroyed; - boost::optional m_xMousePt; + o3tl::optional 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 boost::optional& xEvtPt = boost::optional()); + void UpdatePosition(const o3tl::optional& xEvtPt = o3tl::optional()); 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 65d129fa0eef..18c5069f6fbb 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 -#include +#include class SwWrtShell; @@ -39,7 +39,7 @@ class SwBreakDlg : public weld::GenericDialogController SwWrtShell &rSh; OUString m_aTemplate; sal_uInt16 nKind; - ::boost::optional oPgNum; + ::o3tl::optional 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 ::boost::optional& GetPageNumber() const { return oPgNum; } + const ::o3tl::optional& GetPageNumber() const { return oPgNum; } }; #endif diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index fb9f9f720bff..acd463ad74ed 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 m_pUserMarker; SdrObject *m_pUserMarkerObj; std::unique_ptr> m_pShadCursor; - boost::optional m_xRowColumnSelectionStart; // save position where table row/column selection has been started + o3tl::optional 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 0fde183fd437..e9a49e71f8f5 100644 --- a/sw/source/uibase/inc/toxmgr.hxx +++ b/sw/source/uibase/inc/toxmgr.hxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include class SwWrtShell; class SwForm; @@ -38,9 +38,9 @@ class SW_DLLPUBLIC SwTOXDescription OUString m_sSequenceName; OUString m_sMainEntryCharStyle; OUString m_sAutoMarkURL; - boost::optional + o3tl::optional m_aTitle; - boost::optional + o3tl::optional m_aTOUName; std::unique_ptr m_pForm; @@ -98,10 +98,10 @@ public: void SetAutoMarkURL(const OUString& rSet) {m_sAutoMarkURL = rSet;} void SetTitle(const OUString& rSet) { m_aTitle = rSet; } - boost::optional const & GetTitle() const {return m_aTitle; } + o3tl::optional const & GetTitle() const {return m_aTitle; } void SetTOUName(const OUString& rSet) { m_aTOUName = rSet; } - boost::optional const & GetTOUName() const { return m_aTOUName; } + o3tl::optional 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; - boost::optional maPrimKey; - boost::optional maSecKey; - boost::optional maAltStr; - boost::optional maTOUName; + o3tl::optional maPrimKey; + o3tl::optional maSecKey; + o3tl::optional maAltStr; + o3tl::optional maTOUName; - boost::optional maPhoneticReadingOfAltStr; - boost::optional maPhoneticReadingOfPrimKey; - boost::optional maPhoneticReadingOfSecKey; + o3tl::optional maPhoneticReadingOfAltStr; + o3tl::optional maPhoneticReadingOfPrimKey; + o3tl::optional 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; } - boost::optional const & GetPrimKey() const { return maPrimKey; } + o3tl::optional const & GetPrimKey() const { return maPrimKey; } void SetSecKey(const OUString& rSet) { maSecKey = rSet; } - boost::optional const & GetSecKey() const { return maSecKey; } + o3tl::optional const & GetSecKey() const { return maSecKey; } void SetAltStr(const OUString& rSet) { maAltStr = rSet; } - boost::optional const & GetAltStr() const { return maAltStr; } + o3tl::optional const & GetAltStr() const { return maAltStr; } void SetTOUName(const OUString& rSet) { maTOUName = rSet; } - boost::optional const & GetTOUName() const { return maTOUName; } + o3tl::optional const & GetTOUName() const { return maTOUName; } void SetPhoneticReadingOfAltStr(const OUString& rSet) { maPhoneticReadingOfAltStr = rSet; } - boost::optional const & GetPhoneticReadingOfAltStr() const { return maPhoneticReadingOfAltStr; } + o3tl::optional const & GetPhoneticReadingOfAltStr() const { return maPhoneticReadingOfAltStr; } void SetPhoneticReadingOfPrimKey(const OUString& rSet) { maPhoneticReadingOfPrimKey = rSet; } - boost::optional const & GetPhoneticReadingOfPrimKey() const { return maPhoneticReadingOfPrimKey; } + o3tl::optional const & GetPhoneticReadingOfPrimKey() const { return maPhoneticReadingOfPrimKey; } void SetPhoneticReadingOfSecKey(const OUString& rSet) { maPhoneticReadingOfSecKey = rSet; } - boost::optional const & GetPhoneticReadingOfSecKey() const { return maPhoneticReadingOfSecKey; } + o3tl::optional 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 6ec17d5b0e78..61c4389da489 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -24,7 +24,7 @@ #include #include #include "navmgr.hxx" -#include +#include #include #include #include @@ -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 ::boost::optional& rPgNum = boost::none); + void InsertPageBreak(const OUString *pPageDesc = nullptr, const ::o3tl::optional& rPgNum = o3tl::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 d6857e8156c1..dce1531b94ef 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -627,7 +627,7 @@ void SwTextShell::Execute(SfxRequest &rReq) case FN_INSERT_BREAK_DLG: { sal_uInt16 nKind=0; - ::boost::optional oPageNumber; + ::o3tl::optional oPageNumber; OUString aTemplateName; if ( pItem ) { diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index 2e97300932b1..a1c95c2407ca 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -310,7 +310,7 @@ void SwView::ExecSearch(SfxRequest& rReq) m_pWrtShell->Push(); OUString aReplace( s_pSrchItem->GetReplaceString() ); i18nutil::SearchOptions2 aTmp( s_pSrchItem->GetSearchOptions() ); - boost::optional xBackRef = sw::ReplaceBackReferences(aTmp, + o3tl::optional 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 9e8434e82466..f5dfd211129d 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -671,7 +671,7 @@ void SwToSfxPageDescAttr( SfxItemSet& rCoreSet ) { const SfxPoolItem* pItem = nullptr; OUString aName; - ::boost::optional oNumOffset; + ::o3tl::optional 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 9eb00d361b9a..432a578d3f81 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -885,7 +885,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 ::boost::optional& oPgNum ) +void SwWrtShell::InsertPageBreak(const OUString *pPageDesc, const ::o3tl::optional& oPgNum ) { ResetCursorStack(); if( CanInsert() ) -- cgit