diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-28 15:35:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-29 19:23:44 +0200 |
commit | 66438a0ad5a3c6d2792f4c6c04c2d2405b5679cb (patch) | |
tree | 29eb826ce08a4e4f691b8306d9af968396e7b56c /sw/inc/undobj.hxx | |
parent | 397ba047c941eb7d77a15a8de72e20ace4744da1 (diff) |
std::unique_ptr->std::optional
Change-Id: Ie09ede2ce21c206ca158a5a89d50143cdde45e3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116381
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc/undobj.hxx')
-rw-r--r-- | sw/inc/undobj.hxx | 6 |
1 files changed, 3 insertions, 3 deletions
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::vector<SwFrameFormat*>> +std::optional<std::vector<SwFrameFormat*>> 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<std::vector<SwFrameFormat*>> m_pFrameFormats; + std::optional<std::vector<SwFrameFormat*>> m_pFrameFormats; std::vector< std::shared_ptr<SwUndoInsLayFormat> > m_FlyUndos; std::unique_ptr<SwRedlineData> 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<SwFrameFormat*> * GetFlysAnchoredAt() { return m_pFrameFormats.get(); } + std::vector<SwFrameFormat*> * GetFlysAnchoredAt() { return m_pFrameFormats ? &*m_pFrameFormats : nullptr; } void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; |