diff options
author | David Tardon <dtardon@redhat.com> | 2014-12-04 21:39:43 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-12-04 23:10:25 +0100 |
commit | 51bacc6a065f380a26b8cc2e5c18ff0ab4162ac3 (patch) | |
tree | b42a463a134ff18ddac578dc88066d282268c4eb /basctl | |
parent | 9638e6207c7fc48712b1b238177462c00f5011e8 (diff) |
impl. Clone for all subclasses of SdrPage
Change-Id: Ie370161e51ff83cb605bc57d317ff945404e5611
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/dlged/dlgedpage.cxx | 13 | ||||
-rw-r--r-- | basctl/source/inc/dlgedpage.hxx | 2 |
2 files changed, 13 insertions, 2 deletions
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 @@ -47,8 +47,19 @@ 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<DlgEdModel*>( 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; } |