loplugin:useuniqueptr in BasicCodeTagger
Change-Id: I85b7d5b3030d4b3ec5318e4ee6793927c1f16355 Reviewed-on: https://gerrit.libreoffice.org/47835 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
215254415f
commit
a2f86708a5
@ -14,6 +14,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parser.h>
|
||||
@ -30,7 +31,7 @@ class L10N_DLLPUBLIC BasicCodeTagger
|
||||
private:
|
||||
xmlDocPtr m_pDocument;
|
||||
std::vector<xmlNodePtr> m_BasicCodeContainerTags;
|
||||
LibXmlTreeWalker *m_pXmlTreeWalker;
|
||||
std::unique_ptr<LibXmlTreeWalker> m_pXmlTreeWalker;
|
||||
SyntaxHighlighter m_Highlighter;
|
||||
bool m_bTaggingCompleted;
|
||||
void tagParagraph( xmlNodePtr paragraph );
|
||||
|
@ -62,8 +62,6 @@ BasicCodeTagger::BasicCodeTagger( xmlDocPtr rootDoc ):
|
||||
|
||||
BasicCodeTagger::~BasicCodeTagger()
|
||||
{
|
||||
if ( m_pXmlTreeWalker != nullptr )
|
||||
delete m_pXmlTreeWalker;
|
||||
}
|
||||
//!Gathers all the <bascode> tag nodes from xml tree.
|
||||
/*!
|
||||
@ -75,9 +73,7 @@ void BasicCodeTagger::getBasicCodeContainerNodes()
|
||||
|
||||
m_BasicCodeContainerTags.clear();
|
||||
|
||||
if ( m_pXmlTreeWalker != nullptr )
|
||||
delete m_pXmlTreeWalker;
|
||||
m_pXmlTreeWalker = new LibXmlTreeWalker( m_pDocument );
|
||||
m_pXmlTreeWalker.reset(new LibXmlTreeWalker( m_pDocument ));
|
||||
|
||||
currentNode = m_pXmlTreeWalker->currentNode();
|
||||
if ( !( xmlStrcmp( currentNode->name, reinterpret_cast<const xmlChar*>("bascode") ) ) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user