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 /sc | |
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 'sc')
-rw-r--r-- | sc/inc/userdat.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/userdat.cxx | 22 |
2 files changed, 11 insertions, 13 deletions
diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx index bed2070d7ea4..dd063be5ac3f 100644 --- a/sc/inc/userdat.hxx +++ b/sc/inc/userdat.hxx @@ -35,7 +35,7 @@ class ScDrawObjFactory { - DECL_STATIC_LINK_TYPED( ScDrawObjFactory, MakeUserData, SdrObjFactory *, void ); + DECL_STATIC_LINK_TYPED( ScDrawObjFactory, MakeUserData, SdrObjUserDataCreatorParams, SdrObjUserData* ); public: ScDrawObjFactory(); ~ScDrawObjFactory(); diff --git a/sc/source/core/data/userdat.cxx b/sc/source/core/data/userdat.cxx index f06d2201facc..3d02e082dd31 100644 --- a/sc/source/core/data/userdat.cxx +++ b/sc/source/core/data/userdat.cxx @@ -32,21 +32,19 @@ ScDrawObjFactory::~ScDrawObjFactory() } IMPL_STATIC_LINK_TYPED( - ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory, void ) + ScDrawObjFactory, MakeUserData, SdrObjUserDataCreatorParams, aParams, SdrObjUserData* ) { - if ( pObjFactory->nInventor == SC_DRAWLAYER ) + if ( aParams.nInventor == SC_DRAWLAYER ) { - if ( pObjFactory->nIdentifier == SC_UD_OBJDATA ) - pObjFactory->pNewData = new ScDrawObjData; - else if ( pObjFactory->nIdentifier == SC_UD_IMAPDATA ) - pObjFactory->pNewData = new ScIMapInfo; - else if ( pObjFactory->nIdentifier == SC_UD_MACRODATA ) - pObjFactory->pNewData = new ScMacroInfo; - else - { - OSL_FAIL("MakeUserData: wrong ID"); - } + if ( aParams.nObjIdentifier == SC_UD_OBJDATA ) + return new ScDrawObjData; + else if ( aParams.nObjIdentifier == SC_UD_IMAPDATA ) + return new ScIMapInfo; + else if ( aParams.nObjIdentifier == SC_UD_MACRODATA ) + return new ScMacroInfo; + OSL_FAIL("MakeUserData: wrong ID"); } + return nullptr; } ScDrawObjData::ScDrawObjData() : |