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

loplugin:useuniqueptr in XFIndex

but actually this object should be held by rtl::Reference

Change-Id: Iabf068bd909201af5df6f987c6dcdb64679fefbd
Reviewed-on: https://gerrit.libreoffice.org/60970
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6cc5c6de
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include <xfilter/xfcontent.hxx> #include <xfilter/xfcontent.hxx>
#include <xfilter/xfcontentcontainer.hxx> #include <xfilter/xfcontentcontainer.hxx>
#include <xfilter/xftabstop.hxx> #include <xfilter/xftabstop.hxx>
#include <rtl/ref.hxx>
class XFIndex; class XFIndex;
class XFIndexTemplate; class XFIndexTemplate;
...@@ -168,7 +169,7 @@ private: ...@@ -168,7 +169,7 @@ private:
bool m_bProtect; bool m_bProtect;
bool m_bSeparator; bool m_bSeparator;
std::vector<XFIndexTemplate *> m_aTemplates; // template entry + style std::vector<rtl::Reference<XFIndexTemplate>> m_aTemplates; // template entry + style
#define MAX_TOC_LEVEL 10 #define MAX_TOC_LEVEL 10
std::vector<OUString> m_aTOCSource[MAX_TOC_LEVEL+1]; std::vector<OUString> m_aTOCSource[MAX_TOC_LEVEL+1];
......
...@@ -68,12 +68,6 @@ XFIndex::XFIndex() ...@@ -68,12 +68,6 @@ XFIndex::XFIndex()
XFIndex::~XFIndex() XFIndex::~XFIndex()
{ {
while(m_aTemplates.size()>0)
{
XFIndexTemplate * pTemplate = m_aTemplates.back();
m_aTemplates.pop_back();
delete pTemplate;
}
} }
void XFIndex::AddTemplate(const OUString& level, const OUString& style, XFIndexTemplate* templ) void XFIndex::AddTemplate(const OUString& level, const OUString& style, XFIndexTemplate* templ)
......
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