Kaydet (Commit) 864f89e9 authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Noel Grandin

Related tdf#111892: use unique_ptr

Change-Id: I8de0704cae36805737033c38950ac45be13198da
Reviewed-on: https://gerrit.libreoffice.org/41650Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c6df07f9
......@@ -115,7 +115,6 @@ class TemplateScanner::FolderDescriptorList
TemplateScanner::TemplateScanner()
: meState(INITIALIZE_SCANNING),
maFolderContent(),
maFolderList(),
mpFolderDescriptors(new FolderDescriptorList),
mxTemplateRoot(),
mxFolderEnvironment(),
......@@ -195,7 +194,7 @@ TemplateScanner::State TemplateScanner::ScanEntry()
|| (sContentType == "Impress 2.0"))
{
OUString sLocalisedTitle = SfxDocumentTemplates::ConvertResourceString(sTitle);
mpTemplateEntries.push_back(new TemplateEntry(sLocalisedTitle, sTargetURL));
mpTemplateEntries.push_back(o3tl::make_unique<TemplateEntry>(sLocalisedTitle, sTargetURL));
}
}
......@@ -204,12 +203,6 @@ TemplateScanner::State TemplateScanner::ScanEntry()
}
else
{
if (!mpTemplateEntries.empty())
{
SolarMutexGuard aGuard;
maFolderList.push_back(mpTemplateEntries);
}
// Continue with scanning the next folder.
eNextState = SCAN_FOLDER;
}
......
......@@ -24,6 +24,7 @@
#include "sddllapi.h"
#include <ucbhelper/content.hxx>
#include "com/sun/star/uno/Reference.hxx"
#include <o3tl/make_unique.hxx>
#include <memory>
#include <vector>
......@@ -93,7 +94,7 @@ public:
<nullptr/> is returned either before the template scanning is
started or after it has ended.
*/
const TemplateEntry* GetLastAddedEntry() const { return mpTemplateEntries.empty()?nullptr:mpTemplateEntries.back();}
const TemplateEntry* GetLastAddedEntry() const { return mpTemplateEntries.empty()?nullptr:mpTemplateEntries.back().get();}
private:
/** The current state determines which step will be executed next by
......@@ -112,12 +113,7 @@ private:
State meState;
::ucbhelper::Content maFolderContent;
::std::vector<TemplateEntry*> mpTemplateEntries;
/** The data structure that is to be filled with information about the
template files.
*/
std::vector< ::std::vector<TemplateEntry*> > maFolderList;
::std::vector< std::unique_ptr<TemplateEntry> > mpTemplateEntries;
/** The folders that are collected by GatherFolderList().
*/
......
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