summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-05 13:39:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-08 08:02:49 +0200
commit69c9a077b3052fc012d2f23c00dfcc901c65583d (patch)
treef32c8450de92f8a62d3d38716aaa82d92a6246c6 /sd/source/ui/view
parent94bf82a8ceba41c32cf3620529e6ce8ea94f18c0 (diff)
return by unique_ptr from CreateDefaultObject in sd/
Change-Id: I6e103ef4b858ceb0d350069f523cb3cb670fe95b Reviewed-on: https://gerrit.libreoffice.org/61440 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r--sd/source/ui/view/drviewse.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 61e8572cbaa5..ca96961b0fcb 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -615,12 +615,13 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
if(pPageView)
{
// create the default object
- SdrObject* pObj = GetCurrentFunction()->CreateDefaultObject(nSId, aNewObjectRectangle);
+ SdrObjectUniquePtr pObj = GetCurrentFunction()->CreateDefaultObject(nSId, aNewObjectRectangle);
if(pObj)
{
+ auto pObjTmp = pObj.get();
// insert into page
- GetView()->InsertObjectAtView(pObj, *pPageView);
+ GetView()->InsertObjectAtView(pObj.release(), *pPageView);
// Now that pFuActual has done what it was created for we
// can switch on the edit mode for callout objects.
@@ -635,7 +636,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
ExecuteList(SID_TEXTEDIT, SfxCallMode::SYNCHRON |
SfxCallMode::RECORD, { &aItem });
// Put text object into edit mode.
- GetView()->SdrBeginTextEdit(static_cast<SdrTextObj*>(pObj), pPageView);
+ GetView()->SdrBeginTextEdit(static_cast<SdrTextObj*>(pObjTmp), pPageView);
break;
}
}