summaryrefslogtreecommitdiff
path: root/sw/source/core/attr/calbck.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-28 12:19:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-29 12:41:23 +0200
commite4b5aaade285ecad39332ad8b195738feb51151a (patch)
tree90dba973dc0b03b90fc6a7f3f44c0d0b2674370d /sw/source/core/attr/calbck.cxx
parent1df758fce8ac23b54f96f2c0f3dd608bb1da024a (diff)
no need to allocate this hint on the heap
Change-Id: I6321d03cb5786aa0c17705cc8c8bcf1f85326f44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116369 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/attr/calbck.cxx')
-rw-r--r--sw/source/core/attr/calbck.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index a37ee5bef376..3f4253cd2566 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -54,7 +54,6 @@ namespace sw
}
sw::LegacyModifyHint::~LegacyModifyHint() {}
-sw::ModifyChangedHint::~ModifyChangedHint() {}
SwClient::SwClient(SwClient&& o) noexcept
: m_pRegisteredIn(nullptr)
@@ -75,19 +74,19 @@ SwClient::~SwClient()
m_pRegisteredIn->Remove( this );
}
-std::unique_ptr<sw::ModifyChangedHint> SwClient::CheckRegistration( const SfxPoolItem* pOld )
+std::optional<sw::ModifyChangedHint> SwClient::CheckRegistration( const SfxPoolItem* pOld )
{
DBG_TESTSOLARMUTEX();
// this method only handles notification about dying SwModify objects
if( !pOld || pOld->Which() != RES_OBJECTDYING )
- return nullptr;
+ return {};
assert(dynamic_cast<const SwPtrMsgPoolItem*>(pOld));
const SwPtrMsgPoolItem* pDead = static_cast<const SwPtrMsgPoolItem*>(pOld);
if(pDead->pObject != m_pRegisteredIn)
{
// we should only care received death notes from objects we are following
- return nullptr;
+ return {};
}
// I've got a notification from the object I know
SwModify* pAbove = m_pRegisteredIn->GetRegisteredIn();
@@ -102,7 +101,7 @@ std::unique_ptr<sw::ModifyChangedHint> SwClient::CheckRegistration( const SfxPoo
// destroy connection
EndListeningAll();
}
- return std::unique_ptr<sw::ModifyChangedHint>(new sw::ModifyChangedHint(pAbove));
+ return sw::ModifyChangedHint(pAbove);
}
void SwClient::CheckRegistrationFormat(SwFormat& rOld)