summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-28 15:57:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-30 09:08:31 +0200
commitc78fa391c99885492d50de12b7a6b5912229061f (patch)
treeeb0ff467a7ac1ff18105703093c75e9471cc0bdd /sw/source/core
parente98b0891d6e0f1d6be4e4a4761bd1ab16bfab85c (diff)
std::unique_ptr->std::optional
Change-Id: I7a10e9bf14d45d1fe958dc33fe96ebb8318b3bec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116393 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/docnode/node.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 809ecd349c81..3b0245969246 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -347,7 +347,7 @@ SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const SwNodeType nNdType )
SwNode::~SwNode()
{
- assert(!m_pAnchoredFlys || GetDoc().IsInDtor()); // must all be deleted
+ assert(!m_xAnchoredFlys || GetDoc().IsInDtor()); // must all be deleted
InvalidateInSwCache(RES_OBJECTDYING);
assert(!IsInCache());
}
@@ -2119,11 +2119,11 @@ void SwNode::AddAnchoredFly(SwFrameFormat *const pFlyFormat)
assert(&pFlyFormat->GetAnchor(false).GetContentAnchor()->nNode.GetNode() == this);
// check node type, cf. SwFormatAnchor::SetAnchor()
assert(IsTextNode() || IsStartNode() || IsTableNode());
- if (!m_pAnchoredFlys)
+ if (!m_xAnchoredFlys)
{
- m_pAnchoredFlys.reset(new std::vector<SwFrameFormat*>);
+ m_xAnchoredFlys.emplace();
}
- m_pAnchoredFlys->push_back(pFlyFormat);
+ m_xAnchoredFlys->push_back(pFlyFormat);
}
void SwNode::RemoveAnchoredFly(SwFrameFormat *const pFlyFormat)
@@ -2132,13 +2132,13 @@ void SwNode::RemoveAnchoredFly(SwFrameFormat *const pFlyFormat)
// cannot assert this in Remove because it is called when new anchor is already set
// assert(&pFlyFormat->GetAnchor(false).GetContentAnchor()->nNode.GetNode() == this);
assert(IsTextNode() || IsStartNode() || IsTableNode());
- assert(m_pAnchoredFlys);
- auto it(std::find(m_pAnchoredFlys->begin(), m_pAnchoredFlys->end(), pFlyFormat));
- assert(it != m_pAnchoredFlys->end());
- m_pAnchoredFlys->erase(it);
- if (m_pAnchoredFlys->empty())
+ assert(m_xAnchoredFlys);
+ auto it(std::find(m_xAnchoredFlys->begin(), m_xAnchoredFlys->end(), pFlyFormat));
+ assert(it != m_xAnchoredFlys->end());
+ m_xAnchoredFlys->erase(it);
+ if (m_xAnchoredFlys->empty())
{
- m_pAnchoredFlys.reset();
+ m_xAnchoredFlys.reset();
}
}