summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-21 15:46:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-22 08:57:12 +0200
commit58c6fad213024ef8f162984a66af565ac9ad4b97 (patch)
treebf906919f20c4cb8fe25c8600c4bf0545ae5892e /svx/source
parent505fb3f952106d6fafd300097cce83c2050fbc60 (diff)
tdf#143412 CRASH: converting images
Revert "use unique_ptr in SdrEditView::ImpConvertOneObj" This reverts commit 2ec1dab4693cd45b475f02452114dd96ec0bda1b. I was wrong, we are no returning ownership here. Change-Id: Ib3b3b32248d4b56f0a48c658db5d6431b26fc352 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119335 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/svdraw/svdedtv2.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index edd2c8310fdc..5d29b1b3dc4f 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1975,7 +1975,7 @@ void SdrEditView::UnGroupMarked()
// ConvertToPoly
-SdrObjectUniquePtr SdrEditView::ImpConvertOneObj(SdrObject* pObj, bool bPath, bool bLineToArea)
+SdrObject* SdrEditView::ImpConvertOneObj(SdrObject* pObj, bool bPath, bool bLineToArea)
{
SdrObjectUniquePtr pNewObj = pObj->ConvertToPolyObj(bPath, bLineToArea);
if (pNewObj)
@@ -1985,12 +1985,13 @@ SdrObjectUniquePtr SdrEditView::ImpConvertOneObj(SdrObject* pObj, bool bPath, bo
if( bUndo )
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoReplaceObject(*pObj,*pNewObj));
+ // ownership passed into here (despite the UniquePtr indicating that we are returning it)
pOL->ReplaceObject(pNewObj.get(), pObj->GetOrdNum());
if( !bUndo )
SdrObject::Free(pObj);
}
- return pNewObj;
+ return pNewObj.release();
}
void SdrEditView::ImpConvertTo(bool bPath, bool bLineToArea)
@@ -2034,10 +2035,10 @@ void SdrEditView::ImpConvertTo(bool bPath, bool bLineToArea)
ImpConvertOneObj(pObj,bPath,bLineToArea);
}
} else {
- SdrObjectUniquePtr pNewObj=ImpConvertOneObj(pObj,bPath,bLineToArea);
+ SdrObject* pNewObj=ImpConvertOneObj(pObj,bPath,bLineToArea);
if (pNewObj!=nullptr) {
bMrkChg=true;
- GetMarkedObjectListWriteAccess().ReplaceMark(SdrMark(pNewObj.release(),pPV),nm);
+ GetMarkedObjectListWriteAccess().ReplaceMark(SdrMark(pNewObj,pPV),nm);
}
}
}