summaryrefslogtreecommitdiff
path: root/sw/source/ui/envelp
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/envelp')
-rw-r--r--sw/source/ui/envelp/envfmt.cxx27
-rw-r--r--sw/source/ui/envelp/envfmt.hxx27
-rw-r--r--sw/source/ui/envelp/envlop1.cxx24
-rw-r--r--sw/source/ui/envelp/envprt.cxx23
-rw-r--r--sw/source/ui/envelp/envprt.hxx23
-rw-r--r--sw/source/ui/envelp/label1.cxx130
-rw-r--r--sw/source/ui/envelp/labfmt.cxx51
-rw-r--r--sw/source/ui/envelp/labfmt.hxx46
-rw-r--r--sw/source/ui/envelp/labprt.cxx23
-rw-r--r--sw/source/ui/envelp/labprt.hxx28
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx60
-rw-r--r--sw/source/ui/envelp/swuilabimp.hxx131
12 files changed, 431 insertions, 162 deletions
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 2e9ea372b3e7..0fa73fb0171d 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -197,6 +197,27 @@ SwEnvFmtPage::SwEnvFmtPage(vcl::Window* pParent, const SfxItemSet& rSet)
}
+SwEnvFmtPage::~SwEnvFmtPage()
+{
+ disposeOnce();
+}
+
+void SwEnvFmtPage::dispose()
+{
+ m_pAddrLeftField.clear();
+ m_pAddrTopField.clear();
+ m_pAddrEditButton.clear();
+ m_pSendLeftField.clear();
+ m_pSendTopField.clear();
+ m_pSendEditButton.clear();
+ m_pSizeFormatBox.clear();
+ m_pSizeWidthField.clear();
+ m_pSizeHeightField.clear();
+ m_pPreview.clear();
+ SfxTabPage::dispose();
+}
+
+
IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit )
{
long lWVal = static_cast< long >(GetFldVal(*m_pSizeWidthField ));
@@ -298,7 +319,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
::PrepareBoxInfo( aTmpSet, *pSh );
const OUString sFmtStr = pColl->GetName();
- boost::scoped_ptr<SwParaDlg> pDlg(new SwParaDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, DLG_ENVELOP, &sFmtStr));
+ VclPtrInstance< SwParaDlg > pDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, DLG_ENVELOP, &sFmtStr);
if ( pDlg->Execute() == RET_OK )
{
@@ -440,9 +461,9 @@ void SwEnvFmtPage::SetMinMax()
m_pSizeHeightField->Reformat();
}
-SfxTabPage* SwEnvFmtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SwEnvFmtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SwEnvFmtPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>(new SwEnvFmtPage(pParent, *rSet), SAL_NO_ACQUIRE);
}
void SwEnvFmtPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx
index 73cb44d3647d..744f576dd9c7 100644
--- a/sw/source/ui/envelp/envfmt.hxx
+++ b/sw/source/ui/envelp/envfmt.hxx
@@ -30,21 +30,19 @@ class SwTxtFmtColl;
class SwEnvFmtPage : public SfxTabPage
{
- MetricField* m_pAddrLeftField;
- MetricField* m_pAddrTopField;
- MenuButton* m_pAddrEditButton;
- MetricField* m_pSendLeftField;
- MetricField* m_pSendTopField;
- MenuButton* m_pSendEditButton;
- ListBox* m_pSizeFormatBox;
- MetricField* m_pSizeWidthField;
- MetricField* m_pSizeHeightField;
- SwEnvPreview* m_pPreview;
+ VclPtr<MetricField> m_pAddrLeftField;
+ VclPtr<MetricField> m_pAddrTopField;
+ VclPtr<MenuButton> m_pAddrEditButton;
+ VclPtr<MetricField> m_pSendLeftField;
+ VclPtr<MetricField> m_pSendTopField;
+ VclPtr<MenuButton> m_pSendEditButton;
+ VclPtr<ListBox> m_pSizeFormatBox;
+ VclPtr<MetricField> m_pSizeWidthField;
+ VclPtr<MetricField> m_pSizeHeightField;
+ VclPtr<SwEnvPreview> m_pPreview;
std::vector<sal_uInt16> aIDs;
- SwEnvFmtPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
DECL_LINK( ModifyHdl, Edit * );
DECL_LINK( EditHdl, MenuButton * );
DECL_LINK(FormatHdl, void *);
@@ -59,8 +57,11 @@ class SwEnvFmtPage : public SfxTabPage
using TabPage::DeactivatePage;
public:
+ SwEnvFmtPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ virtual ~SwEnvFmtPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet* pSet = 0) SAL_OVERRIDE;
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index 575d865fb74f..d0fcedae9073 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -153,8 +153,14 @@ SwEnvDlg::SwEnvDlg(vcl::Window* pParent, const SfxItemSet& rSet,
SwEnvDlg::~SwEnvDlg()
{
+ disposeOnce();
+}
+
+void SwEnvDlg::dispose()
+{
delete pAddresseeSet;
delete pSenderSet;
+ SfxTabDialog::dispose();
}
void SwEnvDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
@@ -229,6 +235,20 @@ SwEnvPage::SwEnvPage(vcl::Window* pParent, const SfxItemSet& rSet)
SwEnvPage::~SwEnvPage()
{
+ disposeOnce();
+}
+
+void SwEnvPage::dispose()
+{
+ m_pAddrEdit.clear();
+ m_pDatabaseLB.clear();
+ m_pTableLB.clear();
+ m_pDBFieldLB.clear();
+ m_pInsertBT.clear();
+ m_pSenderBox.clear();
+ m_pSenderEdit.clear();
+ m_pPreview.clear();
+ SfxTabPage::dispose();
}
IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox )
@@ -303,9 +323,9 @@ void SwEnvPage::InitDatabaseBox()
}
}
-SfxTabPage* SwEnvPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SwEnvPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SwEnvPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>(new SwEnvPage(pParent, *rSet), SAL_NO_ACQUIRE);
}
void SwEnvPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index 309ccc356e27..10b3a0d323de 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -67,6 +67,23 @@ SwEnvPrtPage::SwEnvPrtPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_aIds[ENV_VER_RGHT] = m_pAlignBox->GetItemId("vertright");
}
+SwEnvPrtPage::~SwEnvPrtPage()
+{
+ disposeOnce();
+}
+
+void SwEnvPrtPage::dispose()
+{
+ m_pAlignBox.clear();
+ m_pTopButton.clear();
+ m_pBottomButton.clear();
+ m_pRightField.clear();
+ m_pDownField.clear();
+ m_pPrinterInfo.clear();
+ m_pPrtSetup.clear();
+ SfxTabPage::dispose();
+}
+
IMPL_LINK_NOARG(SwEnvPrtPage, ClickHdl)
{
if (m_pBottomButton->IsChecked())
@@ -99,7 +116,7 @@ IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn )
// Call printer setup
if (pPrt)
{
- boost::scoped_ptr<PrinterSetupDialog> pDlg(new PrinterSetupDialog(this));
+ VclPtrInstance< PrinterSetupDialog > pDlg(this);
pDlg->SetPrinter(pPrt);
pDlg->Execute();
pDlg.reset();
@@ -127,9 +144,9 @@ IMPL_LINK_NOARG(SwEnvPrtPage, AlignHdl)
return 0;
}
-SfxTabPage* SwEnvPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SwEnvPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SwEnvPrtPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>(new SwEnvPrtPage(pParent, *rSet), SAL_NO_ACQUIRE);
}
void SwEnvPrtPage::ActivatePage(const SfxItemSet&)
diff --git a/sw/source/ui/envelp/envprt.hxx b/sw/source/ui/envelp/envprt.hxx
index 2c947d53c3a1..a71c96b3a9e6 100644
--- a/sw/source/ui/envelp/envprt.hxx
+++ b/sw/source/ui/envelp/envprt.hxx
@@ -35,19 +35,17 @@ class SwEnvDlg;
class SwEnvPrtPage : public SfxTabPage
{
- ToolBox* m_pAlignBox;
- RadioButton* m_pTopButton;
- RadioButton* m_pBottomButton;
- MetricField* m_pRightField;
- MetricField* m_pDownField;
- FixedText* m_pPrinterInfo;
- PushButton* m_pPrtSetup;
+ VclPtr<ToolBox> m_pAlignBox;
+ VclPtr<RadioButton> m_pTopButton;
+ VclPtr<RadioButton> m_pBottomButton;
+ VclPtr<MetricField> m_pRightField;
+ VclPtr<MetricField> m_pDownField;
+ VclPtr<FixedText> m_pPrinterInfo;
+ VclPtr<PushButton> m_pPrtSetup;
sal_uInt16 m_aIds[ENV_VER_RGHT-ENV_HOR_LEFT+1];
- Printer* pPrt;
-
- SwEnvPrtPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ VclPtr<Printer> pPrt;
DECL_LINK(ClickHdl, void *);
DECL_LINK(AlignHdl, void *);
@@ -59,8 +57,11 @@ class SwEnvPrtPage : public SfxTabPage
using TabPage::DeactivatePage;
public:
+ SwEnvPrtPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ virtual ~SwEnvPrtPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet* pSet = 0) SAL_OVERRIDE;
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index 426816ec8e3c..8cf472141a12 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -170,7 +170,14 @@ SwLabDlg::SwLabDlg(vcl::Window* pParent, const SfxItemSet& rSet,
SwLabDlg::~SwLabDlg()
{
+ disposeOnce();
+}
+
+void SwLabDlg::dispose()
+{
delete pRecs;
+ pPrtPage.clear();
+ SfxTabDialog::dispose();
}
void SwLabDlg::GetLabItem(SwLabItem &rItem)
@@ -286,6 +293,29 @@ SwLabPage::SwLabPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pMakeBox->GetSelectHdl().Call(m_pMakeBox);
}
+SwLabPage::~SwLabPage()
+{
+ disposeOnce();
+}
+
+void SwLabPage::dispose()
+{
+ m_pAddressFrame.clear();
+ m_pAddrBox.clear();
+ m_pWritingEdit.clear();
+ m_pDatabaseLB.clear();
+ m_pTableLB.clear();
+ m_pInsertBT.clear();
+ m_pDBFieldLB.clear();
+ m_pContButton.clear();
+ m_pSheetButton.clear();
+ m_pMakeBox.clear();
+ m_pTypeBox.clear();
+ m_pHiddenSortTypeBox.clear();
+ m_pFormatInfo.clear();
+ SfxTabPage::dispose();
+}
+
void SwLabPage::SetToBusinessCard()
{
SetHelpId(HID_BUSINESS_FMT_PAGE);
@@ -406,24 +436,24 @@ IMPL_LINK_NOARG_INLINE_END(SwLabPage, TypeHdl)
void SwLabPage::DisplayFormat()
{
- MetricField aField(this, WinBits(0));
+ ScopedVclPtrInstance< MetricField > aField(this, WinBits(0));
FieldUnit aMetric = ::GetDfltMetric(false);
- SetMetric(aField, aMetric);
- aField.SetDecimalDigits(2);
- aField.SetMin (0);
- aField.SetMax (LONG_MAX);
+ SetMetric(*aField.get(), aMetric);
+ aField->SetDecimalDigits(2);
+ aField->SetMin (0);
+ aField->SetMax (LONG_MAX);
SwLabRec* pRec = GetSelectedEntryPos();
aItem.aLstType = pRec->aType;
- SETFLDVAL(aField, pRec->lWidth);
- aField.Reformat();
- const OUString aWString = aField.GetText();
+ SETFLDVAL(*aField.get(), pRec->lWidth);
+ aField->Reformat();
+ const OUString aWString = aField->GetText();
- SETFLDVAL(aField, pRec->lHeight);
- aField.Reformat();
+ SETFLDVAL(*aField.get(), pRec->lHeight);
+ aField->Reformat();
OUString aText = pRec->aType + ": " + aWString +
- " x " + aField.GetText() +
+ " x " + aField->GetText() +
" (" + OUString::number( pRec->nCols ) +
" x " + OUString::number( pRec->nRows ) + ")";
m_pFormatInfo->SetText(aText);
@@ -458,9 +488,9 @@ void SwLabPage::InitDatabaseBox()
}
}
-SfxTabPage* SwLabPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SwLabPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SwLabPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>(new SwLabPage(pParent, *rSet), SAL_NO_ACQUIRE);
}
void SwLabPage::ActivatePage(const SfxItemSet& rSet)
@@ -586,17 +616,26 @@ SwVisitingCardPage::SwVisitingCardPage(vcl::Window* pParent, const SfxItemSet& r
SwVisitingCardPage::~SwVisitingCardPage()
{
+ disposeOnce();
+}
+
+void SwVisitingCardPage::dispose()
+{
for(sal_Int32 i = 0; i < m_pAutoTextGroupLB->GetEntryCount(); ++i)
delete static_cast<OUString*>(m_pAutoTextGroupLB->GetEntryData( i ));
m_xAutoText = 0;
ClearUserData();
delete pExampleFrame;
+ m_pAutoTextLB.clear();
+ m_pAutoTextGroupLB.clear();
+ m_pExampleWIN.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SwVisitingCardPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SwVisitingCardPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SwVisitingCardPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>(new SwVisitingCardPage(pParent, *rSet), SAL_NO_ACQUIRE);
}
void SwVisitingCardPage::ActivatePage(const SfxItemSet& rSet)
@@ -727,9 +766,37 @@ SwPrivateDataPage::SwPrivateDataPage(vcl::Window* pParent, const SfxItemSet& rSe
SetExchangeSupport();
}
-SfxTabPage* SwPrivateDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+SwPrivateDataPage::~SwPrivateDataPage()
{
- return new SwPrivateDataPage(pParent, *rSet);
+ disposeOnce();
+}
+
+void SwPrivateDataPage::dispose()
+{
+ m_pFirstNameED.clear();
+ m_pNameED.clear();
+ m_pShortCutED.clear();
+ m_pFirstName2ED.clear();
+ m_pName2ED.clear();
+ m_pShortCut2ED.clear();
+ m_pStreetED.clear();
+ m_pZipED.clear();
+ m_pCityED.clear();
+ m_pCountryED.clear();
+ m_pStateED.clear();
+ m_pTitleED.clear();
+ m_pProfessionED.clear();
+ m_pPhoneED.clear();
+ m_pMobilePhoneED.clear();
+ m_pFaxED.clear();
+ m_pHomePageED.clear();
+ m_pMailED.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> SwPrivateDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+{
+ return VclPtr<SfxTabPage>(new SwPrivateDataPage(pParent, *rSet), SAL_NO_ACQUIRE);
}
void SwPrivateDataPage::ActivatePage(const SfxItemSet& rSet)
@@ -815,9 +882,34 @@ SwBusinessDataPage::SwBusinessDataPage(vcl::Window* pParent, const SfxItemSet& r
SetExchangeSupport();
}
-SfxTabPage* SwBusinessDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+SwBusinessDataPage::~SwBusinessDataPage()
+{
+ disposeOnce();
+}
+
+void SwBusinessDataPage::dispose()
+{
+ m_pCompanyED.clear();
+ m_pCompanyExtED.clear();
+ m_pSloganED.clear();
+ m_pStreetED.clear();
+ m_pZipED.clear();
+ m_pCityED.clear();
+ m_pCountryED.clear();
+ m_pStateED.clear();
+ m_pPositionED.clear();
+ m_pPhoneED.clear();
+ m_pMobilePhoneED.clear();
+ m_pFaxED.clear();
+ m_pHomePageED.clear();
+ m_pMailED.clear();
+ SfxTabPage::dispose();
+}
+
+
+VclPtr<SfxTabPage> SwBusinessDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SwBusinessDataPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>(new SwBusinessDataPage(pParent, *rSet), SAL_NO_ACQUIRE);
}
void SwBusinessDataPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index 9e9a216f5848..646da3d044b4 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -353,8 +353,29 @@ SwLabFmtPage::SwLabFmtPage(vcl::Window* pParent, const SfxItemSet& rSet)
SwLabFmtPage::~SwLabFmtPage()
{
+ disposeOnce();
}
+void SwLabFmtPage::dispose()
+{
+ m_pMakeFI.clear();
+ m_pTypeFI.clear();
+ m_pPreview.clear();
+ m_pHDistField.clear();
+ m_pVDistField.clear();
+ m_pWidthField.clear();
+ m_pHeightField.clear();
+ m_pLeftField.clear();
+ m_pUpperField.clear();
+ m_pColsField.clear();
+ m_pRowsField.clear();
+ m_pPWidthField.clear();
+ m_pPHeightField.clear();
+ m_pSavePB.clear();
+ SfxTabPage::dispose();
+}
+
+
// Modify-handler of MetricFields. start preview timer
IMPL_LINK_NOARG_INLINE_START(SwLabFmtPage, ModifyHdl)
{
@@ -464,9 +485,9 @@ void SwLabFmtPage::ChangeMinMax()
m_pPHeightField->Reformat();
}
-SfxTabPage* SwLabFmtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SwLabFmtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SwLabFmtPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>(new SwLabFmtPage(pParent, *rSet), SAL_NO_ACQUIRE);
}
void SwLabFmtPage::ActivatePage(const SfxItemSet& rSet)
@@ -558,7 +579,7 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl)
aRec.lPWidth = static_cast< long >(GETFLDVAL(*m_pPWidthField ));
aRec.lPHeight = static_cast< long >(GETFLDVAL(*m_pPHeightField));
aRec.bCont = aItem.bCont;
- boost::scoped_ptr<SwSaveLabelDlg> pSaveDlg(new SwSaveLabelDlg(this, aRec));
+ ScopedVclPtrInstance< SwSaveLabelDlg > pSaveDlg(this, aRec);
pSaveDlg->SetLabel(aItem.aLstMake, aItem.aLstType);
pSaveDlg->Execute();
if(pSaveDlg->GetLabel(aItem))
@@ -600,6 +621,20 @@ SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec)
}
}
+SwSaveLabelDlg::~SwSaveLabelDlg()
+{
+ disposeOnce();
+}
+
+void SwSaveLabelDlg::dispose()
+{
+ m_pMakeCB.clear();
+ m_pTypeED.clear();
+ m_pOKPB.clear();
+ pLabPage.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl)
{
SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig();
@@ -614,15 +649,15 @@ IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl)
return 0;
}
- MessageDialog aQuery(this, "QuerySaveLabelDialog",
- "modules/swriter/ui/querysavelabeldialog.ui");
+ ScopedVclPtrInstance<MessageDialog> aQuery(this, "QuerySaveLabelDialog",
+ "modules/swriter/ui/querysavelabeldialog.ui");
- aQuery.set_primary_text(aQuery.get_primary_text().
+ aQuery->set_primary_text(aQuery->get_primary_text().
replaceAll("%1", sMake).replaceAll("%2", sType));
- aQuery.set_secondary_text(aQuery.get_secondary_text().
+ aQuery->set_secondary_text(aQuery->get_secondary_text().
replaceAll("%1", sMake).replaceAll("%2", sType));
- if (RET_YES != aQuery.Execute())
+ if (RET_YES != aQuery->Execute())
return 0;
}
rLabRec.aType = sType;
diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx
index a50d525ebcce..d35833a7122b 100644
--- a/sw/source/ui/envelp/labfmt.hxx
+++ b/sw/source/ui/envelp/labfmt.hxx
@@ -69,29 +69,26 @@ public:
class SwLabFmtPage : public SfxTabPage
{
- FixedText* m_pMakeFI;
- FixedText* m_pTypeFI;
- SwLabPreview* m_pPreview;
- MetricField* m_pHDistField;
- MetricField* m_pVDistField;
- MetricField* m_pWidthField;
- MetricField* m_pHeightField;
- MetricField* m_pLeftField;
- MetricField* m_pUpperField;
- NumericField* m_pColsField;
- NumericField* m_pRowsField;
- MetricField* m_pPWidthField;
- MetricField* m_pPHeightField;
- PushButton* m_pSavePB;
+ VclPtr<FixedText> m_pMakeFI;
+ VclPtr<FixedText> m_pTypeFI;
+ VclPtr<SwLabPreview> m_pPreview;
+ VclPtr<MetricField> m_pHDistField;
+ VclPtr<MetricField> m_pVDistField;
+ VclPtr<MetricField> m_pWidthField;
+ VclPtr<MetricField> m_pHeightField;
+ VclPtr<MetricField> m_pLeftField;
+ VclPtr<MetricField> m_pUpperField;
+ VclPtr<NumericField> m_pColsField;
+ VclPtr<NumericField> m_pRowsField;
+ VclPtr<MetricField> m_pPWidthField;
+ VclPtr<MetricField> m_pPHeightField;
+ VclPtr<PushButton> m_pSavePB;
Idle aPreviewIdle;
bool bModified;
SwLabItem aItem;
- SwLabFmtPage(vcl::Window* pParent, const SfxItemSet& rSet);
- virtual ~SwLabFmtPage();
-
DECL_LINK(ModifyHdl, void *);
DECL_LINK(PreviewHdl, void *);
DECL_LINK( LoseFocusHdl, Control * );
@@ -103,8 +100,11 @@ class SwLabFmtPage : public SfxTabPage
using TabPage::DeactivatePage;
public:
+ SwLabFmtPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ virtual ~SwLabFmtPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet* pSet = 0) SAL_OVERRIDE;
@@ -117,12 +117,12 @@ public:
class SwSaveLabelDlg : public ModalDialog
{
- ComboBox* m_pMakeCB;
- Edit* m_pTypeED;
- OKButton* m_pOKPB;
+ VclPtr<ComboBox> m_pMakeCB;
+ VclPtr<Edit> m_pTypeED;
+ VclPtr<OKButton> m_pOKPB;
bool bSuccess;
- SwLabFmtPage* pLabPage;
+ VclPtr<SwLabFmtPage> pLabPage;
SwLabRec& rLabRec;
DECL_LINK(OkHdl, void *);
@@ -130,6 +130,8 @@ class SwSaveLabelDlg : public ModalDialog
public:
SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec);
+ virtual ~SwSaveLabelDlg();
+ virtual void dispose() SAL_OVERRIDE;
void SetLabel(const OUString& rMake, const OUString& rType)
{
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index 5574fce5de49..9443dfcb9622 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -62,7 +62,22 @@ SwLabPrtPage::SwLabPrtPage(vcl::Window* pParent, const SfxItemSet& rSet)
SwLabPrtPage::~SwLabPrtPage()
{
- delete pPrinter;
+ disposeOnce();
+}
+
+void SwLabPrtPage::dispose()
+{
+ pPrinter.disposeAndClear();
+ m_pPageButton.clear();
+ m_pSingleButton.clear();
+ m_pSingleGrid.clear();
+ m_pPrinterFrame.clear();
+ m_pColField.clear();
+ m_pRowField.clear();
+ m_pSynchronCB.clear();
+ m_pPrinterInfo.clear();
+ m_pPrtSetup.clear();
+ SfxTabPage::dispose();
}
IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
@@ -73,7 +88,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
if (!pPrinter)
pPrinter = new Printer;
- boost::scoped_ptr<PrinterSetupDialog> pDlg(new PrinterSetupDialog(this));
+ VclPtrInstance< PrinterSetupDialog > pDlg(this);
pDlg->SetPrinter(pPrinter);
pDlg->Execute();
pDlg.reset();
@@ -93,9 +108,9 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
return 0;
}
-SfxTabPage* SwLabPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SwLabPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SwLabPrtPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>(new SwLabPrtPage( pParent, *rSet ), SAL_NO_ACQUIRE);
}
void SwLabPrtPage::ActivatePage( const SfxItemSet& rSet )
diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx
index c011687f6cd7..45b5decffb5e 100644
--- a/sw/source/ui/envelp/labprt.hxx
+++ b/sw/source/ui/envelp/labprt.hxx
@@ -31,21 +31,18 @@ class SwLabItem;
class SwLabPrtPage : public SfxTabPage
{
- Printer* pPrinter; // for the shaft setting - unfortunately
+ VclPtr<Printer> pPrinter; // for the shaft setting - unfortunately
- RadioButton* m_pPageButton;
- RadioButton* m_pSingleButton;
- VclContainer* m_pSingleGrid;
- VclContainer* m_pPrinterFrame;
- NumericField* m_pColField;
- NumericField* m_pRowField;
- CheckBox* m_pSynchronCB;
+ VclPtr<RadioButton> m_pPageButton;
+ VclPtr<RadioButton> m_pSingleButton;
+ VclPtr<VclContainer> m_pSingleGrid;
+ VclPtr<VclContainer> m_pPrinterFrame;
+ VclPtr<NumericField> m_pColField;
+ VclPtr<NumericField> m_pRowField;
+ VclPtr<CheckBox> m_pSynchronCB;
- FixedText* m_pPrinterInfo;
- PushButton* m_pPrtSetup;
-
- SwLabPrtPage(vcl::Window* pParent, const SfxItemSet& rSet);
- virtual ~SwLabPrtPage();
+ VclPtr<FixedText> m_pPrinterInfo;
+ VclPtr<PushButton> m_pPrtSetup;
DECL_LINK( CountHdl, Button * );
@@ -55,8 +52,11 @@ class SwLabPrtPage : public SfxTabPage
using TabPage::DeactivatePage;
public:
+ SwLabPrtPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ virtual ~SwLabPrtPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet* pSet = 0) SAL_OVERRIDE;
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index dac471ea8bc3..25397c3f66ef 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -389,6 +389,11 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell,
SwMailMergeDlg::~SwMailMergeDlg()
{
+ disposeOnce();
+}
+
+void SwMailMergeDlg::dispose()
+{
if(m_xFrame.is())
{
m_xFrame->setComponent(NULL, NULL);
@@ -401,6 +406,39 @@ SwMailMergeDlg::~SwMailMergeDlg()
delete pData;
}
delete pImpl;
+ m_pBeamerWin.clear();
+ m_pAllRB.clear();
+ m_pMarkedRB.clear();
+ m_pFromRB.clear();
+ m_pFromNF.clear();
+ m_pToNF.clear();
+ m_pPrinterRB.clear();
+ m_pMailingRB.clear();
+ m_pFileRB.clear();
+ m_pSingleJobsCB.clear();
+ m_pSaveMergedDocumentFT.clear();
+ m_pSaveSingleDocRB.clear();
+ m_pSaveIndividualRB.clear();
+ m_pGenerateFromDataBaseCB.clear();
+ m_pColumnFT.clear();
+ m_pColumnLB.clear();
+ m_pPathFT.clear();
+ m_pPathED.clear();
+ m_pPathPB.clear();
+ m_pFilterFT.clear();
+ m_pFilterLB.clear();
+ m_pAddressFldLB.clear();
+ m_pSubjectFT.clear();
+ m_pSubjectED.clear();
+ m_pFormatFT.clear();
+ m_pAttachFT.clear();
+ m_pAttachED.clear();
+ m_pAttachPB.clear();
+ m_pFormatHtmlCB.clear();
+ m_pFormatRtfCB.clear();
+ m_pFormatSwCB.clear();
+ m_pOkBTN.clear();
+ SvxStandardDialog::dispose();
}
void SwMailMergeDlg::Apply()
@@ -633,6 +671,17 @@ SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(vcl::Window* pParent)
get(m_pThisDocRB, "document");
}
+SwMailMergeCreateFromDlg::~SwMailMergeCreateFromDlg()
+{
+ disposeOnce();
+}
+
+void SwMailMergeCreateFromDlg::dispose()
+{
+ m_pThisDocRB.clear();
+ ModalDialog::dispose();
+}
+
SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(vcl::Window* pParent)
: ModalDialog(pParent, "MergeConnectDialog",
"modules/swriter/ui/mergeconnectdialog.ui")
@@ -640,4 +689,15 @@ SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(vcl::Window* pPar
get(m_pUseExistingRB, "existing");
}
+SwMailMergeFieldConnectionsDlg::~SwMailMergeFieldConnectionsDlg()
+{
+ disposeOnce();
+}
+
+void SwMailMergeFieldConnectionsDlg::dispose()
+{
+ m_pUseExistingRB.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx
index 0aa045936d7e..d69af8dd5ee1 100644
--- a/sw/source/ui/envelp/swuilabimp.hxx
+++ b/sw/source/ui/envelp/swuilabimp.hxx
@@ -29,26 +29,24 @@ class SwLabPage : public SfxTabPage
OUString sActDBName;
SwLabItem aItem;
- VclContainer* m_pAddressFrame;
-
- CheckBox* m_pAddrBox;
- VclMultiLineEdit* m_pWritingEdit;
- ListBox* m_pDatabaseLB;
- ListBox* m_pTableLB;
- PushButton* m_pInsertBT;
- ListBox* m_pDBFieldLB;
-
- RadioButton* m_pContButton;
- RadioButton* m_pSheetButton;
- ListBox* m_pMakeBox;
- ListBox* m_pTypeBox;
- ListBox* m_pHiddenSortTypeBox;
- FixedText* m_pFormatInfo;
+ VclPtr<VclContainer> m_pAddressFrame;
+
+ VclPtr<CheckBox> m_pAddrBox;
+ VclPtr<VclMultiLineEdit> m_pWritingEdit;
+ VclPtr<ListBox> m_pDatabaseLB;
+ VclPtr<ListBox> m_pTableLB;
+ VclPtr<PushButton> m_pInsertBT;
+ VclPtr<ListBox> m_pDBFieldLB;
+
+ VclPtr<RadioButton> m_pContButton;
+ VclPtr<RadioButton> m_pSheetButton;
+ VclPtr<ListBox> m_pMakeBox;
+ VclPtr<ListBox> m_pTypeBox;
+ VclPtr<ListBox> m_pHiddenSortTypeBox;
+ VclPtr<FixedText> m_pFormatInfo;
bool m_bLabel;
- SwLabPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
DECL_LINK(AddrHdl, void *);
DECL_LINK( DatabaseHdl, ListBox *pListBox );
DECL_LINK(FieldHdl, void *);
@@ -63,8 +61,12 @@ class SwLabPage : public SfxTabPage
using TabPage::DeactivatePage;
public:
+ SwLabPage(vcl::Window* pParent, const SfxItemSet& rSet);
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet);
+ virtual ~SwLabPage();
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet* pSet = 0) SAL_OVERRIDE;
@@ -84,9 +86,9 @@ public:
class SwOneExampleFrame;
class SwVisitingCardPage : public SfxTabPage
{
- SvTreeListBox* m_pAutoTextLB;
- ListBox* m_pAutoTextGroupLB;
- vcl::Window* m_pExampleWIN;
+ VclPtr<SvTreeListBox> m_pAutoTextLB;
+ VclPtr<ListBox> m_pAutoTextGroupLB;
+ VclPtr<vcl::Window> m_pExampleWIN;
OUString sTempURL;
@@ -108,15 +110,16 @@ class SwVisitingCardPage : public SfxTabPage
const OUString* pNames,
const OUString* pValues );
- SwVisitingCardPage(vcl::Window* pParent, const SfxItemSet& rSet);
virtual ~SwVisitingCardPage();
+ virtual void dispose() SAL_OVERRIDE;
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
public:
+ SwVisitingCardPage(vcl::Window* pParent, const SfxItemSet& rSet);
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet* pSet = 0) SAL_OVERRIDE;
@@ -126,35 +129,36 @@ public:
class SwPrivateDataPage : public SfxTabPage
{
- Edit* m_pFirstNameED;
- Edit* m_pNameED;
- Edit* m_pShortCutED;
-
- Edit* m_pFirstName2ED;
- Edit* m_pName2ED;
- Edit* m_pShortCut2ED;
-
- Edit* m_pStreetED;
- Edit* m_pZipED;
- Edit* m_pCityED;
- Edit* m_pCountryED;
- Edit* m_pStateED;
- Edit* m_pTitleED;
- Edit* m_pProfessionED;
- Edit* m_pPhoneED;
- Edit* m_pMobilePhoneED;
- Edit* m_pFaxED;
- Edit* m_pHomePageED;
- Edit* m_pMailED;
-
- SwPrivateDataPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ VclPtr<Edit> m_pFirstNameED;
+ VclPtr<Edit> m_pNameED;
+ VclPtr<Edit> m_pShortCutED;
+
+ VclPtr<Edit> m_pFirstName2ED;
+ VclPtr<Edit> m_pName2ED;
+ VclPtr<Edit> m_pShortCut2ED;
+
+ VclPtr<Edit> m_pStreetED;
+ VclPtr<Edit> m_pZipED;
+ VclPtr<Edit> m_pCityED;
+ VclPtr<Edit> m_pCountryED;
+ VclPtr<Edit> m_pStateED;
+ VclPtr<Edit> m_pTitleED;
+ VclPtr<Edit> m_pProfessionED;
+ VclPtr<Edit> m_pPhoneED;
+ VclPtr<Edit> m_pMobilePhoneED;
+ VclPtr<Edit> m_pFaxED;
+ VclPtr<Edit> m_pHomePageED;
+ VclPtr<Edit> m_pMailED;
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
public:
+ SwPrivateDataPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ virtual ~SwPrivateDataPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet* pSet = 0) SAL_OVERRIDE;
@@ -164,33 +168,34 @@ public:
class SwBusinessDataPage : public SfxTabPage
{
- Edit* m_pCompanyED;
- Edit* m_pCompanyExtED;
- Edit* m_pSloganED;
+ VclPtr<Edit> m_pCompanyED;
+ VclPtr<Edit> m_pCompanyExtED;
+ VclPtr<Edit> m_pSloganED;
- Edit* m_pStreetED;
- Edit* m_pZipED;
- Edit* m_pCityED;
- Edit* m_pCountryED;
- Edit* m_pStateED;
+ VclPtr<Edit> m_pStreetED;
+ VclPtr<Edit> m_pZipED;
+ VclPtr<Edit> m_pCityED;
+ VclPtr<Edit> m_pCountryED;
+ VclPtr<Edit> m_pStateED;
- Edit* m_pPositionED;
+ VclPtr<Edit> m_pPositionED;
- Edit* m_pPhoneED;
- Edit* m_pMobilePhoneED;
- Edit* m_pFaxED;
+ VclPtr<Edit> m_pPhoneED;
+ VclPtr<Edit> m_pMobilePhoneED;
+ VclPtr<Edit> m_pFaxED;
- Edit* m_pHomePageED;
- Edit* m_pMailED;
-
- SwBusinessDataPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ VclPtr<Edit> m_pHomePageED;
+ VclPtr<Edit> m_pMailED;
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
public:
+ SwBusinessDataPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ virtual ~SwBusinessDataPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet* pSet = 0) SAL_OVERRIDE;