From 51bacc6a065f380a26b8cc2e5c18ff0ab4162ac3 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Thu, 4 Dec 2014 21:39:43 +0100 Subject: impl. Clone for all subclasses of SdrPage Change-Id: Ie370161e51ff83cb605bc57d317ff945404e5611 --- basctl/source/dlged/dlgedpage.cxx | 13 ++++++++++++- basctl/source/inc/dlgedpage.hxx | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'basctl') diff --git a/basctl/source/dlged/dlgedpage.cxx b/basctl/source/dlged/dlgedpage.cxx index 15f7f1253869..b3ed46ceffce 100644 --- a/basctl/source/dlged/dlgedpage.cxx +++ b/basctl/source/dlged/dlgedpage.cxx @@ -46,9 +46,20 @@ DlgEdPage::~DlgEdPage() SdrPage* DlgEdPage::Clone() const +{ + return Clone(0); +} + +SdrPage* DlgEdPage::Clone(SdrModel* const pNewModel) const { DlgEdPage* const pNewPage = new DlgEdPage( *this ); - pNewPage->lateInit( *this ); + DlgEdModel* pDlgEdModel = 0; + if ( pNewModel ) + { + pDlgEdModel = dynamic_cast( pNewModel ); + assert(pDlgEdModel); + } + pNewPage->lateInit( *this, pDlgEdModel ); return pNewPage; } diff --git a/basctl/source/inc/dlgedpage.hxx b/basctl/source/inc/dlgedpage.hxx index 02752920769a..e0bb63396e31 100644 --- a/basctl/source/inc/dlgedpage.hxx +++ b/basctl/source/inc/dlgedpage.hxx @@ -45,8 +45,8 @@ public: DlgEdPage( DlgEdModel& rModel, bool bMasterPage = false ); virtual ~DlgEdPage(); - using SdrPage::Clone; virtual SdrPage* Clone() const SAL_OVERRIDE; + virtual SdrPage* Clone( SdrModel* pNewModel ) const SAL_OVERRIDE; void SetDlgEdForm( DlgEdForm* pForm ) { pDlgEdForm = pForm; } DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; } -- cgit