diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-22 11:02:36 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-23 09:54:16 +0200 |
commit | ba263e124ce263c3c893542062d9c473f5aae589 (patch) | |
tree | 74b99db819c66eb333ab2188df0a65a0b7b8fc2e /svx/source/engine3d/objfac3d.cxx | |
parent | 962719df881a8aefdec7f564293d1e0cd42a5540 (diff) |
clean up the SdrObjFactory create callbacks
passing params by setting fields on yourself is just gross
Change-Id: Iee98a9e8e266b56fc886c76eab470ab1ff7ff8e4
Diffstat (limited to 'svx/source/engine3d/objfac3d.cxx')
-rw-r--r-- | svx/source/engine3d/objfac3d.cxx | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx index 197c77cd3739..63d5264a405f 100644 --- a/svx/source/engine3d/objfac3d.cxx +++ b/svx/source/engine3d/objfac3d.cxx @@ -45,40 +45,34 @@ E3dObjFactory::~E3dObjFactory() // Generate chart internal objects -IMPL_STATIC_LINK_TYPED( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory, void ) +IMPL_STATIC_LINK_TYPED( E3dObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* ) { - if ( pObjFactory->nInventor == E3dInventor ) + if ( aParams.nInventor == E3dInventor ) { - switch ( pObjFactory->nIdentifier ) + switch ( aParams.nObjIdentifier ) { case E3D_POLYSCENE_ID: - pObjFactory->pNewObj = new E3dPolyScene(); - break; + return new E3dPolyScene(); case E3D_POLYGONOBJ_ID : - pObjFactory->pNewObj = new E3dPolygonObj(); - break; + return new E3dPolygonObj(); case E3D_CUBEOBJ_ID : - pObjFactory->pNewObj = new E3dCubeObj(); - break; + return new E3dCubeObj(); case E3D_SPHEREOBJ_ID: // Gets the dummy constructor, as this is only called when // loading documents. The actual number of segments is however // determined only after loading the members. This will result // in that the first sphere will be immediately destroyed, // although it was never used. - pObjFactory->pNewObj = new E3dSphereObj(123); - break; + return new E3dSphereObj(123); case E3D_EXTRUDEOBJ_ID: - pObjFactory->pNewObj = new E3dExtrudeObj(); - break; + return new E3dExtrudeObj(); case E3D_LATHEOBJ_ID: - pObjFactory->pNewObj = new E3dLatheObj(); - break; + return new E3dLatheObj(); case E3D_COMPOUNDOBJ_ID: - pObjFactory->pNewObj = new E3dCompoundObject(); - break; + return new E3dCompoundObject(); } } + return nullptr; } |