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.cxx6
-rw-r--r--sw/source/ui/envelp/envprt.cxx5
-rw-r--r--sw/source/ui/envelp/labfmt.cxx4
-rw-r--r--sw/source/ui/envelp/labprt.cxx5
4 files changed, 11 insertions, 9 deletions
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 760c9c278d59..c816fe933972 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -44,6 +44,7 @@
#include <vector>
#include <algorithm>
+#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
#include "swabstdlg.hxx"
@@ -352,12 +353,11 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, bool bSender)
std::vector<sal_uInt16> pVec = ::lcl_convertRangesToList(pRanges);
std::vector<sal_uInt16> aVec = ::lcl_convertRangesToList(aRanges);
pVec.insert(pVec.end(), aVec.begin(), aVec.end());
- sal_uInt16 *pNewRanges = ::lcl_convertListToRanges(pVec);
+ boost::scoped_array<sal_uInt16> pNewRanges(::lcl_convertListToRanges(pVec));
pAddrSet = new SfxItemSet(GetParentSwEnvDlg()->pSh->GetView().GetCurShell()->GetPool(),
- pNewRanges);
+ pNewRanges.get());
pAddrSet->Put(pColl->GetAttrSet());
- delete[] pNewRanges;
}
return pAddrSet;
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index 6978b0454b36..252cf04ac0d9 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -27,6 +27,7 @@
#include "uitool.hxx"
#include "envprt.hrc"
+#include <boost/scoped_ptr.hpp>
SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "EnvPrinterPage",
@@ -98,10 +99,10 @@ IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn )
// Call printer setup
if (pPrt)
{
- PrinterSetupDialog* pDlg = new PrinterSetupDialog(this );
+ boost::scoped_ptr<PrinterSetupDialog> pDlg(new PrinterSetupDialog(this));
pDlg->SetPrinter(pPrt);
pDlg->Execute();
- delete pDlg;
+ pDlg.reset();
GrabFocus();
m_pPrinterInfo->SetText(pPrt->GetName());
}
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index ae27b717766f..49593db120b8 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -34,6 +34,7 @@
#include "../../uibase/envelp/label.hrc"
#include "labfmt.hrc"
#include <unomid.h>
+#include <boost/scoped_ptr.hpp>
using namespace utl;
using namespace ::com::sun::star::uno;
@@ -557,7 +558,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;
- SwSaveLabelDlg* pSaveDlg = new SwSaveLabelDlg(this, aRec);
+ boost::scoped_ptr<SwSaveLabelDlg> pSaveDlg(new SwSaveLabelDlg(this, aRec));
pSaveDlg->SetLabel(aItem.aLstMake, aItem.aLstType);
pSaveDlg->Execute();
if(pSaveDlg->GetLabel(aItem))
@@ -572,7 +573,6 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl)
m_pMakeFI->SetText(aItem.aMake);
m_pTypeFI->SetText(aItem.aType);
}
- delete pSaveDlg;
return 0;
}
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index 454660df265e..cc5a9e3c152a 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -27,6 +27,7 @@
#include "swuilabimp.hxx"
#include <cmdid.h>
+#include <boost/scoped_ptr.hpp>
SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "LabelOptionsPage",
@@ -73,10 +74,10 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
if (!pPrinter)
pPrinter = new Printer;
- PrinterSetupDialog* pDlg = new PrinterSetupDialog(this );
+ boost::scoped_ptr<PrinterSetupDialog> pDlg(new PrinterSetupDialog(this));
pDlg->SetPrinter(pPrinter);
pDlg->Execute();
- delete pDlg;
+ pDlg.reset();
GrabFocus();
m_pPrinterInfo->SetText(pPrinter->GetName());
return 0;