summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-22 11:02:36 +0200
committerNoel Grandin <noel@peralex.com>2016-08-23 09:54:16 +0200
commitba263e124ce263c3c893542062d9c473f5aae589 (patch)
tree74b99db819c66eb333ab2188df0a65a0b7b8fc2e /sc/source
parent962719df881a8aefdec7f564293d1e0cd42a5540 (diff)
clean up the SdrObjFactory create callbacks
passing params by setting fields on yourself is just gross Change-Id: Iee98a9e8e266b56fc886c76eab470ab1ff7ff8e4
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/userdat.cxx22
1 files changed, 10 insertions, 12 deletions
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() :