diff options
author | Noel Power <noel.power@novell.com> | 2012-07-06 11:11:55 +0100 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2012-07-06 11:14:00 +0100 |
commit | 60465d0608930500b35127c47946a9908354d7f4 (patch) | |
tree | 0bc4915712262f43e23025784e00214c00c2ca09 | |
parent | b8c5f6577911ebb15ad7eb7f60ad5bb9d8d37f0b (diff) |
fix dialog editor crasher fdo#51269
missing clone of AllDialogChildren property was the culprit here.
Change-Id: I6c5ee105003967429d5bf79639ae75fb7d90562a
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 41633b5a5050..51c05108b041 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -186,6 +186,19 @@ UnoControlDialogModel::UnoControlDialogModel( const Reference< XMultiServiceFact UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel ) : ControlModelContainerBase( rModel ) { + // need to clone BASEPROPERTY_USERFORMCONTAINEES too + Reference< XNameContainer > xSrcNameCont( const_cast< UnoControlDialogModel& >(rModel).getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY ); + Reference<XNameContainer > xNameCont( new SimpleNamedThingContainer< XControlModel >() ); + + uno::Sequence< rtl::OUString > sNames = xSrcNameCont->getElementNames(); + rtl::OUString* pName = sNames.getArray(); + rtl::OUString* pNamesEnd = pName + sNames.getLength(); + for ( ; pName != pNamesEnd; ++pName ) + { + if ( xSrcNameCont->hasByName( *pName ) ) + xNameCont->insertByName( *pName, xSrcNameCont->getByName( *pName ) ); + } + setFastPropertyValue_NoBroadcast( BASEPROPERTY_USERFORMCONTAINEES, makeAny( xNameCont ) ); } UnoControlDialogModel::~UnoControlDialogModel() |