diff options
author | Jens-Heiner Rechtien [hr] <jens-heiner.rechtien@oracle.com> | 2011-02-11 18:06:45 +0100 |
---|---|---|
committer | Jens-Heiner Rechtien [hr] <jens-heiner.rechtien@oracle.com> | 2011-02-11 18:06:45 +0100 |
commit | 5efb77eeba4f0a3b5fc2cda98f13dbe442b28367 (patch) | |
tree | a481f93b609af9ed4fb1c72d1f5070377b196fe3 | |
parent | d9787ab9282f6ee79eec4bd009278c109154c48b (diff) |
DEV300 masterfix: #i116814,i116838#: fix XCloneable so that tests work againooo/DEV300_m100
4 files changed, 20 insertions, 6 deletions
diff --git a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx index 00fbc26f24..323234ed4c 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 37261dfe8d..02ff0e5aa6 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 6db471b276..d7b2c78b01 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 73a4c55a37..b597a1b636 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) { |