diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-21 07:51:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-01 08:26:24 +0200 |
commit | ed8152b1ed9baf859966fd21d6641dfba9c4467c (patch) | |
tree | b4f7b372433c5da3b8df41d026ff95fecece9ce6 /lotuswordpro | |
parent | 6cb9b06432434fb3257118743780828b3b57326a (diff) |
improve loplugin:makeshared
to find places where we are converting stuff to unique_ptr
instead of using std::make_shared.
As a bonus, this tends to find places where we are using shared_ptr
where we can instead be using unique_ptr avoiding the locking overhead.
Change-Id: I1b57bbc4a6c766b48bba8e25a55161800e149f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93207
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpbulletstylemgr.cxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpbulletstylemgr.hxx | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx index ec3335766a19..6f5b638c8fea 100644 --- a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx +++ b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx @@ -126,7 +126,7 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, const LwpBulletO } LwpObjectID aBulletID = pBullOver->GetSilverBullet(); - std::shared_ptr<LwpBulletOverride> pBulletOver(pBullOver->clone()); + std::unique_ptr<LwpBulletOverride> pBulletOver(pBullOver->clone()); sal_uInt16 nNameIndex = 0; for (auto const& vIDsPair : m_vIDsPairList) @@ -142,7 +142,7 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, const LwpBulletO } } - m_vIDsPairList.emplace_back(pBulletOver, aIndentID); + m_vIDsPairList.emplace_back(std::move(pBulletOver), aIndentID); OUString aStyleName; LwpFribPtr& rBulletParaFribs = pBulletPara->GetFribs(); diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.hxx b/lotuswordpro/source/filter/lwpbulletstylemgr.hxx index 7a7e0a57c5f3..c4dd9d6c3be1 100644 --- a/lotuswordpro/source/filter/lwpbulletstylemgr.hxx +++ b/lotuswordpro/source/filter/lwpbulletstylemgr.hxx @@ -88,7 +88,7 @@ public: inline void SetCurrentSilverBullet(const LwpObjectID& rNewID); private: - typedef std::pair<std::shared_ptr<LwpBulletOverride>, LwpObjectID> OverridePair; + typedef std::pair<std::unique_ptr<LwpBulletOverride>, LwpObjectID> OverridePair; std::vector <OUString> m_vStyleNameList; std::vector <OverridePair> m_vIDsPairList; LwpFoundry* m_pFoundry; |