From 66438a0ad5a3c6d2792f4c6c04c2d2405b5679cb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 28 May 2021 15:35:25 +0200 Subject: std::unique_ptr->std::optional Change-Id: Ie09ede2ce21c206ca158a5a89d50143cdde45e3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116381 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/inc/undobj.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/inc/undobj.hxx') diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 4eae5cddaf3f..d48db259c77d 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -243,7 +243,7 @@ class SwUndoInsLayFormat; namespace sw { -std::unique_ptr> +std::optional> GetFlysAnchoredAt(SwDoc & rDoc, sal_uLong nSttNode); } @@ -252,7 +252,7 @@ GetFlysAnchoredAt(SwDoc & rDoc, sal_uLong nSttNode); class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveContent { SwTextFormatColl *m_pTextFormatColl, *m_pLastNodeColl; - std::unique_ptr> m_pFrameFormats; + std::optional> m_pFrameFormats; std::vector< std::shared_ptr > m_FlyUndos; std::unique_ptr m_pRedlineData; int m_nDeleteTextNodes; @@ -277,7 +277,7 @@ public: static bool IsCreateUndoForNewFly(SwFormatAnchor const& rAnchor, sal_uLong const nStartNode, sal_uLong const nEndNode); - std::vector * GetFlysAnchoredAt() { return m_pFrameFormats.get(); } + std::vector * GetFlysAnchoredAt() { return m_pFrameFormats ? &*m_pFrameFormats : nullptr; } void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; -- cgit