diff options
Diffstat (limited to 'sc/source/ui/namedlg/namepast.cxx')
-rw-r--r-- | sc/source/ui/namedlg/namepast.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx index 841781575ed4..5f0c238327ef 100644 --- a/sc/source/ui/namedlg/namepast.cxx +++ b/sc/source/ui/namedlg/namepast.cxx @@ -50,7 +50,7 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); pContainer->set_width_request(aControlSize.Width()); pContainer->set_height_request(10 * GetTextHeight()); - mpTable = new ScRangeManagerTable(*pContainer, maRangeMap, aPos); + mpTable = VclPtr<ScRangeManagerTable>::Create(*pContainer, maRangeMap, aPos); m_pBtnPaste->SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl) ); m_pBtnPasteAll->SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl)); @@ -65,7 +65,16 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool ScNamePasteDlg::~ScNamePasteDlg() { - delete mpTable; + disposeOnce(); +} + +void ScNamePasteDlg::dispose() +{ + mpTable.disposeAndClear(); + m_pBtnPasteAll.clear(); + m_pBtnPaste.clear(); + m_pBtnClose.clear(); + ModalDialog::dispose(); } IMPL_LINK( ScNamePasteDlg, ButtonHdl, Button *, pButton ) |