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/form | |
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/form')
-rw-r--r-- | svx/source/form/fmobjfac.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx index ded879ab6d73..84733dcfd42d 100644 --- a/svx/source/form/fmobjfac.cxx +++ b/svx/source/form/fmobjfac.cxx @@ -109,16 +109,17 @@ namespace } IMPL_STATIC_LINK_TYPED( - FmFormObjFactory, MakeObject, SdrObjFactory*, pObjFactory, void) + FmFormObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject*) { - if (pObjFactory->nInventor == FmFormInventor) + SdrObject* pNewObj = nullptr; + if (aParams.nInventor == FmFormInventor) { OUString sServiceSpecifier; typedef ::std::vector< ::std::pair< OUString, Any > > PropertyValueArray; PropertyValueArray aInitialProperties; - switch ( pObjFactory->nIdentifier ) + switch ( aParams.nObjIdentifier ) { case OBJ_FM_EDIT: sServiceSpecifier = FM_COMPONENT_EDIT; @@ -214,9 +215,9 @@ IMPL_STATIC_LINK_TYPED( // create the actual object if ( !sServiceSpecifier.isEmpty() ) - pObjFactory->pNewObj = new FmFormObj(sServiceSpecifier); + pNewObj = new FmFormObj(sServiceSpecifier); else - pObjFactory->pNewObj = new FmFormObj(); + pNewObj = new FmFormObj(); // initialize some properties which we want to differ from the defaults for ( PropertyValueArray::const_iterator aInitProp = aInitialProperties.begin(); @@ -225,12 +226,13 @@ IMPL_STATIC_LINK_TYPED( ) { lcl_initProperty( - static_cast< FmFormObj* >( pObjFactory->pNewObj ), + static_cast< FmFormObj* >( pNewObj ), aInitProp->first, aInitProp->second ); } } + return pNewObj; } |