From ce5f1dd187c3a7d8113c7653fa887b98fd50aaf6 Mon Sep 17 00:00:00 2001 From: "Jens-Heiner Rechtien [hr]" Date: Fri, 11 Feb 2011 18:06:45 +0100 Subject: DEV300 masterfix: #i116814,i116838#: fix XCloneable so that tests work again --- toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx | 1 + toolkit/inc/toolkit/controls/dialogcontrol.hxx | 1 + toolkit/source/controls/controlmodelcontainerbase.cxx | 14 ++++++++------ toolkit/source/controls/dialogcontrol.cxx | 10 ++++++++++ 4 files changed, 20 insertions(+), 6 deletions(-) (limited to 'toolkit') diff --git a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx index d50fecd8a344..2246ec0204b4 100644 --- a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx +++ b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx @@ -95,6 +95,7 @@ protected: ::rtl::OUString m_sTooltip; sal_Int16 m_nTabPageId; + void Clone_Impl(ControlModelContainerBase& _rClone) const; protected: ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx index a68760715035..1ab0120ec470 100644 --- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx +++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx @@ -52,6 +52,7 @@ public: UnoControlDialogModel( const UnoControlDialogModel& rModel ); ~UnoControlDialogModel(); + UnoControlModel* Clone() const; // ::com::sun::star::beans::XMultiPropertySet ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 58ca81f74541..940b99bd41c3 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -310,17 +310,19 @@ Reference< XPropertySetInfo > ControlModelContainerBase::getPropertySetInfo( ) static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } - -UnoControlModel* ControlModelContainerBase::Clone() const +void ControlModelContainerBase::Clone_Impl(ControlModelContainerBase& _rClone) const { - // clone the container itself - ControlModelContainerBase* pClone = new ControlModelContainerBase( *this ); - // clone all children ::std::for_each( maModels.begin(), maModels.end(), - CloneControlModel( pClone->maModels ) + CloneControlModel( _rClone.maModels ) ); +} +UnoControlModel* ControlModelContainerBase::Clone() const +{ + // clone the container itself + ControlModelContainerBase* pClone = new ControlModelContainerBase( *this ); + Clone_Impl(*pClone); return pClone; } diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 7a7f7444645b..15eeb2aa1939 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -109,6 +109,16 @@ UnoControlDialogModel::~UnoControlDialogModel() { } +UnoControlModel* UnoControlDialogModel::Clone() const +{ + // clone the container itself + UnoControlDialogModel* pClone = new UnoControlDialogModel( *this ); + + Clone_Impl(*pClone); + + return pClone; +} + ::rtl::OUString UnoControlDialogModel::getServiceName( ) throw(RuntimeException) { -- cgit