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

loplugin:useuniqueptr in XMLRedlineExport

Change-Id: I337b6c068e28a5cf69d9c0b6a30b480834d8a227
Reviewed-on: https://gerrit.libreoffice.org/57513
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 026e2623
......@@ -71,12 +71,6 @@ XMLRedlineExport::XMLRedlineExport(SvXMLExport& rExp)
XMLRedlineExport::~XMLRedlineExport()
{
// delete changes lists
for (auto const& change : aChangeMap)
{
delete change.second;
}
aChangeMap.clear();
}
......@@ -129,7 +123,7 @@ void XMLRedlineExport::ExportChangesList(
ChangesMapType::iterator aFind = aChangeMap.find(rText);
if (aFind != aChangeMap.end())
{
ChangesVectorType* pChangesList = aFind->second;
ChangesVectorType* pChangesList = aFind->second.get();
// export only if changes are found
if (pChangesList->size() > 0)
......@@ -160,11 +154,11 @@ void XMLRedlineExport::SetCurrentXText(
if (aIter == aChangeMap.end())
{
ChangesVectorType* pList = new ChangesVectorType;
aChangeMap[rText] = pList;
aChangeMap[rText].reset( pList );
pCurrentChangesList = pList;
}
else
pCurrentChangesList = aIter->second;
pCurrentChangesList = aIter->second.get();
}
else
{
......
......@@ -25,6 +25,7 @@
#include <com/sun/star/uno/Sequence.h>
#include <vector>
#include <memory>
#include <map>
class SvXMLExport;
......@@ -43,7 +44,7 @@ typedef ::std::vector<
// store a list of redline properties for each XText
typedef ::std::map<
css::uno::Reference< css::text::XText>,
ChangesVectorType* > ChangesMapType;
std::unique_ptr<ChangesVectorType> > ChangesMapType;
/**
......
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