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

return by unique_ptr from E3dObject::GetBreakObj

Change-Id: Id983695650b13b2cb7881ce17a186e35fbb480ef
Reviewed-on: https://gerrit.libreoffice.org/61441
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 69c9a077
...@@ -102,7 +102,7 @@ public: ...@@ -102,7 +102,7 @@ public:
const basegfx::B2DPolyPolygon &GetExtrudePolygon() const { return maExtrudePolygon; } const basegfx::B2DPolyPolygon &GetExtrudePolygon() const { return maExtrudePolygon; }
virtual bool IsBreakObjPossible() override; virtual bool IsBreakObjPossible() override;
virtual SdrAttrObj* GetBreakObj() override; virtual std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> GetBreakObj() override;
}; };
#endif // INCLUDED_SVX_EXTRUD3D_HXX #endif // INCLUDED_SVX_EXTRUD3D_HXX
......
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
// break up // break up
virtual bool IsBreakObjPossible() override; virtual bool IsBreakObjPossible() override;
virtual SdrAttrObj* GetBreakObj() override; virtual std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> GetBreakObj() override;
}; };
#endif // INCLUDED_SVX_LATHE3D_HXX #endif // INCLUDED_SVX_LATHE3D_HXX
......
...@@ -150,7 +150,7 @@ public: ...@@ -150,7 +150,7 @@ public:
// break up // break up
virtual bool IsBreakObjPossible(); virtual bool IsBreakObjPossible();
virtual SdrAttrObj* GetBreakObj(); virtual std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> GetBreakObj();
}; };
/************************************************************************* /*************************************************************************
......
...@@ -159,7 +159,7 @@ bool E3dExtrudeObj::IsBreakObjPossible() ...@@ -159,7 +159,7 @@ bool E3dExtrudeObj::IsBreakObjPossible()
return true; return true;
} }
SdrAttrObj* E3dExtrudeObj::GetBreakObj() std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> E3dExtrudeObj::GetBreakObj()
{ {
basegfx::B3DPolyPolygon aFrontSide; basegfx::B3DPolyPolygon aFrontSide;
basegfx::B3DPolyPolygon aBackSide; basegfx::B3DPolyPolygon aBackSide;
...@@ -210,13 +210,13 @@ SdrAttrObj* E3dExtrudeObj::GetBreakObj() ...@@ -210,13 +210,13 @@ SdrAttrObj* E3dExtrudeObj::GetBreakObj()
{ {
// create PathObj // create PathObj
basegfx::B2DPolyPolygon aPoly = TransformToScreenCoor(aBackSide); basegfx::B2DPolyPolygon aPoly = TransformToScreenCoor(aBackSide);
SdrPathObj* pPathObj = new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aPoly); std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aPoly));
SfxItemSet aSet(GetObjectItemSet()); SfxItemSet aSet(GetObjectItemSet());
aSet.Put(XLineStyleItem(css::drawing::LineStyle_SOLID)); aSet.Put(XLineStyleItem(css::drawing::LineStyle_SOLID));
pPathObj->SetMergedItemSet(aSet); pPathObj->SetMergedItemSet(aSet);
return pPathObj; return std::unique_ptr<SdrAttrObj,SdrObjectFreeOp>(pPathObj.release());
} }
return nullptr; return nullptr;
......
...@@ -187,12 +187,12 @@ bool E3dLatheObj::IsBreakObjPossible() ...@@ -187,12 +187,12 @@ bool E3dLatheObj::IsBreakObjPossible()
return true; return true;
} }
SdrAttrObj* E3dLatheObj::GetBreakObj() std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> E3dLatheObj::GetBreakObj()
{ {
// create PathObj // create PathObj
basegfx::B3DPolyPolygon aLathePoly3D(basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon(maPolyPoly2D)); basegfx::B3DPolyPolygon aLathePoly3D(basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon(maPolyPoly2D));
basegfx::B2DPolyPolygon aTransPoly(TransformToScreenCoor(aLathePoly3D)); basegfx::B2DPolyPolygon aTransPoly(TransformToScreenCoor(aLathePoly3D));
SdrPathObj* pPathObj = new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aTransPoly); std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aTransPoly));
// Set Attribute // Set Attribute
SfxItemSet aSet(GetObjectItemSet()); SfxItemSet aSet(GetObjectItemSet());
...@@ -202,7 +202,7 @@ SdrAttrObj* E3dLatheObj::GetBreakObj() ...@@ -202,7 +202,7 @@ SdrAttrObj* E3dLatheObj::GetBreakObj()
pPathObj->SetMergedItemSet(aSet); pPathObj->SetMergedItemSet(aSet);
return pPathObj; return std::unique_ptr<SdrAttrObj,SdrObjectFreeOp>(pPathObj.release());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -114,7 +114,7 @@ bool E3dObject::IsBreakObjPossible() ...@@ -114,7 +114,7 @@ bool E3dObject::IsBreakObjPossible()
return false; return false;
} }
SdrAttrObj* E3dObject::GetBreakObj() std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> E3dObject::GetBreakObj()
{ {
return nullptr; return nullptr;
} }
......
...@@ -1577,7 +1577,7 @@ void E3dView::BreakSingle3DObj(E3dObject* pObj) ...@@ -1577,7 +1577,7 @@ void E3dView::BreakSingle3DObj(E3dObject* pObj)
} }
else else
{ {
SdrAttrObj* pNewObj = pObj->GetBreakObj(); SdrAttrObj* pNewObj = pObj->GetBreakObj().release();
if(pNewObj) if(pNewObj)
{ {
InsertObjectAtView(pNewObj, *GetSdrPageView(), SdrInsertFlags::DONTMARK); InsertObjectAtView(pNewObj, *GetSdrPageView(), SdrInsertFlags::DONTMARK);
......
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