diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-16 14:13:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-17 11:31:40 +0000 |
commit | 70fed865df7655a7ee65fa6cde51bbf93182dbbb (patch) | |
tree | 00c77d8ba47be246cd247697045fdcfe6df3ad9e /formula | |
parent | cid#1398822: java.util.Properties.getProperty already returns String (diff) | |
download | core-70fed865df7655a7ee65fa6cde51bbf93182dbbb.tar.gz core-70fed865df7655a7ee65fa6cde51bbf93182dbbb.zip |
new loplugin: useuniqueptr: forms..framework
Change-Id: I4300a13f455148b7156ac3f444c7102d63ae6db3
Reviewed-on: https://gerrit.libreoffice.org/33164
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/core/api/token.cxx | 5 | ||||
-rw-r--r-- | formula/source/ui/resource/ModuleHelper.cxx | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index f910d7163c35..45031ef42ad9 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -365,18 +365,17 @@ bool FormulaFAPToken::operator==( const FormulaToken& r ) const } -short* FormulaJumpToken::GetJump() const { return pJump; } +short* FormulaJumpToken::GetJump() const { return pJump.get(); } bool FormulaJumpToken::IsInForceArray() const { return bIsInForceArray; } void FormulaJumpToken::SetInForceArray( bool b ) { bIsInForceArray = b; } bool FormulaJumpToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && pJump[0] == r.GetJump()[0] && - memcmp( pJump+1, r.GetJump()+1, pJump[0] * sizeof(short) ) == 0 && + memcmp( pJump.get()+1, r.GetJump()+1, pJump[0] * sizeof(short) ) == 0 && bIsInForceArray == r.IsInForceArray(); } FormulaJumpToken::~FormulaJumpToken() { - delete [] pJump; } diff --git a/formula/source/ui/resource/ModuleHelper.cxx b/formula/source/ui/resource/ModuleHelper.cxx index de87fa8af07a..97fbf86a9534 100644 --- a/formula/source/ui/resource/ModuleHelper.cxx +++ b/formula/source/ui/resource/ModuleHelper.cxx @@ -43,7 +43,7 @@ namespace formula */ class OModuleImpl { - ResMgr* m_pResources; + std::unique_ptr<ResMgr> m_pResources; public: /// ctor @@ -55,14 +55,12 @@ public: }; OModuleImpl::OModuleImpl() - :m_pResources(nullptr) { } OModuleImpl::~OModuleImpl() { - delete m_pResources; } @@ -73,9 +71,9 @@ ResMgr* OModuleImpl::getResManager() if (!m_pResources) { // create a manager with a fixed prefix - m_pResources = ResMgr::CreateResMgr("forui"); + m_pResources.reset( ResMgr::CreateResMgr("forui") ); } - return m_pResources; + return m_pResources.get(); } |