Kaydet (Commit) 37464a0f authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in idlc

Change-Id: Iccc50462ca115546422824b6814abf16a029f005
Reviewed-on: https://gerrit.libreoffice.org/47793Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 9acf3da7
......@@ -29,11 +29,6 @@ public:
, m_pMemberType(pMemberType)
, m_pRelativName(nullptr)
{}
virtual ~AstSequence() override
{
if ( m_pRelativName )
delete m_pRelativName;
}
AstType const * getMemberType() const
{ return m_pMemberType; }
......@@ -44,7 +39,7 @@ public:
virtual const sal_Char* getRelativName() const override;
private:
AstType const * m_pMemberType;
mutable OString* m_pRelativName;
mutable std::unique_ptr<OString> m_pRelativName;
};
#endif // INCLUDED_IDLC_INC_ASTSEQUENCE_HXX
......
......@@ -46,16 +46,10 @@ public:
NodeType nodeType, OString* pName, OString const * pInherits,
std::vector< OString > const * typeParameters);
~FeInheritanceHeader()
{
if ( m_pName )
delete m_pName;
}
NodeType getNodeType() const
{ return m_nodeType; }
OString* getName()
{ return m_pName; }
{ return m_pName.get(); }
AstDeclaration* getInherits()
{ return m_pInherits; }
......@@ -66,7 +60,7 @@ private:
void initializeInherits(OString const * pinherits);
NodeType m_nodeType;
OString* m_pName;
std::unique_ptr<OString> m_pName;
AstDeclaration* m_pInherits;
std::vector< OString > m_typeParameters;
};
......
......@@ -411,7 +411,7 @@ const sal_Char* AstSequence::getRelativName() const
{
if ( !m_pRelativName )
{
m_pRelativName = new OString("[]");
m_pRelativName.reset( new OString("[]") );
AstDeclaration const * pType = resolveTypedefs( m_pMemberType );
*m_pRelativName += pType->getRelativName();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment