summaryrefslogtreecommitdiff
path: root/sw/source/ui/dbui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx30
-rw-r--r--sw/source/ui/dbui/addresslistdialog.hxx19
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx95
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.hxx39
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.cxx33
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.hxx20
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx39
-rw-r--r--sw/source/ui/dbui/dbtablepreviewdialog.cxx8
-rw-r--r--sw/source/ui/dbui/dbtablepreviewdialog.hxx5
-rw-r--r--sw/source/ui/dbui/mailmergewizard.cxx20
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx266
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx99
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx17
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.hxx19
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx29
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.hxx52
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx18
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.hxx23
-rw-r--r--sw/source/ui/dbui/mmmergepage.cxx19
-rw-r--r--sw/source/ui/dbui/mmmergepage.hxx18
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx116
-rw-r--r--sw/source/ui/dbui/mmoutputpage.hxx88
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx48
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.hxx12
-rw-r--r--sw/source/ui/dbui/mmpreparemergepage.cxx18
-rw-r--r--sw/source/ui/dbui/mmpreparemergepage.hxx18
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx13
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.hxx5
28 files changed, 801 insertions, 385 deletions
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 63bcbca4c579..e69a4ead6fb0 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -199,7 +199,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
Size aSize = pHeaderTreeContainer->LogicToPixel(Size(182 , 102), MAP_APPFONT);
pHeaderTreeContainer->set_width_request(aSize.Width());
pHeaderTreeContainer->set_height_request(aSize.Height());
- m_pListLB = new SwAddrSourceLB(*pHeaderTreeContainer);
+ m_pListLB = VclPtr<SwAddrSourceLB>::Create(*pHeaderTreeContainer);
m_pListLB->InsertHeaderEntry(m_sName + "\t" + m_sTable);
m_pListLB->setColSizes();
@@ -265,6 +265,11 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
SwAddressListDialog::~SwAddressListDialog()
{
+ disposeOnce();
+}
+
+void SwAddressListDialog::dispose()
+{
SvTreeListEntry* pEntry = m_pListLB->First();
while(pEntry)
{
@@ -272,7 +277,16 @@ SwAddressListDialog::~SwAddressListDialog()
delete pUserData;
pEntry = m_pListLB->Next( pEntry );
}
- delete m_pListLB;
+ m_pListLB.disposeAndClear();
+ m_pAddressPage.clear();
+ m_pDescriptionFI.clear();
+ m_pLoadListPB.clear();
+ m_pCreateListPB.clear();
+ m_pFilterPB.clear();
+ m_pEditPB.clear();
+ m_pTablePB.clear();
+ m_pOK.clear();
+ SfxModalDialog::dispose();
}
IMPL_LINK_NOARG(SwAddressListDialog, FilterHdl_Impl)
@@ -344,8 +358,9 @@ IMPL_LINK_NOARG(SwAddressListDialog, LoadHdl_Impl)
IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton)
{
OUString sInputURL;
- boost::scoped_ptr<SwCreateAddressListDialog> pDlg(
- new SwCreateAddressListDialog(
+ VclPtr<SwCreateAddressListDialog> pDlg(
+ VclPtr<SwCreateAddressListDialog>::Create(
+
pButton,
sInputURL,
m_pAddressPage->GetWizard()->GetConfigItem()));
@@ -443,8 +458,9 @@ IMPL_LINK(SwAddressListDialog, EditHdl_Impl, PushButton*, pButton)
pUserData->xColumnsSupplier.clear();
pUserData->xConnection.clear();
// will automatically close if it was the las reference
- boost::scoped_ptr<SwCreateAddressListDialog> pDlg(
- new SwCreateAddressListDialog(
+ VclPtr<SwCreateAddressListDialog> pDlg(
+ VclPtr<SwCreateAddressListDialog>::Create(
+
pButton,
pUserData->sURL,
m_pAddressPage->GetWizard()->GetConfigItem()));
@@ -562,7 +578,7 @@ void SwAddressListDialog::DetectTablesAndQueries(
if(nTables > 1 && bWidthDialog)
{
//now call the table select dialog - if more than one table exists
- boost::scoped_ptr<SwSelectDBTableDialog> pDlg(new SwSelectDBTableDialog(this, pUserData->xConnection));
+ VclPtrInstance<SwSelectDBTableDialog> pDlg(this, pUserData->xConnection);
const OUString sTable = SvTabListBox::GetEntryText(pSelect, ITEMID_TABLE - 1);
if(!sTable.isEmpty())
pDlg->SetSelectedTable(sTable, pUserData->nCommandType == CommandType::TABLE);
diff --git a/sw/source/ui/dbui/addresslistdialog.hxx b/sw/source/ui/dbui/addresslistdialog.hxx
index 50812efef486..708876448579 100644
--- a/sw/source/ui/dbui/addresslistdialog.hxx
+++ b/sw/source/ui/dbui/addresslistdialog.hxx
@@ -46,17 +46,17 @@ class SwAddrSourceLB;
class SwAddressListDialog : public SfxModalDialog
{
- FixedText* m_pDescriptionFI;
+ VclPtr<FixedText> m_pDescriptionFI;
- SwAddrSourceLB* m_pListLB;
+ VclPtr<SwAddrSourceLB> m_pListLB;
- PushButton* m_pLoadListPB;
- PushButton* m_pCreateListPB;
- PushButton* m_pFilterPB;
- PushButton* m_pEditPB;
- PushButton* m_pTablePB;
+ VclPtr<PushButton> m_pLoadListPB;
+ VclPtr<PushButton> m_pCreateListPB;
+ VclPtr<PushButton> m_pFilterPB;
+ VclPtr<PushButton> m_pEditPB;
+ VclPtr<PushButton> m_pTablePB;
- OKButton* m_pOK;
+ VclPtr<OKButton> m_pOK;
OUString m_sName;
OUString m_sTable;
@@ -66,7 +66,7 @@ class SwAddressListDialog : public SfxModalDialog
bool m_bInSelectHdl;
- SwMailMergeAddressBlockPage* m_pAddressPage;
+ VclPtr<SwMailMergeAddressBlockPage> m_pAddressPage;
::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext> m_xDBContext;
@@ -87,6 +87,7 @@ class SwAddressListDialog : public SfxModalDialog
public:
SwAddressListDialog(SwMailMergeAddressBlockPage* pParent);
virtual ~SwAddressListDialog();
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource>
GetSource();
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 347ce0a4a5dc..1d8a63103802 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -46,11 +46,11 @@ using namespace ::com::sun::star::ui::dialogs;
class SwAddressControl_Impl : public Control
{
- ScrollBar *m_pScrollBar;
- Window *m_pWindow;
+ VclPtr<ScrollBar> m_pScrollBar;
+ VclPtr<Window> m_pWindow;
- ::std::vector<FixedText*> m_aFixedTexts;
- ::std::vector<Edit*> m_aEdits;
+ ::std::vector<VclPtr<FixedText> > m_aFixedTexts;
+ ::std::vector<VclPtr<Edit> > m_aEdits;
SwCSVData* m_pData;
Size m_aWinOutputSize;
@@ -74,6 +74,7 @@ class SwAddressControl_Impl : public Control
public:
SwAddressControl_Impl(vcl::Window* pParent , WinBits nBits );
virtual ~SwAddressControl_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void SetData(SwCSVData& rDBData);
@@ -85,8 +86,8 @@ public:
SwAddressControl_Impl::SwAddressControl_Impl(vcl::Window* pParent, WinBits nBits ) :
Control(pParent, nBits),
- m_pScrollBar(new ScrollBar(this)),
- m_pWindow(new vcl::Window(this, WB_DIALOGCONTROL)),
+ m_pScrollBar(VclPtr<ScrollBar>::Create(this)),
+ m_pWindow(VclPtr<vcl::Window>::Create(this, WB_DIALOGCONTROL)),
m_pData(0),
m_nLineHeight(0),
m_nCurrentDataSet(0),
@@ -113,14 +114,20 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSwAddressControlImpl(v
SwAddressControl_Impl::~SwAddressControl_Impl()
{
- ::std::vector<FixedText*>::iterator aTextIter;
- for(aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter)
- delete *aTextIter;
- ::std::vector<Edit*>::iterator aEditIter;
- for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
- delete *aEditIter;
- delete m_pScrollBar;
- delete m_pWindow;
+ disposeOnce();
+}
+
+void SwAddressControl_Impl::dispose()
+{
+ for(auto aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter)
+ aTextIter->disposeAndClear();
+ m_aFixedTexts.clear();
+ for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
+ aEditIter->disposeAndClear();
+ m_aEdits.clear();
+ m_pScrollBar.clear();
+ m_pWindow.clear();
+ Control::dispose();
}
void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
@@ -129,13 +136,11 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
//when the address data is updated then remove the controls an build again
if(m_aFixedTexts.size())
{
- ::std::vector<FixedText*>::iterator aTextIter;
- for(aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter)
- delete *aTextIter;
- ::std::vector<Edit*>::iterator aEditIter;
- for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
- delete *aEditIter;
+ for(auto aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter)
+ aTextIter->disposeAndClear();
m_aFixedTexts.clear();
+ for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
+ aEditIter->disposeAndClear();
m_aEdits.clear();
m_bNoDataSet = true;
}
@@ -176,8 +181,8 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
aHeaderIter != m_pData->aDBColumnHeaders.end();
++aHeaderIter, nEDYPos += m_nLineHeight, nFTYPos += m_nLineHeight, nLines++)
{
- FixedText* pNewFT = new FixedText(m_pWindow, WB_RIGHT);
- Edit* pNewED = new Edit(m_pWindow, WB_BORDER);
+ VclPtr<FixedText> pNewFT = VclPtr<FixedText>::Create(m_pWindow, WB_RIGHT);
+ VclPtr<Edit> pNewED = VclPtr<Edit>::Create(m_pWindow, WB_BORDER);
//set nLines a position identifier - used in the ModifyHdl
pNewED->SetData(reinterpret_cast<void*>(nLines));
pNewED->SetGetFocusHdl(aFocusLink);
@@ -244,9 +249,8 @@ void SwAddressControl_Impl::SetCurrentDataSet(sal_uInt32 nSet)
OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index");
if(m_pData->aDBData.size() > m_nCurrentDataSet)
{
- ::std::vector<Edit*>::iterator aEditIter;
sal_uInt32 nIndex = 0;
- for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter, ++nIndex)
+ for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter, ++nIndex)
{
OSL_ENSURE(nIndex < m_pData->aDBData[m_nCurrentDataSet].size(),
"number of columns doesn't match number of Edits");
@@ -380,8 +384,7 @@ void SwAddressControl_Impl::Resize()
{
long nNewEditSize = aSize.Width() - (*m_aEdits.begin())->GetPosPixel().X() - nScrollBarWidth - 6;
- ::std::vector<Edit*>::iterator aEditIter;
- for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
+ for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
{
(*aEditIter)->SetSizePixel(Size(nNewEditSize, (*aEditIter)->GetSizePixel().Height()));
}
@@ -495,8 +498,25 @@ SwCreateAddressListDialog::SwCreateAddressListDialog(
SwCreateAddressListDialog::~SwCreateAddressListDialog()
{
+ disposeOnce();
+}
+
+void SwCreateAddressListDialog::dispose()
+{
delete m_pCSVData;
- delete m_pFindDlg;
+ m_pAddressControl.clear();
+ m_pNewPB.clear();
+ m_pDeletePB.clear();
+ m_pFindPB.clear();
+ m_pCustomizePB.clear();
+ m_pStartPB.clear();
+ m_pPrevPB.clear();
+ m_pSetNoNF.clear();
+ m_pNextPB.clear();
+ m_pEndPB.clear();
+ m_pOK.clear();
+ m_pFindDlg.disposeAndClear();
+ SfxModalDialog::dispose();
}
IMPL_LINK_NOARG(SwCreateAddressListDialog, NewHdl_Impl)
@@ -541,7 +561,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, FindHdl_Impl)
{
if(!m_pFindDlg)
{
- m_pFindDlg = new SwFindEntryDialog(this);
+ m_pFindDlg = VclPtr<SwFindEntryDialog>::Create(this);
ListBox& rColumnBox = m_pFindDlg->GetFieldsListBox();
::std::vector< OUString >::iterator aHeaderIter;
for(aHeaderIter = m_pCSVData->aDBColumnHeaders.begin();
@@ -558,7 +578,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, FindHdl_Impl)
IMPL_LINK(SwCreateAddressListDialog, CustomizeHdl_Impl, PushButton*, pButton)
{
- boost::scoped_ptr<SwCustomizeAddressListDialog> pDlg(new SwCustomizeAddressListDialog(pButton, *m_pCSVData));
+ VclPtrInstance< SwCustomizeAddressListDialog > pDlg(pButton, *m_pCSVData);
if(RET_OK == pDlg->Execute())
{
delete m_pCSVData;
@@ -751,6 +771,23 @@ SwFindEntryDialog::SwFindEntryDialog(SwCreateAddressListDialog* pParent)
m_pCancel->SetClickHdl(LINK(this, SwFindEntryDialog, CloseHdl_Impl));
}
+SwFindEntryDialog::~SwFindEntryDialog()
+{
+ disposeOnce();
+}
+
+void SwFindEntryDialog::dispose()
+{
+ m_pFindED.clear();
+ m_pFindOnlyCB.clear();
+ m_pFindOnlyLB.clear();
+ m_pFindPB.clear();
+ m_pCancel.clear();
+ m_pParent.clear();
+ ModelessDialog::dispose();
+}
+
+
IMPL_LINK_NOARG(SwFindEntryDialog, FindHdl_Impl)
{
sal_Int32 nColumn = -1;
diff --git a/sw/source/ui/dbui/createaddresslistdialog.hxx b/sw/source/ui/dbui/createaddresslistdialog.hxx
index 393c5a79b71e..ac6ed41cfab2 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.hxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.hxx
@@ -40,27 +40,27 @@ struct SwCSVData
class SwFindEntryDialog;
class SwCreateAddressListDialog : public SfxModalDialog
{
- SwAddressControl_Impl* m_pAddressControl;
+ VclPtr<SwAddressControl_Impl> m_pAddressControl;
- PushButton *m_pNewPB;
- PushButton *m_pDeletePB;
- PushButton *m_pFindPB;
- PushButton *m_pCustomizePB;
+ VclPtr<PushButton> m_pNewPB;
+ VclPtr<PushButton> m_pDeletePB;
+ VclPtr<PushButton> m_pFindPB;
+ VclPtr<PushButton> m_pCustomizePB;
- PushButton *m_pStartPB;
- PushButton *m_pPrevPB;
- NumericField *m_pSetNoNF;
- PushButton *m_pNextPB;
- PushButton *m_pEndPB;
+ VclPtr<PushButton> m_pStartPB;
+ VclPtr<PushButton> m_pPrevPB;
+ VclPtr<NumericField> m_pSetNoNF;
+ VclPtr<PushButton> m_pNextPB;
+ VclPtr<PushButton> m_pEndPB;
- OKButton *m_pOK;
+ VclPtr<OKButton> m_pOK;
OUString m_sAddressListFilterName;
OUString m_sURL;
SwCSVData* m_pCSVData;
- SwFindEntryDialog* m_pFindDlg;
+ VclPtr<SwFindEntryDialog> m_pFindDlg;
DECL_LINK(NewHdl_Impl, void *);
DECL_LINK(DeleteHdl_Impl, void *);
@@ -76,6 +76,7 @@ public:
SwCreateAddressListDialog(
vcl::Window* pParent, const OUString& rURL, SwMailMergeConfigItem& rConfig);
virtual ~SwCreateAddressListDialog();
+ virtual void dispose() SAL_OVERRIDE;
const OUString& GetURL() const { return m_sURL; }
void Find( const OUString& rSearch, sal_Int32 nColumn);
@@ -83,14 +84,14 @@ public:
class SwFindEntryDialog : public ModelessDialog
{
- Edit* m_pFindED;
- CheckBox* m_pFindOnlyCB;
- ListBox* m_pFindOnlyLB;
+ VclPtr<Edit> m_pFindED;
+ VclPtr<CheckBox> m_pFindOnlyCB;
+ VclPtr<ListBox> m_pFindOnlyLB;
- PushButton* m_pFindPB;
- CancelButton* m_pCancel;
+ VclPtr<PushButton> m_pFindPB;
+ VclPtr<CancelButton> m_pCancel;
- SwCreateAddressListDialog* m_pParent;
+ VclPtr<SwCreateAddressListDialog> m_pParent;
DECL_LINK(FindHdl_Impl, void *);
DECL_LINK(FindEnableHdl_Impl, void *);
@@ -98,6 +99,8 @@ class SwFindEntryDialog : public ModelessDialog
public:
SwFindEntryDialog(SwCreateAddressListDialog* pParent);
+ virtual ~SwFindEntryDialog();
+ virtual void dispose() SAL_OVERRIDE;
ListBox& GetFieldsListBox()
{
diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
index c812fcd37a1a..7ade01841ee4 100644
--- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
@@ -24,7 +24,6 @@
#include <vcl/msgbox.hxx>
#include <dbui.hrc>
#include <helpid.h>
-#include <boost/scoped_ptr.hpp>
SwCustomizeAddressListDialog::SwCustomizeAddressListDialog(
vcl::Window* pParent, const SwCSVData& rOldData)
@@ -61,8 +60,21 @@ SwCustomizeAddressListDialog::SwCustomizeAddressListDialog(
SwCustomizeAddressListDialog::~SwCustomizeAddressListDialog()
{
+ disposeOnce();
}
+void SwCustomizeAddressListDialog::dispose()
+{
+ m_pFieldsLB.clear();
+ m_pAddPB.clear();
+ m_pDeletePB.clear();
+ m_pRenamePB.clear();
+ m_pUpPB.clear();
+ m_pDownPB.clear();
+ SfxModalDialog::dispose();
+}
+
+
IMPL_LINK_NOARG(SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl)
{
UpdateButtons();
@@ -76,11 +88,11 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton)
if(nPos == LISTBOX_ENTRY_NOTFOUND)
nPos = 0;
- boost::scoped_ptr<SwAddRenameEntryDialog> pDlg;
+ ScopedVclPtr<SwAddRenameEntryDialog> pDlg;
if (bRename)
- pDlg.reset(new SwRenameEntryDialog(pButton, m_pNewData->aDBColumnHeaders));
+ pDlg.reset(VclPtr<SwRenameEntryDialog>::Create(pButton, m_pNewData->aDBColumnHeaders));
else
- pDlg.reset(new SwAddEntryDialog(pButton, m_pNewData->aDBColumnHeaders));
+ pDlg.reset(VclPtr<SwAddEntryDialog>::Create(pButton, m_pNewData->aDBColumnHeaders));
if(bRename)
{
OUString aTemp = m_pFieldsLB->GetEntry(nPos);
@@ -111,7 +123,6 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton)
m_pFieldsLB->InsertEntry(sNew, nPos);
m_pFieldsLB->SelectEntryPos(nPos);
}
- pDlg.reset();
UpdateButtons();
return 0;
}
@@ -184,6 +195,18 @@ SwAddRenameEntryDialog::SwAddRenameEntryDialog(
ModifyHdl_Impl(m_pFieldNameED);
}
+SwAddRenameEntryDialog::~SwAddRenameEntryDialog()
+{
+ disposeOnce();
+}
+
+void SwAddRenameEntryDialog::dispose()
+{
+ m_pFieldNameED.clear();
+ m_pOK.clear();
+ SfxModalDialog::dispose();
+}
+
IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit)
{
OUString sEntry = pEdit->GetText();
diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.hxx b/sw/source/ui/dbui/customizeaddresslistdialog.hxx
index e0592085047f..e943f657b3f3 100644
--- a/sw/source/ui/dbui/customizeaddresslistdialog.hxx
+++ b/sw/source/ui/dbui/customizeaddresslistdialog.hxx
@@ -29,14 +29,14 @@ struct SwCSVData;
class SwCustomizeAddressListDialog : public SfxModalDialog
{
- ListBox* m_pFieldsLB;
+ VclPtr<ListBox> m_pFieldsLB;
- PushButton* m_pAddPB;
- PushButton* m_pDeletePB;
- PushButton* m_pRenamePB;
+ VclPtr<PushButton> m_pAddPB;
+ VclPtr<PushButton> m_pDeletePB;
+ VclPtr<PushButton> m_pRenamePB;
- PushButton* m_pUpPB;
- PushButton* m_pDownPB;
+ VclPtr<PushButton> m_pUpPB;
+ VclPtr<PushButton> m_pDownPB;
SwCSVData* m_pNewData;
@@ -49,20 +49,24 @@ class SwCustomizeAddressListDialog : public SfxModalDialog
public:
SwCustomizeAddressListDialog(vcl::Window* pParent, const SwCSVData& rOldData);
virtual ~SwCustomizeAddressListDialog();
+ virtual void dispose() SAL_OVERRIDE;
SwCSVData* GetNewData() { return m_pNewData;}
};
class SwAddRenameEntryDialog : public SfxModalDialog
{
- Edit* m_pFieldNameED;
- OKButton* m_pOK;
+ VclPtr<Edit> m_pFieldNameED;
+ VclPtr<OKButton> m_pOK;
const std::vector< OUString >& m_rCSVHeader;
DECL_LINK(ModifyHdl_Impl, Edit*);
protected:
SwAddRenameEntryDialog(vcl::Window* pParent, const OUString& rID,
const OUString& rUIXMLDescription, const std::vector< OUString >& rCSVHeader);
+ virtual ~SwAddRenameEntryDialog();
+ virtual void dispose() SAL_OVERRIDE;
+
public:
void SetFieldName(const OUString& rName) {m_pFieldNameED->SetText(rName);}
OUString GetFieldName() const {return m_pFieldNameED->GetText();};
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 29aa77145fdb..43c1e656c188 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -413,10 +413,41 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
SwInsertDBColAutoPilot::~SwInsertDBColAutoPilot()
{
+ disposeOnce();
+}
+
+void SwInsertDBColAutoPilot::dispose()
+{
delete pTblSet;
delete pRep;
delete pTAutoFmt;
+ m_pRbAsTable.clear();
+ m_pRbAsField.clear();
+ m_pRbAsText.clear();
+ m_pHeadFrame.clear();
+ m_pLbTblDbColumn.clear();
+ m_pLbTxtDbColumn.clear();
+ m_pFormatFrame.clear();
+ m_pRbDbFmtFromDb.clear();
+ m_pRbDbFmtFromUsr.clear();
+ m_pLbDbFmtFromUsr.clear();
+ m_pIbDbcolToEdit.clear();
+ m_pEdDbText.clear();
+ m_pFtDbParaColl.clear();
+ m_pLbDbParaColl.clear();
+ m_pIbDbcolAllTo.clear();
+ m_pIbDbcolOneTo.clear();
+ m_pIbDbcolOneFrom.clear();
+ m_pIbDbcolAllFrom.clear();
+ m_pFtTableCol.clear();
+ m_pLbTableCol.clear();
+ m_pCbTableHeadon.clear();
+ m_pRbHeadlColnms.clear();
+ m_pRbHeadlEmpty.clear();
+ m_pPbTblFormat.clear();
+ m_pPbTblAutofmt.clear();
+ SfxModalDialog::dispose();
}
IMPL_LINK( SwInsertDBColAutoPilot, PageHdl, Button*, pButton )
@@ -768,9 +799,9 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox )
ListBox* pGetBox = pBox == m_pLbDbFmtFromUsr
? ( m_pRbAsTable->IsChecked()
? ( 0 == m_pLbTableCol->GetEntryData( 0 )
- ? m_pLbTblDbColumn
- : m_pLbTableCol )
- : m_pLbTxtDbColumn )
+ ? m_pLbTblDbColumn.get()
+ : m_pLbTableCol.get() )
+ : m_pLbTxtDbColumn.get() )
: pBox;
SwInsDBColumn aSrch( pGetBox->GetSelectEntry(), 0 );
@@ -818,7 +849,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox )
// to know later on, what ListBox was the "active", a Flag
// is remembered in the 1st entry
- void* pPtr = pBox == m_pLbTableCol ? m_pLbTableCol : 0;
+ void* pPtr = pBox == m_pLbTableCol ? m_pLbTableCol.get() : 0;
m_pLbTableCol->SetEntryData( 0, pPtr );
}
return 0;
diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx
index 4eb019abf21e..fd9e2eb34f5c 100644
--- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx
+++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx
@@ -81,11 +81,19 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(vcl::Window* pParent, uno::Sequen
SwDBTablePreviewDialog::~SwDBTablePreviewDialog()
{
+ disposeOnce();
+}
+
+void SwDBTablePreviewDialog::dispose()
+{
if(m_xFrame.is())
{
m_xFrame->setComponent(NULL, NULL);
m_xFrame->dispose();
}
+ m_pDescriptionFI.clear();
+ m_pBeamerWIN.clear();
+ SfxModalDialog::dispose();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.hxx b/sw/source/ui/dbui/dbtablepreviewdialog.hxx
index e99b7f457525..bae176de7b74 100644
--- a/sw/source/ui/dbui/dbtablepreviewdialog.hxx
+++ b/sw/source/ui/dbui/dbtablepreviewdialog.hxx
@@ -31,14 +31,15 @@ namespace com{ namespace sun{ namespace star{
class SwDBTablePreviewDialog : public SfxModalDialog
{
- FixedText* m_pDescriptionFI;
- vcl::Window* m_pBeamerWIN;
+ VclPtr<FixedText> m_pDescriptionFI;
+ VclPtr<vcl::Window> m_pBeamerWIN;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xFrame;
public:
SwDBTablePreviewDialog(vcl::Window* pParent,
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rValues );
virtual ~SwDBTablePreviewDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx
index 9a577c41edb1..068b08ffd54f 100644
--- a/sw/source/ui/dbui/mailmergewizard.cxx
+++ b/sw/source/ui/dbui/mailmergewizard.cxx
@@ -101,19 +101,19 @@ SwMailMergeWizard::~SwMailMergeWizard()
{
}
-OWizardPage* SwMailMergeWizard::createPage(WizardState _nState)
+VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState)
{
- OWizardPage* pRet = 0;
+ VclPtr<OWizardPage> pRet;
switch(_nState)
{
- case MM_DOCUMENTSELECTPAGE : pRet = new SwMailMergeDocSelectPage(this); break;
- case MM_OUTPUTTYPETPAGE : pRet = new SwMailMergeOutputTypePage(this); break;
- case MM_ADDRESSBLOCKPAGE : pRet = new SwMailMergeAddressBlockPage(this); break;
- case MM_GREETINGSPAGE : pRet = new SwMailMergeGreetingsPage(this); break;
- case MM_LAYOUTPAGE : pRet = new SwMailMergeLayoutPage(this); break;
- case MM_PREPAREMERGEPAGE : pRet = new SwMailMergePrepareMergePage(this); break;
- case MM_MERGEPAGE : pRet = new SwMailMergeMergePage(this); break;
- case MM_OUTPUTPAGE : pRet = new SwMailMergeOutputPage(this); break;
+ case MM_DOCUMENTSELECTPAGE : pRet = VclPtr<SwMailMergeDocSelectPage>::Create(this); break;
+ case MM_OUTPUTTYPETPAGE : pRet = VclPtr<SwMailMergeOutputTypePage>::Create(this); break;
+ case MM_ADDRESSBLOCKPAGE : pRet = VclPtr<SwMailMergeAddressBlockPage>::Create(this); break;
+ case MM_GREETINGSPAGE : pRet = VclPtr<SwMailMergeGreetingsPage>::Create(this); break;
+ case MM_LAYOUTPAGE : pRet = VclPtr<SwMailMergeLayoutPage>::Create(this); break;
+ case MM_PREPAREMERGEPAGE : pRet = VclPtr<SwMailMergePrepareMergePage>::Create(this); break;
+ case MM_MERGEPAGE : pRet = VclPtr<SwMailMergeMergePage>::Create(this); break;
+ case MM_OUTPUTPAGE : pRet = VclPtr<SwMailMergeOutputPage>::Create(this); break;
}
OSL_ENSURE(pRet, "no page created in ::createPage");
return pRet;
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 44d7ff52b384..37a06cc86276 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -93,6 +93,32 @@ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pP
m_pNextSetIB->SetClickHdl(aLink);
}
+SwMailMergeAddressBlockPage::~SwMailMergeAddressBlockPage()
+{
+ disposeOnce();
+}
+
+void SwMailMergeAddressBlockPage::dispose()
+{
+ m_pAddressListPB.clear();
+ m_pCurrentAddressFI.clear();
+ m_pStep2.clear();
+ m_pStep3.clear();
+ m_pStep4.clear();
+ m_pSettingsFI.clear();
+ m_pAddressCB.clear();
+ m_pSettingsWIN.clear();
+ m_pSettingsPB.clear();
+ m_pHideEmptyParagraphsCB.clear();
+ m_pAssignPB.clear();
+ m_pPreviewWIN.clear();
+ m_pDocumentIndexFI.clear();
+ m_pPrevSetIB.clear();
+ m_pNextSetIB.clear();
+ m_pWizard.clear();
+ svt::OWizardPage::dispose();
+}
+
bool SwMailMergeAddressBlockPage::canAdvance() const
{
return m_pWizard->GetConfigItem().GetResultSet().is();
@@ -137,7 +163,7 @@ IMPL_LINK_NOARG(SwMailMergeAddressBlockPage, AddressListHdl_Impl)
{
try
{
- boost::scoped_ptr<SwAddressListDialog> xAddrDialog(new SwAddressListDialog(this));
+ VclPtrInstance< SwAddressListDialog > xAddrDialog(this);
if(RET_OK == xAddrDialog->Execute())
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
@@ -163,8 +189,8 @@ IMPL_LINK_NOARG(SwMailMergeAddressBlockPage, AddressListHdl_Impl)
IMPL_LINK(SwMailMergeAddressBlockPage, SettingsHdl_Impl, PushButton*, pButton)
{
- boost::scoped_ptr<SwSelectAddressBlockDialog> pDlg(
- new SwSelectAddressBlockDialog(pButton, m_pWizard->GetConfigItem()));
+ VclPtr<SwSelectAddressBlockDialog> pDlg(
+ VclPtr<SwSelectAddressBlockDialog>::Create(pButton, m_pWizard->GetConfigItem()));
SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem();
pDlg->SetAddressBlocks(rConfig.GetAddressBlocks(), m_pSettingsWIN->GetSelectedAddress());
pDlg->SetSettings(rConfig.IsIncludeCountry(), rConfig.GetExcludeCountry());
@@ -193,8 +219,8 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AssignHdl_Impl, PushButton*, pButton)
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
const sal_uInt16 nSel = m_pSettingsWIN->GetSelectedAddress();
const uno::Sequence< OUString> aBlocks = rConfigItem.GetAddressBlocks();
- boost::scoped_ptr<SwAssignFieldsDialog> pDlg(
- new SwAssignFieldsDialog(pButton, m_pWizard->GetConfigItem(), aBlocks[nSel], true));
+ VclPtr<SwAssignFieldsDialog> pDlg(
+ VclPtr<SwAssignFieldsDialog>::Create(pButton, m_pWizard->GetConfigItem(), aBlocks[nSel], true));
if(RET_OK == pDlg->Execute())
{
//preview update
@@ -330,6 +356,20 @@ SwSelectAddressBlockDialog::SwSelectAddressBlockDialog(
SwSelectAddressBlockDialog::~SwSelectAddressBlockDialog()
{
+ disposeOnce();
+}
+
+void SwSelectAddressBlockDialog::dispose()
+{
+ m_pPreview.clear();
+ m_pNewPB.clear();
+ m_pCustomizePB.clear();
+ m_pDeletePB.clear();
+ m_pNeverRB.clear();
+ m_pAlwaysRB.clear();
+ m_pDependentRB.clear();
+ m_pCountryED.clear();
+ SfxModalDialog::dispose();
}
void SwSelectAddressBlockDialog::SetAddressBlocks(const uno::Sequence< OUString>& rBlocks,
@@ -413,8 +453,8 @@ IMPL_LINK(SwSelectAddressBlockDialog, NewCustomizeHdl_Impl, PushButton*, pButton
SwCustomizeAddressBlockDialog::DialogType nType = bCustomize ?
SwCustomizeAddressBlockDialog::ADDRESSBLOCK_EDIT :
SwCustomizeAddressBlockDialog::ADDRESSBLOCK_NEW;
- boost::scoped_ptr<SwCustomizeAddressBlockDialog> pDlg(
- new SwCustomizeAddressBlockDialog(pButton,m_rConfig,nType));
+ VclPtr<SwCustomizeAddressBlockDialog> pDlg(
+ VclPtr<SwCustomizeAddressBlockDialog>::Create(pButton,m_rConfig,nType));
if(bCustomize)
{
pDlg->SetAddress(m_aAddressBlocks[m_pPreview->GetSelectedAddress()]);
@@ -533,6 +573,26 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog(
SwCustomizeAddressBlockDialog::~SwCustomizeAddressBlockDialog()
{
+ disposeOnce();
+}
+
+void SwCustomizeAddressBlockDialog::dispose()
+{
+ m_pAddressElementsFT.clear();
+ m_pAddressElementsLB.clear();
+ m_pInsertFieldIB.clear();
+ m_pRemoveFieldIB.clear();
+ m_pDragFT.clear();
+ m_pDragED.clear();
+ m_pUpIB.clear();
+ m_pLeftIB.clear();
+ m_pRightIB.clear();
+ m_pDownIB.clear();
+ m_pFieldFT.clear();
+ m_pFieldCB.clear();
+ m_pPreviewWIN.clear();
+ m_pOK.clear();
+ SfxModalDialog::dispose();
}
IMPL_LINK_NOARG(SwCustomizeAddressBlockDialog, OKHdl_Impl)
@@ -746,13 +806,13 @@ OUString SwCustomizeAddressBlockDialog::GetAddress()
class SwAssignFieldsControl : public Control
{
friend class SwAssignFieldsDialog;
- ScrollBar m_aVScroll;
- HeaderBar m_aHeaderHB;
- Window m_aWindow;
+ VclPtr<ScrollBar> m_aVScroll;
+ VclPtr<HeaderBar> m_aHeaderHB;
+ VclPtr<Window> m_aWindow;
- ::std::vector<FixedText*> m_aFieldNames;
- ::std::vector<ListBox*> m_aMatches;
- ::std::vector<FixedText*> m_aPreviews;
+ ::std::vector<VclPtr<FixedText> > m_aFieldNames;
+ ::std::vector<VclPtr<ListBox> > m_aMatches;
+ ::std::vector<VclPtr<FixedText> > m_aPreviews;
SwMailMergeConfigItem* m_rConfigItem;
@@ -773,6 +833,7 @@ class SwAssignFieldsControl : public Control
public:
SwAssignFieldsControl(vcl::Window* pParent, WinBits nBits);
virtual ~SwAssignFieldsControl();
+ virtual void dispose() SAL_OVERRIDE;
void Init(SwMailMergeConfigItem& rConfigItem);
void SetModifyHdl(const Link& rModifyHdl)
@@ -791,23 +852,23 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSwAssignFieldsControl(
SwAssignFieldsControl::SwAssignFieldsControl(vcl::Window* pParent, WinBits nBits) :
Control(pParent, nBits | WB_DIALOGCONTROL | WB_TABSTOP | WB_DIALOGCONTROL),
- m_aVScroll(this),
- m_aHeaderHB(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER),
- m_aWindow(this, WB_BORDER | WB_DIALOGCONTROL),
+ m_aVScroll(VclPtr<ScrollBar>::Create(this)),
+ m_aHeaderHB(VclPtr<HeaderBar>::Create(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER)),
+ m_aWindow(VclPtr<vcl::Window>::Create(this, WB_BORDER | WB_DIALOGCONTROL)),
m_rConfigItem(NULL),
m_nLBStartTopPos(0),
m_nYOffset(0),
m_nFirstYPos(0)
{
- long nHBHeight = m_aHeaderHB.CalcWindowSizePixel().Height();
+ long nHBHeight = m_aHeaderHB->CalcWindowSizePixel().Height();
Size aOutputSize(GetOutputSize());
- m_aVScroll.Show();
- m_aHeaderHB.SetSizePixel(
+ m_aVScroll->Show();
+ m_aHeaderHB->SetSizePixel(
Size(aOutputSize.Width(), nHBHeight));
- m_aHeaderHB.Show();
- m_aWindow.SetPosPixel(Point( 0, nHBHeight) );
- m_aWindow.SetSizePixel(Size(aOutputSize.Width() - m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
- m_aWindow.Show();
+ m_aHeaderHB->Show();
+ m_aWindow->SetPosPixel(Point( 0, nHBHeight) );
+ m_aWindow->SetSizePixel(Size(aOutputSize.Width() - m_aVScroll->GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
+ m_aWindow->Show();
}
Size SwAssignFieldsControl::GetOptimalSize() const
@@ -819,7 +880,7 @@ void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
{
m_rConfigItem = &rConfigItem;
Size aOutputSize(GetOutputSize());
- long nHBHeight = m_aHeaderHB.CalcWindowSizePixel().Height();
+ long nHBHeight = m_aHeaderHB->CalcWindowSizePixel().Height();
//get the name of the default headers
const ResStringArray& rHeaders = rConfigItem.GetDefaultAddressHeaders();
@@ -845,9 +906,9 @@ void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
for(sal_uInt32 i = 0; i < rHeaders.Count(); ++i)
{
const OUString rHeader = rHeaders.GetString( i );
- FixedText* pNewText = new FixedText(&m_aWindow, WB_VCENTER);
+ VclPtr<FixedText> pNewText = VclPtr<FixedText>::Create(m_aWindow.get(), WB_VCENTER);
pNewText->SetText("<" + rHeader + ">");
- ListBox* pNewLB = new ListBox(&m_aWindow, WB_DROPDOWN | WB_VCENTER | WB_TABSTOP);
+ VclPtr<ListBox> pNewLB = VclPtr<ListBox>::Create(m_aWindow.get(), WB_DROPDOWN | WB_VCENTER | WB_TABSTOP);
pNewText->set_mnemonic_widget(pNewLB);
pNewLB->InsertEntry(SW_RESSTR(SW_STR_NONE));
pNewLB->SelectEntryPos(0);
@@ -861,7 +922,7 @@ void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
for(sal_Int32 nField = 0; nField < aFields.getLength(); ++nField)
pNewLB->InsertEntry(pFields[nField]);
- FixedText* pNewPreview = new FixedText(&m_aWindow, WB_VCENTER);
+ VclPtr<FixedText> pNewPreview = VclPtr<FixedText>::Create(m_aWindow.get(), WB_VCENTER);
pNewText->SetSizePixel(Size(nControlWidth - 6, nControlHeight));
pNewLB->SetSizePixel(Size(nControlWidth - 6, nControlHeight));
pNewPreview->SetSizePixel(Size(aOutputSize.Width() - 2 * nControlWidth, nControlHeight));
@@ -911,26 +972,38 @@ void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
pNewPreview->Show();
pNewPreview->SetPosPixel(Point(2 * nControlWidth + 6, nMove));
}
- m_aVScroll.SetRange(Range(0, rHeaders.Count()));
- m_aVScroll.SetPageSize((aOutputSize.Height() - nHBHeight - m_nLBStartTopPos)/ m_nYOffset);
- m_aVScroll.EnableDrag();
- m_aVScroll.SetVisibleSize(m_aVScroll.GetPageSize());
- m_aVScroll.SetScrollHdl(LINK(this, SwAssignFieldsControl, ScrollHdl_Impl));
+ m_aVScroll->SetRange(Range(0, rHeaders.Count()));
+ m_aVScroll->SetPageSize((aOutputSize.Height() - nHBHeight - m_nLBStartTopPos)/ m_nYOffset);
+ m_aVScroll->EnableDrag();
+ m_aVScroll->SetVisibleSize(m_aVScroll->GetPageSize());
+ m_aVScroll->SetScrollHdl(LINK(this, SwAssignFieldsControl, ScrollHdl_Impl));
- m_aVScroll.SetPosPixel(Point(aOutputSize.Width() - m_aVScroll.GetSizePixel().Width(), nHBHeight));
- m_aVScroll.SetSizePixel(Size(m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
+ m_aVScroll->SetPosPixel(Point(aOutputSize.Width() - m_aVScroll->GetSizePixel().Width(), nHBHeight));
+ m_aVScroll->SetSizePixel(Size(m_aVScroll->GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
}
SwAssignFieldsControl::~SwAssignFieldsControl()
{
- ::std::vector<FixedText*>::iterator aFIIter;
- for(aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter)
- delete *aFIIter;
- ::std::vector<ListBox*>::iterator aLBIter;
- for(aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter)
- delete *aLBIter;
- for(aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter)
- delete *aFIIter;
+ disposeOnce();
+}
+
+void SwAssignFieldsControl::dispose()
+{
+ for(auto aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter)
+ aFIIter->disposeAndClear();
+ for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter)
+ aLBIter->disposeAndClear();
+ for(auto aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter)
+ aFIIter->disposeAndClear();
+
+ m_aFieldNames.clear();
+ m_aMatches.clear();
+ m_aPreviews.clear();
+
+ m_aVScroll.disposeAndClear();
+ m_aHeaderHB.disposeAndClear();
+ m_aWindow.disposeAndClear();
+ Control::dispose();
}
void SwAssignFieldsControl::Resize()
@@ -938,22 +1011,22 @@ void SwAssignFieldsControl::Resize()
Window::Resize();
Size aOutputSize = GetOutputSize();
- long nHBHeight = m_aHeaderHB.CalcWindowSizePixel().Height();
+ long nHBHeight = m_aHeaderHB->CalcWindowSizePixel().Height();
- m_aWindow.SetSizePixel(Size(aOutputSize.Width() - m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
+ m_aWindow->SetSizePixel(Size(aOutputSize.Width() - m_aVScroll->GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
- m_aVScroll.SetPosPixel(Point(aOutputSize.Width() - m_aVScroll.GetSizePixel().Width(), nHBHeight));
- m_aVScroll.SetSizePixel(Size(m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
+ m_aVScroll->SetPosPixel(Point(aOutputSize.Width() - m_aVScroll->GetSizePixel().Width(), nHBHeight));
+ m_aVScroll->SetSizePixel(Size(m_aVScroll->GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
if(m_nYOffset)
- m_aVScroll.SetPageSize((aOutputSize.Height() - nHBHeight - m_nLBStartTopPos)/ m_nYOffset);
- m_aVScroll.SetVisibleSize(m_aVScroll.GetPageSize());
- m_aVScroll.DoScroll(0);
+ m_aVScroll->SetPageSize((aOutputSize.Height() - nHBHeight - m_nLBStartTopPos)/ m_nYOffset);
+ m_aVScroll->SetVisibleSize(m_aVScroll->GetPageSize());
+ m_aVScroll->DoScroll(0);
sal_Int32 nColWidth = aOutputSize.Width() / 3;
- m_aHeaderHB.SetSizePixel(Size(aOutputSize.Width(), nHBHeight));
- m_aHeaderHB.SetItemSize(1, nColWidth);
- m_aHeaderHB.SetItemSize(2, nColWidth);
- m_aHeaderHB.SetItemSize(3, nColWidth);
+ m_aHeaderHB->SetSizePixel(Size(aOutputSize.Width(), nHBHeight));
+ m_aHeaderHB->SetItemSize(1, nColWidth);
+ m_aHeaderHB->SetItemSize(2, nColWidth);
+ m_aHeaderHB->SetItemSize(3, nColWidth);
if (m_aFieldNames.empty() || m_aMatches.empty())
return;
@@ -961,16 +1034,14 @@ void SwAssignFieldsControl::Resize()
long nControlHeight = std::max(m_aFieldNames[0]->get_preferred_size().Height(),
m_aMatches[0]->get_preferred_size().Height());
- ::std::vector<FixedText*>::iterator aFIIter;
- for(aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter)
+ for(auto aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter)
(*aFIIter)->SetSizePixel(Size(nColWidth - 6, nControlHeight));
- ::std::vector<ListBox*>::iterator aLBIter;
- for(aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter)
+ for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter)
{
long nPosY = (*aLBIter)->GetPosPixel().Y();
(*aLBIter)->SetPosSizePixel(Point(nColWidth, nPosY), Size(nColWidth - 6, nControlHeight));
}
- for(aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter)
+ for(auto aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter)
{
long nPosY = (*aFIIter)->GetPosPixel().Y();
(*aFIIter)->SetPosSizePixel(Point(2 * nColWidth + 6, nPosY), Size(nColWidth, nControlHeight));
@@ -988,7 +1059,7 @@ void SwAssignFieldsControl::Command( const CommandEvent& rCEvt )
const CommandWheelData* pWheelData = rCEvt.GetWheelData();
if(pWheelData && !pWheelData->IsHorz() && CommandWheelMode::ZOOM != pWheelData->GetMode())
{
- HandleScrollCommand( rCEvt, 0, &m_aVScroll );
+ HandleScrollCommand( rCEvt, 0, m_aVScroll.get() );
}
}
break;
@@ -1014,15 +1085,15 @@ bool SwAssignFieldsControl::PreNotify( NotifyEvent& rNEvt )
void SwAssignFieldsControl::MakeVisible( sal_Int32 nIndex )
{
- long nThumb = m_aVScroll.GetThumbPos();
- long nPage = m_aVScroll.GetPageSize();
+ long nThumb = m_aVScroll->GetThumbPos();
+ long nPage = m_aVScroll->GetPageSize();
if(nThumb > nIndex)
- m_aVScroll.SetThumbPos( nIndex );
+ m_aVScroll->SetThumbPos( nIndex );
else if( (nThumb + nPage) < nIndex)
- m_aVScroll.SetThumbPos( nIndex - nPage );
+ m_aVScroll->SetThumbPos( nIndex - nPage );
else
return;
- ScrollHdl_Impl( &m_aVScroll );
+ ScrollHdl_Impl( m_aVScroll.get() );
}
IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll)
@@ -1035,14 +1106,11 @@ IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll)
long nMove = m_nFirstYPos - (*m_aMatches.begin())->GetPosPixel().Y() - (nThumb * m_nYOffset);
SetUpdateMode(false);
- long nIndex;
- ::std::vector<FixedText*>::iterator aFIIter;
- for(nIndex = 0, aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter, ++nIndex)
+ for(auto aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter)
lcl_Move(*aFIIter, nMove);
- ::std::vector<ListBox*>::iterator aLBIter;
- for(nIndex = 0, aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex)
+ for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter)
lcl_Move(*aLBIter, nMove);
- for(nIndex = 0, aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter, ++nIndex)
+ for(auto aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter)
lcl_Move(*aFIIter, nMove);
SetUpdateMode(true);
@@ -1071,9 +1139,8 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox)
}
}
}
- ::std::vector<ListBox*>::iterator aLBIter;
sal_Int32 nIndex = 0;
- for(aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex)
+ for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex)
{
if(*aLBIter == pBox)
{
@@ -1090,8 +1157,7 @@ IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox)
if(0 != (GETFOCUS_TAB & pBox->GetGetFocusFlags()))
{
sal_Int32 nIndex = 0;
- ::std::vector<ListBox*>::iterator aLBIter;
- for(aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex)
+ for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex)
{
if(*aLBIter == pBox)
{
@@ -1132,13 +1198,13 @@ SwAssignFieldsDialog::SwAssignFieldsDialog(
sAddressElement = SW_RESSTR(ST_SALUTATIONELEMENT);
}
- Size aOutputSize(m_pFieldsControl->m_aHeaderHB.GetSizePixel());
+ Size aOutputSize(m_pFieldsControl->m_aHeaderHB->GetSizePixel());
sal_Int32 nFirstWidth;
sal_Int32 nSecondWidth = nFirstWidth = aOutputSize.Width() / 3;
const HeaderBarItemBits nHeadBits = HeaderBarItemBits::VCENTER | HeaderBarItemBits::FIXED| HeaderBarItemBits::FIXEDPOS;
- m_pFieldsControl->m_aHeaderHB.InsertItem( 1, sAddressElement, nFirstWidth, nHeadBits|HeaderBarItemBits::LEFT);
- m_pFieldsControl->m_aHeaderHB.InsertItem( 2, sMatchesTo, nSecondWidth, nHeadBits|HeaderBarItemBits::LEFT);
- m_pFieldsControl->m_aHeaderHB.InsertItem( 3, sPreview,
+ m_pFieldsControl->m_aHeaderHB->InsertItem( 1, sAddressElement, nFirstWidth, nHeadBits|HeaderBarItemBits::LEFT);
+ m_pFieldsControl->m_aHeaderHB->InsertItem( 2, sMatchesTo, nSecondWidth, nHeadBits|HeaderBarItemBits::LEFT);
+ m_pFieldsControl->m_aHeaderHB->InsertItem( 3, sPreview,
aOutputSize.Width() - nFirstWidth - nSecondWidth, nHeadBits|HeaderBarItemBits::LEFT);
m_pFieldsControl->SetModifyHdl(LINK(this, SwAssignFieldsDialog, AssignmentModifyHdl_Impl ));
@@ -1150,6 +1216,17 @@ SwAssignFieldsDialog::SwAssignFieldsDialog(
SwAssignFieldsDialog::~SwAssignFieldsDialog()
{
+ disposeOnce();
+}
+
+void SwAssignFieldsDialog::dispose()
+{
+ m_pMatchingFI.clear();
+ m_pFieldsControl.clear();
+ m_pPreviewFI.clear();
+ m_pPreviewWIN.clear();
+ m_pOK.clear();
+ SfxModalDialog::dispose();
}
uno::Sequence< OUString > SwAssignFieldsDialog::CreateAssignments()
@@ -1157,9 +1234,8 @@ uno::Sequence< OUString > SwAssignFieldsDialog::CreateAssignments()
uno::Sequence< OUString > aAssignments(
m_rConfigItem.GetDefaultAddressHeaders().Count());
OUString* pAssignments = aAssignments.getArray();
- ::std::vector<ListBox*>::iterator aLBIter;
sal_Int32 nIndex = 0;
- for(aLBIter = m_pFieldsControl->m_aMatches.begin();
+ for(auto aLBIter = m_pFieldsControl->m_aMatches.begin();
aLBIter != m_pFieldsControl->m_aMatches.end();
++aLBIter, ++nIndex)
{
@@ -1202,6 +1278,18 @@ DDListBox::DDListBox(vcl::Window* pParent, WinBits nStyle)
}
+DDListBox::~DDListBox()
+{
+ disposeOnce();
+}
+
+void DDListBox::dispose()
+{
+ m_pParentDialog.clear();
+ SvTreeListBox::dispose();
+}
+
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeDDListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nWinStyle = WB_TABSTOP;
@@ -1246,6 +1334,19 @@ AddressMultiLineEdit::AddressMultiLineEdit(vcl::Window* pParent, WinBits nBits)
EnableFocusSelectionHide(false);
}
+AddressMultiLineEdit::~AddressMultiLineEdit()
+{
+ disposeOnce();
+}
+
+void AddressMultiLineEdit::dispose()
+{
+ EndListening(*GetTextEngine());
+ m_pParentDialog.clear();
+ VclMultiLineEdit::dispose();
+}
+
+
Size AddressMultiLineEdit::GetOptimalSize() const
{
return LogicToPixel(Size(160, 60), MAP_APPFONT);
@@ -1265,11 +1366,6 @@ void AddressMultiLineEdit::SetAddressDialog(SwCustomizeAddressBlockDialog *pPare
m_pParentDialog = pParent;
}
-AddressMultiLineEdit::~AddressMultiLineEdit()
-{
- EndListening(*GetTextEngine());
-}
-
void AddressMultiLineEdit::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
if (m_aSelectionLink.IsSet() && dynamic_cast<const TextHint*>(&rHint))
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index 6824bed6f897..2f93a750f1b1 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -37,31 +37,31 @@ class SwMailMergeConfigItem;
class SwMailMergeAddressBlockPage : public svt::OWizardPage
{
- PushButton* m_pAddressListPB;
- FixedText* m_pCurrentAddressFI;
+ VclPtr<PushButton> m_pAddressListPB;
+ VclPtr<FixedText> m_pCurrentAddressFI;
- VclContainer* m_pStep2;
- VclContainer* m_pStep3;
- VclContainer* m_pStep4;
+ VclPtr<VclContainer> m_pStep2;
+ VclPtr<VclContainer> m_pStep3;
+ VclPtr<VclContainer> m_pStep4;
- FixedText* m_pSettingsFI;
- CheckBox* m_pAddressCB;
- SwAddressPreview* m_pSettingsWIN;
- PushButton* m_pSettingsPB;
- CheckBox* m_pHideEmptyParagraphsCB;
+ VclPtr<FixedText> m_pSettingsFI;
+ VclPtr<CheckBox> m_pAddressCB;
+ VclPtr<SwAddressPreview> m_pSettingsWIN;
+ VclPtr<PushButton> m_pSettingsPB;
+ VclPtr<CheckBox> m_pHideEmptyParagraphsCB;
- PushButton* m_pAssignPB;
+ VclPtr<PushButton> m_pAssignPB;
- SwAddressPreview* m_pPreviewWIN;
- FixedText* m_pDocumentIndexFI;
- PushButton* m_pPrevSetIB;
- PushButton* m_pNextSetIB;
+ VclPtr<SwAddressPreview> m_pPreviewWIN;
+ VclPtr<FixedText> m_pDocumentIndexFI;
+ VclPtr<PushButton> m_pPrevSetIB;
+ VclPtr<PushButton> m_pNextSetIB;
OUString m_sDocument;
OUString m_sCurrentAddress;
OUString m_sChangeAddress;
- SwMailMergeWizard* m_pWizard;
+ VclPtr<SwMailMergeWizard> m_pWizard;
DECL_LINK(AddressListHdl_Impl, void *);
DECL_LINK(SettingsHdl_Impl, PushButton*);
@@ -79,20 +79,22 @@ class SwMailMergeAddressBlockPage : public svt::OWizardPage
public:
SwMailMergeAddressBlockPage(SwMailMergeWizard* _pParent);
+ virtual ~SwMailMergeAddressBlockPage();
+ virtual void dispose() SAL_OVERRIDE;
SwMailMergeWizard* GetWizard() { return m_pWizard; }
};
class SwSelectAddressBlockDialog : public SfxModalDialog
{
- SwAddressPreview* m_pPreview;
- PushButton* m_pNewPB;
- PushButton* m_pCustomizePB;
- PushButton* m_pDeletePB;
+ VclPtr<SwAddressPreview> m_pPreview;
+ VclPtr<PushButton> m_pNewPB;
+ VclPtr<PushButton> m_pCustomizePB;
+ VclPtr<PushButton> m_pDeletePB;
- RadioButton* m_pNeverRB;
- RadioButton* m_pAlwaysRB;
- RadioButton* m_pDependentRB;
- Edit* m_pCountryED;
+ VclPtr<RadioButton> m_pNeverRB;
+ VclPtr<RadioButton> m_pAlwaysRB;
+ VclPtr<RadioButton> m_pDependentRB;
+ VclPtr<Edit> m_pCountryED;
com::sun::star::uno::Sequence< OUString> m_aAddressBlocks;
SwMailMergeConfigItem& m_rConfig;
@@ -106,6 +108,7 @@ class SwSelectAddressBlockDialog : public SfxModalDialog
public:
SwSelectAddressBlockDialog(vcl::Window* pParent, SwMailMergeConfigItem& rConfig);
virtual ~SwSelectAddressBlockDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetAddressBlocks(const com::sun::star::uno::Sequence< OUString>& rBlocks,
sal_uInt16 nSelected);
@@ -119,9 +122,11 @@ public:
class SwCustomizeAddressBlockDialog;
class DDListBox : public SvTreeListBox
{
- SwCustomizeAddressBlockDialog* m_pParentDialog;
+ VclPtr<SwCustomizeAddressBlockDialog> m_pParentDialog;
public:
DDListBox(vcl::Window* pParent, const WinBits nStyle);
+ virtual ~DDListBox();
+ virtual void dispose() SAL_OVERRIDE;
void SetAddressDialog(SwCustomizeAddressBlockDialog *pParent);
@@ -136,7 +141,7 @@ public:
class AddressMultiLineEdit : public VclMultiLineEdit, public SfxListener
{
Link m_aSelectionLink;
- SwCustomizeAddressBlockDialog* m_pParentDialog;
+ VclPtr<SwCustomizeAddressBlockDialog> m_pParentDialog;
using VclMultiLineEdit::Notify;
@@ -147,6 +152,7 @@ protected:
public:
AddressMultiLineEdit(vcl::Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER);
virtual ~AddressMultiLineEdit();
+ virtual void dispose() SAL_OVERRIDE;
void SetAddressDialog(SwCustomizeAddressBlockDialog *pParent);
@@ -183,26 +189,26 @@ public:
GREETING_MALE
};
private:
- FixedText* m_pAddressElementsFT;
- DDListBox* m_pAddressElementsLB;
+ VclPtr<FixedText> m_pAddressElementsFT;
+ VclPtr<DDListBox> m_pAddressElementsLB;
- PushButton* m_pInsertFieldIB;
- PushButton* m_pRemoveFieldIB;
+ VclPtr<PushButton> m_pInsertFieldIB;
+ VclPtr<PushButton> m_pRemoveFieldIB;
- FixedText* m_pDragFT;
- AddressMultiLineEdit* m_pDragED;
- PushButton* m_pUpIB;
- PushButton* m_pLeftIB;
- PushButton* m_pRightIB;
- PushButton* m_pDownIB;
+ VclPtr<FixedText> m_pDragFT;
+ VclPtr<AddressMultiLineEdit> m_pDragED;
+ VclPtr<PushButton> m_pUpIB;
+ VclPtr<PushButton> m_pLeftIB;
+ VclPtr<PushButton> m_pRightIB;
+ VclPtr<PushButton> m_pDownIB;
- FixedText* m_pFieldFT;
- ComboBox* m_pFieldCB;
+ VclPtr<FixedText> m_pFieldFT;
+ VclPtr<ComboBox> m_pFieldCB;
TextFilter m_aTextFilter;
- SwAddressPreview* m_pPreviewWIN;
+ VclPtr<SwAddressPreview> m_pPreviewWIN;
- OKButton* m_pOK;
+ VclPtr<OKButton> m_pOK;
::std::vector<OUString> m_aSalutations;
::std::vector<OUString> m_aPunctuations;
@@ -228,6 +234,7 @@ private:
public:
SwCustomizeAddressBlockDialog(vcl::Window* pParent, SwMailMergeConfigItem& rConfig, DialogType);
virtual ~SwCustomizeAddressBlockDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetAddress(const OUString& rAddress);
OUString GetAddress();
@@ -236,14 +243,13 @@ public:
class SwAssignFieldsControl;
class SwAssignFieldsDialog : public SfxModalDialog
{
- FixedText *m_pMatchingFI;
- SwAssignFieldsControl *m_pFieldsControl;
+ VclPtr<FixedText> m_pMatchingFI;
+ VclPtr<SwAssignFieldsControl> m_pFieldsControl;
- FixedText *m_pPreviewFI;
- SwAddressPreview *m_pPreviewWIN;
+ VclPtr<FixedText> m_pPreviewFI;
+ VclPtr<SwAddressPreview> m_pPreviewWIN;
-
- OKButton *m_pOK;
+ VclPtr<OKButton> m_pOK;
OUString m_sNone;
OUString m_rPreviewString;
@@ -260,6 +266,7 @@ public:
const OUString& rPreview,
bool bIsAddressBlock);
virtual ~SwAssignFieldsDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 85440c6a4833..50fe45c17446 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -92,6 +92,21 @@ SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(SwMailMergeWizard* pParent)
SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage()
{
+ disposeOnce();
+}
+
+void SwMailMergeDocSelectPage::dispose()
+{
+ m_pCurrentDocRB.clear();
+ m_pNewDocRB.clear();
+ m_pLoadDocRB.clear();
+ m_pLoadTemplateRB.clear();
+ m_pRecentDocRB.clear();
+ m_pBrowseDocPB.clear();
+ m_pBrowseTemplatePB.clear();
+ m_pRecentDocLB.clear();
+ m_pWizard.clear();
+ svt::OWizardPage::dispose();
}
IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton)
@@ -111,7 +126,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
if(bTemplate)
{
m_pLoadTemplateRB->Check();
- boost::scoped_ptr<SfxNewFileDialog> pNewFileDlg(new SfxNewFileDialog(this, 0));
+ VclPtrInstance< SfxNewFileDialog > pNewFileDlg(this, 0);
sal_uInt16 nRet = pNewFileDlg->Execute();
if(RET_TEMPLATE_LOAD == nRet)
bTemplate = false;
diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx b/sw/source/ui/dbui/mmdocselectpage.hxx
index b2e241270faf..931fc4dbfce4 100644
--- a/sw/source/ui/dbui/mmdocselectpage.hxx
+++ b/sw/source/ui/dbui/mmdocselectpage.hxx
@@ -28,21 +28,21 @@ class SwMailMergeWizard;
class SwMailMergeDocSelectPage : public svt::OWizardPage
{
- RadioButton* m_pCurrentDocRB;
- RadioButton* m_pNewDocRB;
- RadioButton* m_pLoadDocRB;
- RadioButton* m_pLoadTemplateRB;
- RadioButton* m_pRecentDocRB;
+ VclPtr<RadioButton> m_pCurrentDocRB;
+ VclPtr<RadioButton> m_pNewDocRB;
+ VclPtr<RadioButton> m_pLoadDocRB;
+ VclPtr<RadioButton> m_pLoadTemplateRB;
+ VclPtr<RadioButton> m_pRecentDocRB;
- PushButton* m_pBrowseDocPB;
- PushButton* m_pBrowseTemplatePB;
+ VclPtr<PushButton> m_pBrowseDocPB;
+ VclPtr<PushButton> m_pBrowseTemplatePB;
- ListBox* m_pRecentDocLB;
+ VclPtr<ListBox> m_pRecentDocLB;
OUString m_sLoadFileName;
OUString m_sLoadTemplateName;
- SwMailMergeWizard* m_pWizard;
+ VclPtr<SwMailMergeWizard> m_pWizard;
DECL_LINK(DocSelectHdl, RadioButton*);
DECL_LINK(FileSelectHdl, PushButton*);
@@ -52,6 +52,7 @@ class SwMailMergeDocSelectPage : public svt::OWizardPage
public:
SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent);
virtual ~SwMailMergeDocSelectPage();
+ virtual void dispose() SAL_OVERRIDE;
};
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index 7355613e3ad2..717b1e1be2a3 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -106,8 +106,8 @@ IMPL_LINK_NOARG(SwGreetingsHandler, IndividualHdl_Impl)
IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, PushButton*, pButton)
{
- boost::scoped_ptr<SwCustomizeAddressBlockDialog> pDlg(
- new SwCustomizeAddressBlockDialog(pButton, m_pWizard->GetConfigItem(),
+ VclPtr<SwCustomizeAddressBlockDialog> pDlg(
+ VclPtr<SwCustomizeAddressBlockDialog>::Create(pButton, m_pWizard->GetConfigItem(),
pButton == m_pMalePB ?
SwCustomizeAddressBlockDialog::GREETING_MALE :
SwCustomizeAddressBlockDialog::GREETING_FEMALE ));
@@ -133,8 +133,8 @@ void SwGreetingsHandler::UpdatePreview()
IMPL_LINK(SwMailMergeGreetingsPage, AssignHdl_Impl, PushButton*, pButton)
{
const OUString sPreview(m_pFemaleLB->GetSelectEntry() + "\n" + m_pMaleLB->GetSelectEntry());
- boost::scoped_ptr<SwAssignFieldsDialog> pDlg(
- new SwAssignFieldsDialog(pButton, m_pWizard->GetConfigItem(), sPreview, false));
+ VclPtr<SwAssignFieldsDialog> pDlg(
+ VclPtr<SwAssignFieldsDialog>::Create(pButton, m_pWizard->GetConfigItem(), sPreview, false));
if(RET_OK == pDlg->Execute())
{
UpdatePreview();
@@ -292,6 +292,18 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage(SwMailMergeWizard* _pParent)
SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage()
{
+ disposeOnce();
+}
+
+void SwMailMergeGreetingsPage::dispose()
+{
+ m_pPreviewFI.clear();
+ m_pPreviewWIN.clear();
+ m_pAssignPB.clear();
+ m_pDocumentIndexFI.clear();
+ m_pPrevSetIB.clear();
+ m_pNextSetIB.clear();
+ svt::OWizardPage::dispose();
}
void SwMailMergeGreetingsPage::ActivatePage()
@@ -472,6 +484,15 @@ SwMailBodyDialog::SwMailBodyDialog(vcl::Window* pParent, SwMailMergeWizard* _pWi
SwMailBodyDialog::~SwMailBodyDialog()
{
+ disposeOnce();
+}
+
+void SwMailBodyDialog::dispose()
+{
+ m_pBodyFT.clear();
+ m_pBodyMLE.clear();
+ m_pOK.clear();
+ SfxModalDialog::dispose();
}
IMPL_LINK(SwMailBodyDialog, ContainsHdl_Impl, CheckBox*, pBox)
diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx
index d74b54224df9..d351191b6121 100644
--- a/sw/source/ui/dbui/mmgreetingspage.hxx
+++ b/sw/source/ui/dbui/mmgreetingspage.hxx
@@ -33,30 +33,30 @@ class SwMailMergeWizard;
class SwGreetingsHandler
{
protected:
- CheckBox* m_pGreetingLineCB;
+ VclPtr<CheckBox> m_pGreetingLineCB;
- CheckBox* m_pPersonalizedCB;
+ VclPtr<CheckBox> m_pPersonalizedCB;
- FixedText* m_pFemaleFT;
- ListBox* m_pFemaleLB;
- PushButton* m_pFemalePB;
+ VclPtr<FixedText> m_pFemaleFT;
+ VclPtr<ListBox> m_pFemaleLB;
+ VclPtr<PushButton> m_pFemalePB;
- FixedText* m_pMaleFT;
- ListBox* m_pMaleLB;
- PushButton* m_pMalePB;
+ VclPtr<FixedText> m_pMaleFT;
+ VclPtr<ListBox> m_pMaleLB;
+ VclPtr<PushButton> m_pMalePB;
- FixedText* m_pFemaleFI;
- FixedText* m_pFemaleColumnFT;
- ListBox* m_pFemaleColumnLB;
- FixedText* m_pFemaleFieldFT;
- ComboBox* m_pFemaleFieldCB;
+ VclPtr<FixedText> m_pFemaleFI;
+ VclPtr<FixedText> m_pFemaleColumnFT;
+ VclPtr<ListBox> m_pFemaleColumnLB;
+ VclPtr<FixedText> m_pFemaleFieldFT;
+ VclPtr<ComboBox> m_pFemaleFieldCB;
- FixedText* m_pNeutralFT;
- ComboBox* m_pNeutralCB;
+ VclPtr<FixedText> m_pNeutralFT;
+ VclPtr<ComboBox> m_pNeutralCB;
bool m_bIsTabPage;
- SwMailMergeWizard* m_pWizard;
+ VclPtr<SwMailMergeWizard> m_pWizard;
~SwGreetingsHandler() {}
@@ -70,12 +70,12 @@ protected:
class SwMailMergeGreetingsPage : public svt::OWizardPage,
public SwGreetingsHandler
{
- FixedText* m_pPreviewFI;
- SwAddressPreview* m_pPreviewWIN;
- PushButton* m_pAssignPB;
- FixedText* m_pDocumentIndexFI;
- PushButton* m_pPrevSetIB;
- PushButton* m_pNextSetIB;
+ VclPtr<FixedText> m_pPreviewFI;
+ VclPtr<SwAddressPreview> m_pPreviewWIN;
+ VclPtr<PushButton> m_pAssignPB;
+ VclPtr<FixedText> m_pDocumentIndexFI;
+ VclPtr<PushButton> m_pPrevSetIB;
+ VclPtr<PushButton> m_pNextSetIB;
OUString m_sDocument;
@@ -90,21 +90,23 @@ class SwMailMergeGreetingsPage : public svt::OWizardPage,
public:
SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent);
virtual ~SwMailMergeGreetingsPage();
+ virtual void dispose() SAL_OVERRIDE;
};
class SwMailBodyDialog : public SfxModalDialog, public SwGreetingsHandler
{
- FixedText *m_pBodyFT;
- VclMultiLineEdit *m_pBodyMLE;
+ VclPtr<FixedText> m_pBodyFT;
+ VclPtr<VclMultiLineEdit> m_pBodyMLE;
- OKButton *m_pOK;
+ VclPtr<OKButton> m_pOK;
DECL_LINK(ContainsHdl_Impl, CheckBox*);
DECL_LINK(OKHdl, void *);
public:
SwMailBodyDialog(vcl::Window* pParent, SwMailMergeWizard* pWizard);
virtual ~SwMailBodyDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetBody(const OUString& rBody ) {m_pBodyMLE->SetText(rBody);}
OUString GetBody() const {return m_pBodyMLE->GetText();}
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index a89ed65b32c5..e00f986e5ef0 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -155,9 +155,25 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
SwMailMergeLayoutPage::~SwMailMergeLayoutPage()
{
+ disposeOnce();
+}
+
+void SwMailMergeLayoutPage::dispose()
+{
delete m_pExampleFrame;
File::remove( m_sExampleURL );
-
+ m_pPosition.clear();
+ m_pAlignToBodyCB.clear();
+ m_pLeftFT.clear();
+ m_pLeftMF.clear();
+ m_pTopMF.clear();
+ m_pGreetingLine.clear();
+ m_pUpPB.clear();
+ m_pDownPB.clear();
+ m_pExampleContainerWIN.clear();
+ m_pZoomLB.clear();
+ m_pWizard.clear();
+ svt::OWizardPage::dispose();
}
void SwMailMergeLayoutPage::ActivatePage()
diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx
index c770705dccc5..5b9f9a8c3cc1 100644
--- a/sw/source/ui/dbui/mmlayoutpage.hxx
+++ b/sw/source/ui/dbui/mmlayoutpage.hxx
@@ -38,20 +38,20 @@ namespace com{ namespace sun{ namespace star{ namespace beans{ class XPropertySe
class SwMailMergeLayoutPage : public svt::OWizardPage
{
- VclContainer* m_pPosition;
+ VclPtr<VclContainer> m_pPosition;
- CheckBox* m_pAlignToBodyCB;
- FixedText* m_pLeftFT;
- MetricField* m_pLeftMF;
- MetricField* m_pTopMF;
+ VclPtr<CheckBox> m_pAlignToBodyCB;
+ VclPtr<FixedText> m_pLeftFT;
+ VclPtr<MetricField> m_pLeftMF;
+ VclPtr<MetricField> m_pTopMF;
- VclContainer* m_pGreetingLine;
- PushButton* m_pUpPB;
- PushButton* m_pDownPB;
+ VclPtr<VclContainer> m_pGreetingLine;
+ VclPtr<PushButton> m_pUpPB;
+ VclPtr<PushButton> m_pDownPB;
- vcl::Window* m_pExampleContainerWIN;
+ VclPtr<vcl::Window> m_pExampleContainerWIN;
- ListBox* m_pZoomLB;
+ VclPtr<ListBox> m_pZoomLB;
SwOneExampleFrame* m_pExampleFrame;
SwWrtShell* m_pExampleWrtShell;
@@ -61,7 +61,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage
bool m_bIsGreetingInserted;
- SwMailMergeWizard* m_pWizard;
+ VclPtr<SwMailMergeWizard> m_pWizard;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xViewProperties;
@@ -84,6 +84,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage
public:
SwMailMergeLayoutPage( SwMailMergeWizard* _pParent);
virtual ~SwMailMergeLayoutPage();
+ virtual void dispose() SAL_OVERRIDE;
static SwFrmFmt* InsertAddressAndGreeting(SwView* pView,
SwMailMergeConfigItem& rConfigItem,
diff --git a/sw/source/ui/dbui/mmmergepage.cxx b/sw/source/ui/dbui/mmmergepage.cxx
index f0fbebcaf046..98233636a574 100644
--- a/sw/source/ui/dbui/mmmergepage.cxx
+++ b/sw/source/ui/dbui/mmmergepage.cxx
@@ -50,6 +50,25 @@ SwMailMergeMergePage::SwMailMergeMergePage(SwMailMergeWizard* _pParent)
}
+SwMailMergeMergePage::~SwMailMergeMergePage()
+{
+ disposeOnce();
+}
+
+void SwMailMergeMergePage::dispose()
+{
+ m_pEditFI.clear();
+ m_pEditPB.clear();
+ m_pFindED.clear();
+ m_pFindPB.clear();
+ m_pWholeWordsCB.clear();
+ m_pBackwardsCB.clear();
+ m_pMatchCaseCB.clear();
+ m_pWizard.clear();
+ svt::OWizardPage::dispose();
+}
+
+
IMPL_LINK_NOARG(SwMailMergeMergePage, EditDocumentHdl_Impl)
{
m_pWizard->SetRestartPage(MM_MERGEPAGE);
diff --git a/sw/source/ui/dbui/mmmergepage.hxx b/sw/source/ui/dbui/mmmergepage.hxx
index b415586acc7d..2ff8187eff10 100644
--- a/sw/source/ui/dbui/mmmergepage.hxx
+++ b/sw/source/ui/dbui/mmmergepage.hxx
@@ -29,17 +29,17 @@ class SwMailMergeWizard;
class SwMailMergeMergePage : public svt::OWizardPage
{
- FixedText* m_pEditFI;
- PushButton* m_pEditPB;
+ VclPtr<FixedText> m_pEditFI;
+ VclPtr<PushButton> m_pEditPB;
- ReturnActionEdit* m_pFindED;
- PushButton* m_pFindPB;
+ VclPtr<ReturnActionEdit> m_pFindED;
+ VclPtr<PushButton> m_pFindPB;
- CheckBox* m_pWholeWordsCB;
- CheckBox* m_pBackwardsCB;
- CheckBox* m_pMatchCaseCB;
+ VclPtr<CheckBox> m_pWholeWordsCB;
+ VclPtr<CheckBox> m_pBackwardsCB;
+ VclPtr<CheckBox> m_pMatchCaseCB;
- SwMailMergeWizard* m_pWizard;
+ VclPtr<SwMailMergeWizard> m_pWizard;
DECL_LINK(EditDocumentHdl_Impl, void *);
DECL_LINK(FindHdl_Impl, void *);
@@ -47,6 +47,8 @@ class SwMailMergeMergePage : public svt::OWizardPage
public:
SwMailMergeMergePage( SwMailMergeWizard* _pParent);
+ virtual ~SwMailMergeMergePage();
+ virtual void dispose() SAL_OVERRIDE;
};
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 586303caa0e1..6c92c26f8b8c 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -194,8 +194,8 @@ IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, Edit*, pEdit)
class SwCopyToDialog : public SfxModalDialog
{
- Edit* m_pCCED;
- Edit* m_pBCCED;
+ VclPtr<Edit> m_pCCED;
+ VclPtr<Edit> m_pBCCED;
public:
SwCopyToDialog(vcl::Window* pParent)
@@ -205,6 +205,13 @@ public:
get(m_pCCED, "cc");
get(m_pBCCED, "bcc");
}
+ virtual ~SwCopyToDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ m_pCCED.clear();
+ m_pBCCED.clear();
+ SfxModalDialog::dispose();
+ }
OUString GetCC() {return m_pCCED->GetText();}
void SetCC(const OUString& rSet) {m_pCCED->SetText(rSet);}
@@ -300,7 +307,44 @@ SwMailMergeOutputPage::SwMailMergeOutputPage(SwMailMergeWizard* _pParent)
SwMailMergeOutputPage::~SwMailMergeOutputPage()
{
- delete m_pTempPrinter;
+ disposeOnce();
+}
+
+void SwMailMergeOutputPage::dispose()
+{
+ m_pTempPrinter.disposeAndClear();
+ m_pSaveStartDocRB.clear();
+ m_pSaveMergedDocRB.clear();
+ m_pPrintRB.clear();
+ m_pSendMailRB.clear();
+ m_pSeparator.clear();
+ m_pSaveStartDocPB.clear();
+ m_pSaveAsOneRB.clear();
+ m_pSaveIndividualRB.clear();
+ m_pPrintAllRB.clear();
+ m_pSendAllRB.clear();
+ m_pFromRB.clear();
+ m_pFromNF.clear();
+ m_pToFT.clear();
+ m_pToNF.clear();
+ m_pSaveNowPB.clear();
+ m_pPrinterFT.clear();
+ m_pPrinterLB.clear();
+ m_pPrinterSettingsPB.clear();
+ m_pPrintNowPB.clear();
+ m_pMailToFT.clear();
+ m_pMailToLB.clear();
+ m_pCopyToPB.clear();
+ m_pSubjectFT.clear();
+ m_pSubjectED.clear();
+ m_pSendAsFT.clear();
+ m_pSendAsLB.clear();
+ m_pAttachmentGroup.clear();
+ m_pAttachmentED.clear();
+ m_pSendAsPB.clear();
+ m_pSendDocumentsPB.clear();
+ m_pWizard.clear();
+ svt::OWizardPage::dispose();
}
void SwMailMergeOutputPage::ActivatePage()
@@ -479,7 +523,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton)
SendTypeHdl_Impl(m_pSendAsLB);
}
}
- m_pFromRB->GetClickHdl().Call(m_pFromRB->IsChecked() ? m_pFromRB : 0);
+ m_pFromRB->GetClickHdl().Call(m_pFromRB->IsChecked() ? m_pFromRB.get() : 0);
SetUpdateMode(false);
return 0;
@@ -496,7 +540,7 @@ IMPL_LINK(SwMailMergeOutputPage, DocumentSelectionHdl_Impl, RadioButton*, pButto
IMPL_LINK(SwMailMergeOutputPage, CopyToHdl_Impl, PushButton*, pButton)
{
- boost::scoped_ptr<SwCopyToDialog> pDlg(new SwCopyToDialog(pButton));
+ ScopedVclPtrInstance< SwCopyToDialog > pDlg(pButton);
pDlg->SetCC(m_sCC );
pDlg->SetBCC(m_sBCC);
if(RET_OK == pDlg->Execute())
@@ -689,12 +733,12 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
}
SwView* pSourceView = rConfigItem.GetSourceView();
- PrintMonitor aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE);
- aSaveMonitor.m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22));
- aSaveMonitor.SetCancelHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl));
- aSaveMonitor.m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) );
+ ScopedVclPtrInstance< PrintMonitor > aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE);
+ aSaveMonitor->m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22));
+ aSaveMonitor->SetCancelHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl));
+ aSaveMonitor->m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) );
m_bCancelSaving = false;
- aSaveMonitor.Show();
+ aSaveMonitor->Show();
m_pWizard->enableButtons(WZB_CANCEL, false);
for(sal_uInt32 nDoc = nBegin; nDoc < nEnd && !m_bCancelSaving; ++nDoc)
@@ -707,7 +751,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
sPath += "." + sExtension;
}
OUString sStat = OUString(SW_RES(STR_STATSTR_LETTER)) + " " + OUString::number( nDoc );
- aSaveMonitor.m_pPrintInfo->SetText(sStat);
+ aSaveMonitor->m_pPrintInfo->SetText(sStat);
//now extract a document from the target document
// the shell will be closed at the end, but it is more safe to use SfxObjectShellLock here
@@ -755,9 +799,9 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
if(bFailed)
{
- SwSaveWarningBox_Impl aWarning( pButton, sOutPath );
- if(RET_OK == aWarning.Execute())
- sOutPath = aWarning.GetFileName();
+ ScopedVclPtrInstance< SwSaveWarningBox_Impl > aWarning( pButton, sOutPath );
+ if(RET_OK == aWarning->Execute())
+ sOutPath = aWarning->GetFileName();
else
{
xTempDocShell->DoClose();
@@ -794,23 +838,23 @@ IMPL_LINK(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox*, pBox)
if ((pDocumentPrinter->GetName() == pInfo->GetPrinterName()) &&
(pDocumentPrinter->GetDriverName() == pInfo->GetDriver()))
{
- m_pTempPrinter = new Printer(pDocumentPrinter->GetJobSetup());
+ m_pTempPrinter = VclPtr<Printer>::Create(pDocumentPrinter->GetJobSetup());
}
else
- m_pTempPrinter = new Printer( *pInfo );
+ m_pTempPrinter = VclPtr<Printer>::Create( *pInfo );
}
else
{
if( (m_pTempPrinter->GetName() != pInfo->GetPrinterName()) ||
(m_pTempPrinter->GetDriverName() != pInfo->GetDriver()) )
{
- delete m_pTempPrinter;
- m_pTempPrinter = new Printer( *pInfo );
+ m_pTempPrinter.disposeAndClear();
+ m_pTempPrinter = VclPtr<Printer>::Create( *pInfo );
}
}
}
else if( ! m_pTempPrinter )
- m_pTempPrinter = new Printer();
+ m_pTempPrinter = VclPtr<Printer>::Create();
m_pPrinterSettingsPB->Enable( m_pTempPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
}
@@ -916,7 +960,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox)
IMPL_LINK(SwMailMergeOutputPage, SendAsHdl_Impl, PushButton*, pButton)
{
- SwMailBodyDialog* pDlg = new SwMailBodyDialog(pButton, m_pWizard);
+ VclPtr<SwMailBodyDialog> pDlg = VclPtr<SwMailBodyDialog>::Create(pButton, m_pWizard);
pDlg->SetBody(m_sBody);
if(RET_OK == pDlg->Execute())
{
@@ -939,12 +983,12 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
if(rConfigItem.GetMailServer().isEmpty() ||
!SwMailMergeHelper::CheckMailAddress(rConfigItem.GetMailAddress()) )
{
- QueryBox aQuery(pButton, WB_YES_NO_CANCEL, m_sConfigureMail);
- sal_uInt16 nRet = aQuery.Execute();
+ ScopedVclPtrInstance< QueryBox > aQuery(pButton, WB_YES_NO_CANCEL, m_sConfigureMail);
+ sal_uInt16 nRet = aQuery->Execute();
if(RET_YES == nRet )
{
SfxAllItemSet aSet(pTargetView->GetPool());
- boost::scoped_ptr<SwMailConfigDlg> pDlg(new SwMailConfigDlg(pButton, aSet));
+ ScopedVclPtrInstance< SwMailConfigDlg > pDlg(pButton, aSet);
nRet = pDlg->Execute();
}
@@ -1033,26 +1077,26 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
if(m_pSubjectED->GetText().isEmpty())
{
- SwSendQueryBox_Impl aQuery(pButton, "SubjectDialog",
- "modules/swriter/ui/subjectdialog.ui");
- aQuery.SetIsEmptyTextAllowed(true);
- aQuery.SetValue(m_sNoSubjectST);
- if(RET_OK == aQuery.Execute())
+ ScopedVclPtrInstance<SwSendQueryBox_Impl> aQuery(pButton, "SubjectDialog",
+ "modules/swriter/ui/subjectdialog.ui");
+ aQuery->SetIsEmptyTextAllowed(true);
+ aQuery->SetValue(m_sNoSubjectST);
+ if(RET_OK == aQuery->Execute())
{
- if(aQuery.GetValue() != m_sNoSubjectST)
- m_pSubjectED->SetText(aQuery.GetValue());
+ if(aQuery->GetValue() != m_sNoSubjectST)
+ m_pSubjectED->SetText(aQuery->GetValue());
}
else
return 0;
}
if(!bAsBody && m_pAttachmentED->GetText().isEmpty())
{
- SwSendQueryBox_Impl aQuery(pButton, "AttachNameDialog",
- "modules/swriter/ui/attachnamedialog.ui");
- aQuery.SetIsEmptyTextAllowed(false);
- if(RET_OK == aQuery.Execute())
+ ScopedVclPtrInstance<SwSendQueryBox_Impl> aQuery(pButton, "AttachNameDialog",
+ "modules/swriter/ui/attachnamedialog.ui");
+ aQuery->SetIsEmptyTextAllowed(false);
+ if(RET_OK == aQuery->Execute())
{
- OUString sAttach(aQuery.GetValue());
+ OUString sAttach(aQuery->GetValue());
sal_Int32 nTokenCount = comphelper::string::getTokenCount(sAttach, '.');
if (2 > nTokenCount)
{
@@ -1101,7 +1145,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
xStore->storeToURL( sTargetTempURL, aValues );
//create the send dialog
- SwSendMailDialog* pDlg = new SwSendMailDialog( pButton, rConfigItem );
+ VclPtr<SwSendMailDialog> pDlg = VclPtr<SwSendMailDialog>::Create( pButton, rConfigItem );
pDlg->SetDocumentCount( nEnd );
pDlg->ShowDialog();
//help to force painting the dialog
diff --git a/sw/source/ui/dbui/mmoutputpage.hxx b/sw/source/ui/dbui/mmoutputpage.hxx
index a31ddeaa3564..470a72e04689 100644
--- a/sw/source/ui/dbui/mmoutputpage.hxx
+++ b/sw/source/ui/dbui/mmoutputpage.hxx
@@ -45,42 +45,42 @@ namespace com{ namespace sun{ namespace star{
class SwMailMergeOutputPage : public svt::OWizardPage
{
- RadioButton* m_pSaveStartDocRB;
- RadioButton* m_pSaveMergedDocRB;
- RadioButton* m_pPrintRB;
- RadioButton* m_pSendMailRB;
+ VclPtr<RadioButton> m_pSaveStartDocRB;
+ VclPtr<RadioButton> m_pSaveMergedDocRB;
+ VclPtr<RadioButton> m_pPrintRB;
+ VclPtr<RadioButton> m_pSendMailRB;
- VclFrame* m_pSeparator;
+ VclPtr<VclFrame> m_pSeparator;
- PushButton* m_pSaveStartDocPB;
+ VclPtr<PushButton> m_pSaveStartDocPB;
- RadioButton* m_pSaveAsOneRB;
- RadioButton* m_pSaveIndividualRB;
- RadioButton* m_pPrintAllRB; //has to be here for tab control reasons
- RadioButton* m_pSendAllRB; //has to be here for tab control reasons
+ VclPtr<RadioButton> m_pSaveAsOneRB;
+ VclPtr<RadioButton> m_pSaveIndividualRB;
+ VclPtr<RadioButton> m_pPrintAllRB; //has to be here for tab control reasons
+ VclPtr<RadioButton> m_pSendAllRB; //has to be here for tab control reasons
//this group is used in save and print
- RadioButton* m_pFromRB;
- NumericField* m_pFromNF;
- FixedText* m_pToFT;
- NumericField* m_pToNF;
- PushButton* m_pSaveNowPB;
-
- FixedText* m_pPrinterFT;
- ListBox* m_pPrinterLB;
- PushButton* m_pPrinterSettingsPB;
- PushButton* m_pPrintNowPB;
-
- FixedText* m_pMailToFT;
- ListBox* m_pMailToLB;
- PushButton* m_pCopyToPB;
- FixedText* m_pSubjectFT;
- Edit* m_pSubjectED;
- FixedText* m_pSendAsFT;
- ListBox* m_pSendAsLB;
- VclContainer* m_pAttachmentGroup;
- Edit* m_pAttachmentED;
- PushButton* m_pSendAsPB;
- PushButton* m_pSendDocumentsPB;
+ VclPtr<RadioButton> m_pFromRB;
+ VclPtr<NumericField> m_pFromNF;
+ VclPtr<FixedText> m_pToFT;
+ VclPtr<NumericField> m_pToNF;
+ VclPtr<PushButton> m_pSaveNowPB;
+
+ VclPtr<FixedText> m_pPrinterFT;
+ VclPtr<ListBox> m_pPrinterLB;
+ VclPtr<PushButton> m_pPrinterSettingsPB;
+ VclPtr<PushButton> m_pPrintNowPB;
+
+ VclPtr<FixedText> m_pMailToFT;
+ VclPtr<ListBox> m_pMailToLB;
+ VclPtr<PushButton> m_pCopyToPB;
+ VclPtr<FixedText> m_pSubjectFT;
+ VclPtr<Edit> m_pSubjectED;
+ VclPtr<FixedText> m_pSendAsFT;
+ VclPtr<ListBox> m_pSendAsLB;
+ VclPtr<VclContainer> m_pAttachmentGroup;
+ VclPtr<Edit> m_pAttachmentED;
+ VclPtr<PushButton> m_pSendAsPB;
+ VclPtr<PushButton> m_pSendDocumentsPB;
//some FixedLine labels
OUString m_sSaveStartST;
@@ -97,10 +97,10 @@ class SwMailMergeOutputPage : public svt::OWizardPage
bool m_bCancelSaving;
- SwMailMergeWizard* m_pWizard;
+ VclPtr<SwMailMergeWizard> m_pWizard;
//some dialog data
- Printer* m_pTempPrinter;
+ VclPtr<Printer> m_pTempPrinter;
OUString m_sCC;
OUString m_sBCC;
@@ -126,6 +126,7 @@ protected:
public:
SwMailMergeOutputPage( SwMailMergeWizard* _pParent);
virtual ~SwMailMergeOutputPage();
+ virtual void dispose() SAL_OVERRIDE;
};
@@ -146,17 +147,17 @@ struct SwSendMailDialog_Impl;
class SwMailMergeConfigItem;
class SwSendMailDialog : public ModelessDialog //SfxModalDialog
{
- FixedText *m_pTransferStatus;
- FixedText *m_pPaused;
- ProgressBar *m_pProgressBar;
- FixedText *m_pErrorStatus;
+ VclPtr<FixedText> m_pTransferStatus;
+ VclPtr<FixedText> m_pPaused;
+ VclPtr<ProgressBar> m_pProgressBar;
+ VclPtr<FixedText> m_pErrorStatus;
- SvSimpleTableContainer *m_pContainer;
- HeaderBar *m_pStatusHB;
- SvSimpleTable *m_pStatus;
+ VclPtr<SvSimpleTableContainer> m_pContainer;
+ VclPtr<HeaderBar> m_pStatusHB;
+ VclPtr<SvSimpleTable> m_pStatus;
- PushButton *m_pStop;
- PushButton *m_pClose;
+ VclPtr<PushButton> m_pStop;
+ VclPtr<PushButton> m_pClose;
OUString m_sContinue;
OUString m_sStop;
@@ -192,6 +193,7 @@ class SwSendMailDialog : public ModelessDialog //SfxModalDialog
public:
SwSendMailDialog( vcl::Window* pParent, SwMailMergeConfigItem& );
virtual ~SwSendMailDialog();
+ virtual void dispose() SAL_OVERRIDE;
void AddDocument( SwMailDescriptor& rDesc );
void SetDocumentCount( sal_Int32 nAllDocuments );
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index a1dc8affad88..e15e757421e7 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -48,6 +48,22 @@ SwMailMergeOutputTypePage::SwMailMergeOutputTypePage(SwMailMergeWizard* pParent)
}
+SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage()
+{
+ disposeOnce();
+}
+
+void SwMailMergeOutputTypePage::dispose()
+{
+ m_pLetterRB.clear();
+ m_pMailRB.clear();
+ m_pLetterHint.clear();
+ m_pMailHint.clear();
+ m_pWizard.clear();
+ svt::OWizardPage::dispose();
+}
+
+
IMPL_LINK_NOARG(SwMailMergeOutputTypePage, TypeHdl_Impl)
{
bool bLetter = m_pLetterRB->IsChecked();
@@ -123,7 +139,7 @@ const SwMailDescriptor* SwSendMailDialog_Impl::GetNextDescriptor()
using namespace ::com::sun::star;
class SwMailDispatcherListener_Impl : public IMailDispatcherListener
{
- SwSendMailDialog* m_pSendMailDialog;
+ VclPtr<SwSendMailDialog> m_pSendMailDialog;
public:
SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg);
@@ -208,9 +224,15 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa
class SwSendWarningBox_Impl : public MessageDialog
{
- VclMultiLineEdit *m_pDetailED;
+ VclPtr<VclMultiLineEdit> m_pDetailED;
public:
SwSendWarningBox_Impl(vcl::Window* pParent, const OUString& rDetails);
+ virtual ~SwSendWarningBox_Impl() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ m_pDetailED.clear();
+ MessageDialog::dispose();
+ }
};
SwSendWarningBox_Impl::SwSendWarningBox_Impl(vcl::Window* pParent, const OUString& rDetails)
@@ -253,7 +275,7 @@ SwSendMailDialog::SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem&
Size aSize = m_pContainer->LogicToPixel(Size(226, 80), MAP_APPFONT);
m_pContainer->set_width_request(aSize.Width());
m_pContainer->set_height_request(aSize.Height());
- m_pStatus = new SvSimpleTable(*m_pContainer);
+ m_pStatus = VclPtr<SvSimpleTable>::Create(*m_pContainer);
m_pStatusHB = &(m_pStatus->GetTheHeaderBar());
m_nStatusHeight = m_pContainer->get_height_request();
@@ -283,6 +305,11 @@ SwSendMailDialog::SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem&
SwSendMailDialog::~SwSendMailDialog()
{
+ disposeOnce();
+}
+
+void SwSendMailDialog::dispose()
+{
if(m_pImpl->xMailDispatcher.is())
{
try
@@ -306,8 +333,17 @@ SwSendMailDialog::~SwSendMailDialog()
{
}
}
- delete m_pStatus;
delete m_pImpl;
+ m_pStatus.disposeAndClear();
+ m_pTransferStatus.clear();
+ m_pPaused.clear();
+ m_pProgressBar.clear();
+ m_pErrorStatus.clear();
+ m_pContainer.clear();
+ m_pStatusHB.clear();
+ m_pStop.clear();
+ m_pClose.clear();
+ ModelessDialog::dispose();
}
void SwSendMailDialog::AddDocument( SwMailDescriptor& rDesc )
@@ -375,7 +411,7 @@ IMPL_STATIC_LINK( SwSendMailDialog, RemoveThis, Timer*, pTimer )
(!pThis->m_pImpl->xMailDispatcher.is() ||
!pThis->m_pImpl->xMailDispatcher->isRunning()))
{
- delete pThis;
+ pThis->disposeOnce();
}
else
{
@@ -546,7 +582,7 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag
if (pError)
{
- boost::scoped_ptr<SwSendWarningBox_Impl> pDlg(new SwSendWarningBox_Impl(0, *pError));
+ VclPtrInstance< SwSendWarningBox_Impl > pDlg(nullptr, *pError);
pDlg->Execute();
}
}
diff --git a/sw/source/ui/dbui/mmoutputtypepage.hxx b/sw/source/ui/dbui/mmoutputtypepage.hxx
index 81769f2b6863..9c967c05f7fb 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.hxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.hxx
@@ -27,18 +27,20 @@ class SwMailMergeWizard;
class SwMailMergeOutputTypePage : public svt::OWizardPage
{
- RadioButton* m_pLetterRB;
- RadioButton* m_pMailRB;
+ VclPtr<RadioButton> m_pLetterRB;
+ VclPtr<RadioButton> m_pMailRB;
- FixedText* m_pLetterHint;
- FixedText* m_pMailHint;
+ VclPtr<FixedText> m_pLetterHint;
+ VclPtr<FixedText> m_pMailHint;
- SwMailMergeWizard* m_pWizard;
+ VclPtr<SwMailMergeWizard> m_pWizard;
DECL_LINK(TypeHdl_Impl, void *);
public:
SwMailMergeOutputTypePage( SwMailMergeWizard* _pParent);
+ virtual ~SwMailMergeOutputTypePage();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif
diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx
index 272ae0f6cb8e..702b26b156b1 100644
--- a/sw/source/ui/dbui/mmpreparemergepage.cxx
+++ b/sw/source/ui/dbui/mmpreparemergepage.cxx
@@ -58,6 +58,24 @@ SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pP
aMoveLink.Call(m_pRecordED);
}
+SwMailMergePrepareMergePage::~SwMailMergePrepareMergePage()
+{
+ disposeOnce();
+}
+
+void SwMailMergePrepareMergePage::dispose()
+{
+ m_pFirstPB.clear();
+ m_pPrevPB.clear();
+ m_pRecordED.clear();
+ m_pNextPB.clear();
+ m_pLastPB.clear();
+ m_pExcludeCB.clear();
+ m_pEditPB.clear();
+ m_pWizard.clear();
+ svt::OWizardPage::dispose();
+}
+
IMPL_LINK_NOARG(SwMailMergePrepareMergePage, EditDocumentHdl_Impl)
{
m_pWizard->SetRestartPage(MM_PREPAREMERGEPAGE);
diff --git a/sw/source/ui/dbui/mmpreparemergepage.hxx b/sw/source/ui/dbui/mmpreparemergepage.hxx
index bdaef54ae3ff..8bfdfbe94158 100644
--- a/sw/source/ui/dbui/mmpreparemergepage.hxx
+++ b/sw/source/ui/dbui/mmpreparemergepage.hxx
@@ -29,16 +29,16 @@ class SwMailMergeWizard;
class SwMailMergePrepareMergePage : public svt::OWizardPage
{
- PushButton* m_pFirstPB;
- PushButton* m_pPrevPB;
- NumericField* m_pRecordED;
- PushButton* m_pNextPB;
- PushButton* m_pLastPB;
- CheckBox* m_pExcludeCB;
+ VclPtr<PushButton> m_pFirstPB;
+ VclPtr<PushButton> m_pPrevPB;
+ VclPtr<NumericField> m_pRecordED;
+ VclPtr<PushButton> m_pNextPB;
+ VclPtr<PushButton> m_pLastPB;
+ VclPtr<CheckBox> m_pExcludeCB;
- PushButton* m_pEditPB;
+ VclPtr<PushButton> m_pEditPB;
- SwMailMergeWizard* m_pWizard;
+ VclPtr<SwMailMergeWizard> m_pWizard;
DECL_LINK(EditDocumentHdl_Impl, void *);
DECL_LINK(ExcludeHdl_Impl, CheckBox*);
@@ -49,6 +49,8 @@ class SwMailMergePrepareMergePage : public svt::OWizardPage
public:
SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent);
+ virtual ~SwMailMergePrepareMergePage();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index 1386638a4e20..1db947e9f3d4 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -105,7 +105,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent,
Size aSize = pHeaderTreeContainer->LogicToPixel(Size(238 , 50), MAP_APPFONT);
pHeaderTreeContainer->set_width_request(aSize.Width());
pHeaderTreeContainer->set_height_request(aSize.Height());
- m_pTable = new SwAddressTable(*pHeaderTreeContainer);
+ m_pTable = VclPtr<SwAddressTable>::Create(*pHeaderTreeContainer);
long aStaticTabs[]= { 2, 0, 0 };
m_pTable->SetTabs( aStaticTabs );
m_pTable->InsertHeaderItem(1, m_sName, HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER);
@@ -147,7 +147,14 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent,
SwSelectDBTableDialog::~SwSelectDBTableDialog()
{
- delete m_pTable;
+ disposeOnce();
+}
+
+void SwSelectDBTableDialog::dispose()
+{
+ m_pTable.disposeAndClear();
+ m_pPreviewPB.clear();
+ SfxModalDialog::dispose();
}
IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton)
@@ -180,7 +187,7 @@ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton)
pProperties[4].Name = "ShowTreeViewButton";
pProperties[4].Value <<= sal_False;
- boost::scoped_ptr<SwDBTablePreviewDialog> pDlg(new SwDBTablePreviewDialog(pButton, aProperties));
+ VclPtrInstance< SwDBTablePreviewDialog > pDlg(pButton, aProperties);
pDlg->Execute();
}
diff --git a/sw/source/ui/dbui/selectdbtabledialog.hxx b/sw/source/ui/dbui/selectdbtabledialog.hxx
index 729675e831b9..b02b74b2cb72 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.hxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.hxx
@@ -35,8 +35,8 @@ class SwAddressTable;
class SwSelectDBTableDialog : public SfxModalDialog
{
- SwAddressTable* m_pTable;
- PushButton* m_pPreviewPB;
+ VclPtr<SwAddressTable> m_pTable;
+ VclPtr<PushButton> m_pPreviewPB;
OUString m_sName;
OUString m_sType;
@@ -50,6 +50,7 @@ public:
SwSelectDBTableDialog(vcl::Window* pParent,
const css::uno::Reference<css::sdbc::XConnection>& xConnection);
virtual ~SwSelectDBTableDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetSelectedTable(bool& bIsTable);
void SetSelectedTable(const OUString& rTable, bool bIsTable);