diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-26 13:23:37 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 22:02:04 +0100 |
commit | 584e6c6051d8a8371941d61603672891a8aa3013 (patch) | |
tree | b1f050db216c528ac8a68521b045b39a051ecdfc /sw/source/ui/index | |
parent | 45515c06d26d8a37e683f939b60198ee55343e55 (diff) |
vcl: VclPtr conversion in sw
Change-Id: Ie084a4b14f8371ff81fe6a95e73660e38cd376f2
Diffstat (limited to 'sw/source/ui/index')
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 66 | ||||
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 7 |
2 files changed, 66 insertions, 7 deletions
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 6f99aa25cebd..89db59c34d24 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -140,8 +140,8 @@ typedef ::svt::EditBrowseBox SwEntryBrowseBox_Base; class SwEntryBrowseBox : public SwEntryBrowseBox_Base { - Edit aCellEdit; - ::svt::CheckBoxControl aCellCheckBox; + VclPtr<Edit> aCellEdit; + VclPtr<::svt::CheckBoxControl> aCellCheckBox; OUString sSearch; OUString sAlternative; @@ -174,6 +174,8 @@ protected: public: SwEntryBrowseBox(vcl::Window* pParent, VclBuilderContainer* pBuilder); + virtual ~SwEntryBrowseBox(); + virtual void dispose() SAL_OVERRIDE; void ReadEntries(SvStream& rInStr); void WriteEntries(SvStream& rOutStr); @@ -199,6 +201,7 @@ public: SwAutoMarkDlg_Impl(vcl::Window* pParent, const OUString& rAutoMarkURL, bool bCreate); virtual ~SwAutoMarkDlg_Impl(); + virtual void dispose() SAL_OVERRIDE; }; @@ -319,6 +322,11 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(vcl::Window* pParent, const SfxItemSet& SwMultiTOXTabDialog::~SwMultiTOXTabDialog() { + dispose(); +} + +void SwMultiTOXTabDialog::dispose() +{ SW_MOD()->GetModuleConfig()->SetShowIndexPreview(m_pShowExampleCB->IsChecked()); // fdo#38515 Avoid setting focus on deleted controls in the destructors @@ -336,6 +344,7 @@ SwMultiTOXTabDialog::~SwMultiTOXTabDialog() delete[] pDescArr; delete pMgr; delete pExampleFrame; + SfxTabDialog::dispose(); } void SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) @@ -632,6 +641,7 @@ class SwAddStylesDlg_Impl : public SfxModalDialog public: SwAddStylesDlg_Impl(vcl::Window* pParent, SwWrtShell& rWrtSh, OUString rStringArr[]); virtual ~SwAddStylesDlg_Impl(); + virtual void dispose() SAL_OVERRIDE; }; SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(vcl::Window* pParent, @@ -706,7 +716,13 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(vcl::Window* pParent, SwAddStylesDlg_Impl::~SwAddStylesDlg_Impl() { + dispose(); +} + +void SwAddStylesDlg_Impl::dispose() +{ delete m_pHeaderTree; + SfxModalDialog::dispose(); } IMPL_LINK_NOARG(SwAddStylesDlg_Impl, OkHdl) @@ -881,8 +897,14 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(vcl::Window* pParent, const SfxItemSet& r SwTOXSelectTabPage::~SwTOXSelectTabPage() { + dispose(); +} + +void SwTOXSelectTabPage::dispose() +{ delete pIndexRes; delete pIndexEntryWrapper; + SfxTabPage::dispose(); } void SwTOXSelectTabPage::SetWrtShell(SwWrtShell& rSh) @@ -2624,6 +2646,11 @@ void SwTokenWindow::setAllocation(const Size &rAllocation) SwTokenWindow::~SwTokenWindow() { + dispose(); +} + +void SwTokenWindow::dispose() +{ for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { Control* pControl = (*it); @@ -2631,6 +2658,7 @@ SwTokenWindow::~SwTokenWindow() pControl->SetLoseFocusHdl( Link() ); delete pControl; } + VclHBox::dispose(); } void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) @@ -3505,7 +3533,13 @@ SwTOXStylesTabPage::SwTOXStylesTabPage(vcl::Window* pParent, const SfxItemSet& r SwTOXStylesTabPage::~SwTOXStylesTabPage() { + dispose(); +} + +void SwTOXStylesTabPage::dispose() +{ delete m_pCurrentForm; + SfxTabPage::dispose(); } bool SwTOXStylesTabPage::FillItemSet( SfxItemSet* ) @@ -3705,8 +3739,8 @@ SwEntryBrowseBox::SwEntryBrowseBox(vcl::Window* pParent, VclBuilderContainer* pB BROWSER_VLINESFULL | BROWSER_AUTO_VSCROLL| BROWSER_HIDECURSOR ) - , aCellEdit(&GetDataWindow(), 0) - , aCellCheckBox(&GetDataWindow()) + , aCellEdit(new Edit(&GetDataWindow(), 0)) + , aCellCheckBox(new ::svt::CheckBoxControl(&GetDataWindow())) , nCurrentRow(0) , bModified(false) { @@ -3720,9 +3754,9 @@ SwEntryBrowseBox::SwEntryBrowseBox(vcl::Window* pParent, VclBuilderContainer* pB sYes = pBuilder->get<vcl::Window>("yes")->GetText(); sNo = pBuilder->get<vcl::Window>("no")->GetText(); - aCellCheckBox.GetBox().EnableTriState(false); - xController = new ::svt::EditCellController(&aCellEdit); - xCheckController = new ::svt::CheckBoxCellController(&aCellCheckBox); + aCellCheckBox->GetBox().EnableTriState(false); + xController = new ::svt::EditCellController(aCellEdit.get()); + xCheckController = new ::svt::CheckBoxCellController(aCellCheckBox.get()); // HACK: BrowseBox doesn't invalidate its children, how it should be. // That's why WB_CLIPCHILDREN is reset in order to enforce the @@ -3753,6 +3787,18 @@ SwEntryBrowseBox::SwEntryBrowseBox(vcl::Window* pParent, VclBuilderContainer* pB HIB_STDSTYLE, HEADERBAR_APPEND ); } +SwEntryBrowseBox::~SwEntryBrowseBox() +{ + dispose(); +} + +void SwEntryBrowseBox::dispose() +{ + aCellEdit.disposeAndClear(); + aCellCheckBox.disposeAndClear(); + SwEntryBrowseBox_Base::dispose(); +} + void SwEntryBrowseBox::Resize() { SwEntryBrowseBox_Base::Resize(); @@ -4042,7 +4088,13 @@ SwAutoMarkDlg_Impl::SwAutoMarkDlg_Impl(vcl::Window* pParent, const OUString& rAu SwAutoMarkDlg_Impl::~SwAutoMarkDlg_Impl() { + dispose(); +} + +void SwAutoMarkDlg_Impl::dispose() +{ delete m_pEntriesBB; + ModalDialog::dispose(); } IMPL_LINK_NOARG(SwAutoMarkDlg_Impl, OkHdl) diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index b68938cb3709..701c6aee6250 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1007,6 +1007,7 @@ public: bool bNewEntry, bool bCreate); virtual ~SwCreateAuthEntryDlg_Impl(); + virtual void dispose() SAL_OVERRIDE; OUString GetEntryText(ToxAuthorityField eField) const; @@ -1519,6 +1520,11 @@ SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(vcl::Window* pParent, SwCreateAuthEntryDlg_Impl::~SwCreateAuthEntryDlg_Impl() { + dispose(); +} + +void SwCreateAuthEntryDlg_Impl::dispose() +{ for(int i = 0; i < AUTH_FIELD_END; i++) { delete pFixedTexts[i]; @@ -1526,6 +1532,7 @@ SwCreateAuthEntryDlg_Impl::~SwCreateAuthEntryDlg_Impl() } delete pTypeListBox; delete pIdentifierBox; + ModalDialog::dispose(); } OUString SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) const |