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

loplugin:useuniqueptr in SdDrawDocument::InsertBookmarkAsObject

Change-Id: Ib46259a87152a491f6fcad2c8fc5d2aa1f0f9531
Reviewed-on: https://gerrit.libreoffice.org/60337
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e75baaa5
......@@ -978,7 +978,7 @@ bool SdDrawDocument::InsertBookmarkAsObject(
{
bool bOK = true;
bool bOLEObjFound = false;
::sd::View* pBMView = nullptr;
std::unique_ptr<::sd::View> pBMView;
SdDrawDocument* pBookmarkDoc = nullptr;
......@@ -997,7 +997,7 @@ bool SdDrawDocument::InsertBookmarkAsObject(
if (rBookmarkList.empty())
{
pBMView = new ::sd::View(*pBookmarkDoc, nullptr);
pBMView.reset(new ::sd::View(*pBookmarkDoc, nullptr));
pBMView->EndListening(*pBookmarkDoc);
pBMView->MarkAll();
}
......@@ -1024,7 +1024,7 @@ bool SdDrawDocument::InsertBookmarkAsObject(
if (!pBMView)
{
// Create View for the first time
pBMView = new ::sd::View(*pBookmarkDoc, nullptr);
pBMView.reset(new ::sd::View(*pBookmarkDoc, nullptr));
pBMView->EndListening(*pBookmarkDoc);
}
......@@ -1131,8 +1131,6 @@ bool SdDrawDocument::InsertBookmarkAsObject(
}
}
delete pBMView;
return bOK;
}
......
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