[Libreoffice-commits] core.git: sd/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Sep 12 06:57:24 UTC 2018
sd/source/core/drawdoc3.cxx | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
New commits:
commit ce47f6dade0802d61b298e9490605894d94f6762
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Sep 10 11:05:49 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 12 08:56:58 2018 +0200
loplugin:useuniqueptr in SdDrawDocument::InsertBookmarkAsObject
Change-Id: Ib46259a87152a491f6fcad2c8fc5d2aa1f0f9531
Reviewed-on: https://gerrit.libreoffice.org/60337
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 557e836bf39c..74373005298a 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -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;
}
More information about the Libreoffice-commits
mailing list