diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-08-08 15:31:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-10 10:50:32 +0200 |
commit | 77a8d0d06573cd095863904d34dc7a0ca131cf1a (patch) | |
tree | 824878efdb789fa19a0f33b4284a93e89e50c1a5 /sw/inc | |
parent | 17073362f47425996575cefb682383f2710d3436 (diff) |
unique_ptr->optional in SwFormatContent
Change-Id: I815fa0f2dcdc1512958d95703b56449010fd2f6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138075
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/fmtcntnt.hxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/inc/fmtcntnt.hxx b/sw/inc/fmtcntnt.hxx index f579dd1c1676..3765e0a2e4a0 100644 --- a/sw/inc/fmtcntnt.hxx +++ b/sw/inc/fmtcntnt.hxx @@ -23,14 +23,14 @@ #include <svl/poolitem.hxx> #include "hintids.hxx" #include "format.hxx" +#include "ndindex.hxx" -class SwNodeIndex; class SwStartNode; /// Content, content of frame (header, footer, fly). class SAL_DLLPUBLIC_RTTI SwFormatContent final : public SfxPoolItem { - std::unique_ptr<SwNodeIndex> m_pStartNode; + std::optional<SwNodeIndex> m_oStartNode; SwFormatContent &operator=( const SwFormatContent & ) = delete; @@ -43,7 +43,7 @@ public: virtual bool operator==( const SfxPoolItem& ) const override; virtual SwFormatContent* Clone( SfxItemPool* pPool = nullptr ) const override; - const SwNodeIndex *GetContentIdx() const { return m_pStartNode.get(); } + const SwNodeIndex *GetContentIdx() const { return m_oStartNode ? &*m_oStartNode : nullptr; } void SetNewContentIdx( const SwNodeIndex *pIdx ); void dumpAsXml(xmlTextWriterPtr pWriter) const override; |