diff options
Diffstat (limited to 'reportdesign/source/core/sdr/RptPage.cxx')
-rw-r--r-- | reportdesign/source/core/sdr/RptPage.cxx | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx index 0d3465e93b30..b4e09805f04c 100644 --- a/reportdesign/source/core/sdr/RptPage.cxx +++ b/reportdesign/source/core/sdr/RptPage.cxx @@ -28,48 +28,29 @@ namespace rptui { using namespace ::com::sun::star; - -OReportPage::OReportPage( OReportModel& _rModel - ,const uno::Reference< report::XSection >& _xSection ) - :SdrPage( _rModel, false/*bMasterPage*/ ) +OReportPage::OReportPage( + OReportModel& _rModel, + const uno::Reference< report::XSection >& _xSection) +: SdrPage(_rModel, false/*bMasterPage*/) ,rModel(_rModel) ,m_xSection(_xSection) - ,m_bSpecialInsertMode(false) -{ -} - - -OReportPage::OReportPage( const OReportPage& rPage ) - :SdrPage( rPage ) - ,rModel(rPage.rModel) - ,m_xSection(rPage.m_xSection) - ,m_bSpecialInsertMode(rPage.m_bSpecialInsertMode) - ,m_aTemporaryObjectList(rPage.m_aTemporaryObjectList) + ,m_bSpecialInsertMode(false) { } - OReportPage::~OReportPage() { } - -SdrPage* OReportPage::Clone() const -{ - return Clone(nullptr); -} - -SdrPage* OReportPage::Clone( SdrModel* const pNewModel ) const +SdrPage* OReportPage::Clone(SdrModel* pNewModel) const { - OReportPage *const pNewPage = new OReportPage( *this ); - OReportModel* pReportModel = nullptr; - if ( pNewModel ) - { - pReportModel = dynamic_cast<OReportModel*>( pNewModel ); - assert( pReportModel ); - } - pNewPage->lateInit( *this, pReportModel ); - return pNewPage; + OReportModel& rOReportModel(static_cast< OReportModel& >(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel)); + OReportPage* pClonedOReportPage( + new OReportPage( + rOReportModel, + m_xSection)); + pClonedOReportPage->SdrPage::lateInit(*this); + return pClonedOReportPage; } |