summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-03 12:02:36 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-06-06 20:26:54 +0000
commit3f72218069f6f78a3ba21c40f00240d78cbe65c7 (patch)
treebd0781953ae45d3dcbfa3994641e755f2c5c0f73 /sc
parent87ac0b1e75a880a68ecb748bd4b34ae5a3d2ae98 (diff)
Apply new VclPtr clang plugin to catch potential problems.
Omit the plugin, and sw's FrameControlsManager for now. Change-Id: Ifb98a2e6e03a9d099efc1668305b96bd9142ca5f Reviewed-on: https://gerrit.libreoffice.org/16117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx6
-rw-r--r--sc/source/ui/attrdlg/tabpages.cxx2
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx2
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx14
-rw-r--r--sc/source/ui/dbgui/validate.cxx2
-rw-r--r--sc/source/ui/docshell/tpstat.cxx2
-rw-r--r--sc/source/ui/inc/scuitphfedit.hxx4
-rw-r--r--sc/source/ui/inc/tabpages.hxx1
-rw-r--r--sc/source/ui/inc/tpcalc.hxx1
-rw-r--r--sc/source/ui/inc/tpcompatibility.hxx1
-rw-r--r--sc/source/ui/inc/tpdefaults.hxx1
-rw-r--r--sc/source/ui/inc/tpformula.hxx1
-rw-r--r--sc/source/ui/inc/tphf.hxx2
-rw-r--r--sc/source/ui/inc/tpprint.hxx1
-rw-r--r--sc/source/ui/inc/tpstat.hxx1
-rw-r--r--sc/source/ui/inc/tpsubt.hxx4
-rw-r--r--sc/source/ui/inc/tptable.hxx1
-rw-r--r--sc/source/ui/inc/tpusrlst.hxx1
-rw-r--r--sc/source/ui/inc/tpview.hxx2
-rw-r--r--sc/source/ui/miscdlgs/filldlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/scuiautofmt.cxx14
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx6
-rw-r--r--sc/source/ui/optdlg/tpcompatibility.cxx2
-rw-r--r--sc/source/ui/optdlg/tpdefaults.cxx2
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx2
-rw-r--r--sc/source/ui/optdlg/tpprint.cxx2
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx8
-rw-r--r--sc/source/ui/optdlg/tpview.cxx4
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx16
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx4
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx2
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx4
-rw-r--r--sc/source/ui/sidebar/ScPanelFactory.cxx4
-rw-r--r--sc/source/ui/view/cellsh3.cxx4
-rw-r--r--sc/source/ui/view/tabvwshf.cxx4
35 files changed, 82 insertions, 49 deletions
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 3dfbf8a3b663..d74f344b1f02 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1172,9 +1172,9 @@ namespace {
sal_Int32 getColumnWidth(UnitConverter& rConverter, double nWidth)
{
double nCoeff = rConverter.getCoefficient(UNIT_DIGIT);
- VirtualDevice aDev;
+ ScopedVclPtrInstance<VirtualDevice> aDev;
- long nPixel = aDev.LogicToPixel(Point(nCoeff, 0), MapMode(MAP_100TH_MM)).getX();
+ long nPixel = aDev->LogicToPixel(Point(nCoeff, 0), MapMode(MAP_100TH_MM)).getX();
// the 1.047 has been experimentally chosen based on measurements witha screen ruler
@@ -1182,7 +1182,7 @@ sal_Int32 getColumnWidth(UnitConverter& rConverter, double nWidth)
// algorithm from OOXML spec part1: 18.3.1.13
sal_Int32 nColWidthPixel= std::floor(((256*nWidth + std::floor(128.0/nPixel))/256.0)*nPixel) * 1.047;
- return aDev.PixelToLogic(Point(nColWidthPixel, 0), MapMode(MAP_100TH_MM)).getX();
+ return aDev->PixelToLogic(Point(nColWidthPixel, 0), MapMode(MAP_100TH_MM)).getX();
}
}
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx
index 163b8742fc4c..d75a976303a9 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -75,7 +75,7 @@ void ScTabPageProtection::dispose()
VclPtr<SfxTabPage> ScTabPageProtection::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new ScTabPageProtection( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTabPageProtection>::Create( pParent, *rAttrSet );
}
void ScTabPageProtection::Reset( const SfxItemSet* rCoreAttrs )
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 470a0b8f5782..98ba5335957c 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -873,7 +873,7 @@ void ScCheckListMenuWindow::CancelButton::Click()
ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc) :
ScMenuFloatingWindow(pParent, pDoc),
- maEdSearch(new Edit (this)),
+ maEdSearch(VclPtr<Edit>::Create(this)),
maChecks(VclPtr<ScCheckListBox>::Create(this, WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT) ),
maChkToggleAll(VclPtr<TriStateBox>::Create(this, 0)),
maBtnSelectSingle(VclPtr<ImageButton>::Create(this, 0)),
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index c41bbc1a07ca..e36c39f1e963 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -387,15 +387,21 @@ IMPL_LINK( ScTpSubTotalGroup, CheckHdl, void *, pLb )
VclPtr<SfxTabPage> ScTpSubTotalGroup1::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
- { return VclPtr<SfxTabPage>( new ScTpSubTotalGroup1( pParent, *rArgSet ), SAL_NO_ACQUIRE ); }
+{
+ return VclPtr<ScTpSubTotalGroup1>::Create( pParent, *rArgSet );
+}
VclPtr<SfxTabPage> ScTpSubTotalGroup2::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
- { return VclPtr<SfxTabPage>( new ScTpSubTotalGroup2( pParent, *rArgSet ), SAL_NO_ACQUIRE ); }
+{
+ return VclPtr<ScTpSubTotalGroup2>::Create( pParent, *rArgSet );
+}
VclPtr<SfxTabPage> ScTpSubTotalGroup3::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
- { return VclPtr<SfxTabPage>( new ScTpSubTotalGroup3( pParent, *rArgSet ), SAL_NO_ACQUIRE ); }
+{
+ return VclPtr<ScTpSubTotalGroup3>::Create( pParent, *rArgSet );
+}
ScTpSubTotalGroup1::ScTpSubTotalGroup1( vcl::Window* pParent, const SfxItemSet& rArgSet ) :
ScTpSubTotalGroup( pParent, rArgSet )
@@ -487,7 +493,7 @@ void ScTpSubTotalOptions::Init()
VclPtr<SfxTabPage> ScTpSubTotalOptions::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
{
- return VclPtr<SfxTabPage>( new ScTpSubTotalOptions( pParent, *rArgSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTpSubTotalOptions>::Create( pParent, *rArgSet );
}
void ScTpSubTotalOptions::Reset( const SfxItemSet* /* rArgSet */ )
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 54edca1eed8a..23fb0f8df0ee 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -407,7 +407,7 @@ void ScTPValidationValue::Init()
VclPtr<SfxTabPage> ScTPValidationValue::Create( vcl::Window* pParent, const SfxItemSet* rArgSet )
{
- return VclPtr<SfxTabPage>(new ScTPValidationValue( pParent, *rArgSet ), SAL_NO_ACQUIRE);
+ return VclPtr<ScTPValidationValue>::Create( pParent, *rArgSet );
}
void ScTPValidationValue::Reset( const SfxItemSet* rArgSet )
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index c18f331790e1..0be22a9b0428 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -29,7 +29,7 @@
VclPtr<SfxTabPage> ScDocStatPage::Create( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>( new ScDocStatPage ( pParent, *rSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScDocStatPage>::Create( pParent, *rSet );
}
ScDocStatPage::ScDocStatPage( vcl::Window *pParent, const SfxItemSet& rSet )
diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx
index c22ec2510525..3fddc293ddad 100644
--- a/sc/source/ui/inc/scuitphfedit.hxx
+++ b/sc/source/ui/inc/scuitphfedit.hxx
@@ -104,6 +104,7 @@ private:
class ScRightHeaderEditPage : public ScHFEditPage
{
+ friend class VclPtr<ScRightHeaderEditPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
@@ -113,6 +114,7 @@ private:
class ScLeftHeaderEditPage : public ScHFEditPage
{
+ friend class VclPtr<ScLeftHeaderEditPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
@@ -122,6 +124,7 @@ private:
class ScRightFooterEditPage : public ScHFEditPage
{
+ friend class VclPtr<ScRightFooterEditPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
@@ -131,6 +134,7 @@ private:
class ScLeftFooterEditPage : public ScHFEditPage
{
+ friend class VclPtr<ScLeftFooterEditPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx
index c2f9c38d1e66..b2c20142ac37 100644
--- a/sc/source/ui/inc/tabpages.hxx
+++ b/sc/source/ui/inc/tabpages.hxx
@@ -26,6 +26,7 @@
class ScTabPageProtection : public SfxTabPage
{
+ friend class VclPtr<ScTabPageProtection>;
static const sal_uInt16 pProtectionRanges[];
public:
static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 25bd390fed20..0b27e75b27b6 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -31,6 +31,7 @@ class ScDocOptions;
class ScTpCalcOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpCalcOptions>;
public:
static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rCoreSet );
diff --git a/sc/source/ui/inc/tpcompatibility.hxx b/sc/source/ui/inc/tpcompatibility.hxx
index 550bd9b0836c..322e50d003bb 100644
--- a/sc/source/ui/inc/tpcompatibility.hxx
+++ b/sc/source/ui/inc/tpcompatibility.hxx
@@ -16,6 +16,7 @@
class ScTpCompatOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpCompatOptions>;
public:
using SfxTabPage::DeactivatePage;
diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx
index 429cbabde87f..deb267368baa 100644
--- a/sc/source/ui/inc/tpdefaults.hxx
+++ b/sc/source/ui/inc/tpdefaults.hxx
@@ -16,6 +16,7 @@
class ScTpDefaultsOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpDefaultsOptions>;
public:
using SfxTabPage::DeactivatePage;
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 7397d062d31d..a3175b8ee1fd 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -30,6 +30,7 @@
class ScTpFormulaOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpFormulaOptions>;
public:
using SfxTabPage::DeactivatePage;
diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx
index da972cbd44a9..9f5c8a599a23 100644
--- a/sc/source/ui/inc/tphf.hxx
+++ b/sc/source/ui/inc/tphf.hxx
@@ -60,6 +60,7 @@ private:
class ScHeaderPage : public ScHFPage
{
+ friend class VclPtr<ScHeaderPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
@@ -70,6 +71,7 @@ private:
class ScFooterPage : public ScHFPage
{
+ friend class VclPtr<ScFooterPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx
index 5b8370f13267..bf38a927c3b6 100644
--- a/sc/source/ui/inc/tpprint.hxx
+++ b/sc/source/ui/inc/tpprint.hxx
@@ -25,6 +25,7 @@
class ScTpPrintOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpPrintOptions>;
VclPtr<CheckBox> m_pSkipEmptyPagesCB;
VclPtr<CheckBox> m_pSelectedSheetsCB;
VclPtr<CheckBox> m_pForceBreaksCB;
diff --git a/sc/source/ui/inc/tpstat.hxx b/sc/source/ui/inc/tpstat.hxx
index d143610c37b9..14478dc7043e 100644
--- a/sc/source/ui/inc/tpstat.hxx
+++ b/sc/source/ui/inc/tpstat.hxx
@@ -26,6 +26,7 @@
class ScDocStatPage: public SfxTabPage
{
+ friend class VclPtr<ScDocStatPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual ~ScDocStatPage();
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index a54536c11f79..3295262e33b2 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -76,6 +76,7 @@ private:
class ScTpSubTotalGroup1 : public ScTpSubTotalGroup
{
+ friend class VclPtr<ScTpSubTotalGroup1>;
protected:
ScTpSubTotalGroup1( vcl::Window* pParent,
const SfxItemSet& rArgSet );
@@ -91,6 +92,7 @@ public:
class ScTpSubTotalGroup2 : public ScTpSubTotalGroup
{
+ friend class VclPtr<ScTpSubTotalGroup2>;
protected:
ScTpSubTotalGroup2( vcl::Window* pParent,
const SfxItemSet& rArgSet );
@@ -106,6 +108,7 @@ public:
class ScTpSubTotalGroup3 : public ScTpSubTotalGroup
{
+ friend class VclPtr<ScTpSubTotalGroup3>;
protected:
ScTpSubTotalGroup3( vcl::Window* pParent,
const SfxItemSet& rArgSet );
@@ -121,6 +124,7 @@ public:
class ScTpSubTotalOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpSubTotalOptions>;
protected:
ScTpSubTotalOptions( vcl::Window* pParent,
const SfxItemSet& rArgSet );
diff --git a/sc/source/ui/inc/tptable.hxx b/sc/source/ui/inc/tptable.hxx
index e135c91ea4ef..46042b854896 100644
--- a/sc/source/ui/inc/tptable.hxx
+++ b/sc/source/ui/inc/tptable.hxx
@@ -27,6 +27,7 @@
class ScTablePage : public SfxTabPage
{
+ friend class VclPtr<ScTablePage>;
static const sal_uInt16 pPageTableRanges[];
public:
static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx
index a0c8663df0d9..2a4c28ffc77f 100644
--- a/sc/source/ui/inc/tpusrlst.hxx
+++ b/sc/source/ui/inc/tpusrlst.hxx
@@ -32,6 +32,7 @@ class ScRangeUtil;
class ScTpUserLists : public SfxTabPage
{
+ friend class VclPtr<ScTpUserLists>;
public:
static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index f31c850a5eb7..baece6cffd4a 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -31,6 +31,7 @@ class ScViewOptions;
class ScTpContentOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpContentOptions>;
VclPtr<ListBox> pGridLB;
VclPtr<FixedText> pColorFT;
VclPtr<ColorListBox> pColorLB;
@@ -84,6 +85,7 @@ public:
class ScDocument;
class ScTpLayoutOptions : public SfxTabPage
{
+ friend class VclPtrInstance<ScTpLayoutOptions>;
VclPtr<ListBox> m_pUnitLB;
VclPtr<MetricField> m_pTabMF;
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index 4a0113d85e7d..73244b6304e8 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -325,9 +325,7 @@ IMPL_LINK_NOARG(ScFillSeriesDlg, OKHdl)
EndDialog( RET_OK );
else
{
- MessageDialog(this,
- aErrMsgInvalidVal
- ).Execute();
+ ScopedVclPtr<MessageDialog>::Create(this, aErrMsgInvalidVal)->Execute();
pEdWrong->GrabFocus();
}
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index fb9a60190da2..fb7f9ffafe4d 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -266,11 +266,11 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl)
if ( !bFmtInserted )
{
- sal_uInt16 nRet = MessageDialog(this,
+ sal_uInt16 nRet = ScopedVclPtr<MessageDialog>::Create(this,
ScGlobal::GetRscString(STR_INVALID_AFNAME),
VCL_MESSAGE_ERROR,
VCL_BUTTONS_OK_CANCEL
- ).Execute();
+ )->Execute();
bOk = ( nRet == RET_CANCEL );
}
@@ -390,11 +390,11 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl)
}
if( !bFmtRenamed )
{
- bOk = RET_CANCEL == MessageDialog( this,
- ScGlobal::GetRscString(STR_INVALID_AFNAME),
- VCL_MESSAGE_ERROR,
- VCL_BUTTONS_OK_CANCEL
- ).Execute();
+ bOk = RET_CANCEL == ScopedVclPtr<MessageDialog>::Create( this,
+ ScGlobal::GetRscString(STR_INVALID_AFNAME),
+ VCL_MESSAGE_ERROR,
+ VCL_BUTTONS_OK_CANCEL
+ )->Execute();
}
}
else
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 74cbf8878709..a3fad625889e 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -103,7 +103,7 @@ void ScTpCalcOptions::Init()
VclPtr<SfxTabPage> ScTpCalcOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new ScTpCalcOptions ( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTpCalcOptions>::Create( pParent, *rAttrSet );
}
void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ )
@@ -192,9 +192,9 @@ SfxTabPage::sfxpg ScTpCalcOptions::DeactivatePage( SfxItemSet* pSetP )
if ( nReturn == KEEP_PAGE )
{
- MessageDialog( this,
+ ScopedVclPtr<MessageDialog>::Create( this,
ScGlobal::GetRscString( STR_INVALID_EPS )
- ).Execute();
+ )->Execute();
m_pEdEps->GrabFocus();
}
diff --git a/sc/source/ui/optdlg/tpcompatibility.cxx b/sc/source/ui/optdlg/tpcompatibility.cxx
index ca828292c7db..3c83b980b7aa 100644
--- a/sc/source/ui/optdlg/tpcompatibility.cxx
+++ b/sc/source/ui/optdlg/tpcompatibility.cxx
@@ -34,7 +34,7 @@ void ScTpCompatOptions::dispose()
VclPtr<SfxTabPage> ScTpCompatOptions::Create(vcl::Window *pParent, const SfxItemSet *rCoreAttrs)
{
- return VclPtr<SfxTabPage>(new ScTpCompatOptions(pParent, *rCoreAttrs), SAL_NO_ACQUIRE);
+ return VclPtr<ScTpCompatOptions>::Create(pParent, *rCoreAttrs);
}
bool ScTpCompatOptions::FillItemSet(SfxItemSet *rCoreAttrs)
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index 79b8475a5145..a2929f77eb3a 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -42,7 +42,7 @@ void ScTpDefaultsOptions::dispose()
VclPtr<SfxTabPage> ScTpDefaultsOptions::Create(vcl::Window *pParent, const SfxItemSet *rCoreAttrs)
{
- return VclPtr<SfxTabPage>(new ScTpDefaultsOptions(pParent, *rCoreAttrs), SAL_NO_ACQUIRE);
+ return VclPtr<ScTpDefaultsOptions>::Create(pParent, *rCoreAttrs);
}
bool ScTpDefaultsOptions::FillItemSet(SfxItemSet *rCoreSet)
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 3e7feb1ff2f8..2e4643e5d055 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -239,7 +239,7 @@ IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, Edit*, pEdit )
VclPtr<SfxTabPage> ScTpFormulaOptions::Create(vcl::Window* pParent, const SfxItemSet* rCoreSet)
{
- return VclPtr<SfxTabPage>(new ScTpFormulaOptions(pParent, *rCoreSet), SAL_NO_ACQUIRE);
+ return VclPtr<ScTpFormulaOptions>::Create(pParent, *rCoreSet);
}
bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet)
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index e38c830431d0..6ee0b8945925 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -54,7 +54,7 @@ void ScTpPrintOptions::dispose()
VclPtr<SfxTabPage> ScTpPrintOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>(new ScTpPrintOptions( pParent, *rAttrSet ), SAL_NO_ACQUIRE);
+ return VclPtr<ScTpPrintOptions>::Create( pParent, *rAttrSet );
}
SfxTabPage::sfxpg ScTpPrintOptions::DeactivatePage( SfxItemSet* pSetP )
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index d1fab49c63cb..3f0e9e8daf68 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -155,7 +155,7 @@ void ScTpUserLists::Init()
VclPtr<SfxTabPage> ScTpUserLists::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new ScTpUserLists( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTpUserLists>::Create( pParent, *rAttrSet );
}
void ScTpUserLists::Reset( const SfxItemSet* rCoreAttrs )
@@ -361,7 +361,7 @@ void ScTpUserLists::CopyListFromArea( const ScRefAddress& rStartPos,
if ( (nStartCol != nEndCol) && (nStartRow != nEndRow) )
{
- nCellDir = ScColOrRowDlg( this, aStrCopyList, aStrCopyFrom ).Execute();
+ nCellDir = ScopedVclPtr<ScColOrRowDlg>::Create( this, aStrCopyList, aStrCopyFrom )->Execute();
}
else if ( nStartCol != nEndCol )
nCellDir = SCRET_ROWS;
@@ -701,9 +701,9 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
}
else
{
- MessageDialog(this,
+ ScopedVclPtr<MessageDialog>::Create(this,
ScGlobal::GetRscString( STR_INVALID_TABREF )
- ).Execute();
+ )->Execute();
mpEdCopyFrom->GrabFocus();
mpEdCopyFrom->SetSelection( Selection( 0, SELECTION_MAX ) );
}
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index f1a475fcb60c..c1ba49adc89d 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -128,7 +128,7 @@ void ScTpContentOptions::dispose()
VclPtr<SfxTabPage> ScTpContentOptions::Create( vcl::Window* pParent,
const SfxItemSet* rCoreSet )
{
- return VclPtr<SfxTabPage>( new ScTpContentOptions (pParent, *rCoreSet), SAL_NO_ACQUIRE );
+ return VclPtr<ScTpContentOptions>::Create(pParent, *rCoreSet);
}
bool ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet )
@@ -460,7 +460,7 @@ void ScTpLayoutOptions::dispose()
VclPtr<SfxTabPage> ScTpLayoutOptions::Create( vcl::Window* pParent,
const SfxItemSet* rCoreSet )
{
- VclPtr<ScTpLayoutOptions> pNew( new ScTpLayoutOptions( pParent, *rCoreSet), SAL_NO_ACQUIRE );
+ VclPtrInstance<ScTpLayoutOptions> pNew( pParent, *rCoreSet );
ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
if(pDocSh!=NULL)
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 59b24a048f82..1a14789a8b4c 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -867,7 +867,9 @@ ScRightHeaderEditPage::ScRightHeaderEditPage( vcl::Window* pParent, const SfxIte
{}
VclPtr<SfxTabPage> ScRightHeaderEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return VclPtr<SfxTabPage>( new ScRightHeaderEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); }
+{
+ return VclPtr<ScRightHeaderEditPage>::Create( pParent, *rCoreSet );
+}
// class ScLeftHeaderEditPage
@@ -879,7 +881,9 @@ ScLeftHeaderEditPage::ScLeftHeaderEditPage( vcl::Window* pParent, const SfxItemS
{}
VclPtr<SfxTabPage> ScLeftHeaderEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return VclPtr<SfxTabPage>( new ScLeftHeaderEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); };
+{
+ return VclPtr<ScLeftHeaderEditPage>::Create( pParent, *rCoreSet );
+}
// class ScRightFooterEditPage
@@ -891,7 +895,9 @@ ScRightFooterEditPage::ScRightFooterEditPage( vcl::Window* pParent, const SfxIte
{}
VclPtr<SfxTabPage> ScRightFooterEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return VclPtr<SfxTabPage>( new ScRightFooterEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); };
+{
+ return VclPtr<ScRightFooterEditPage>::Create( pParent, *rCoreSet );
+}
// class ScLeftFooterEditPage
@@ -903,6 +909,8 @@ ScLeftFooterEditPage::ScLeftFooterEditPage( vcl::Window* pParent, const SfxItemS
{}
VclPtr<SfxTabPage> ScLeftFooterEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return VclPtr<SfxTabPage>( new ScLeftFooterEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); };
+{
+ return VclPtr<ScLeftFooterEditPage>::Create( pParent, *rCoreSet );
+};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index cf1918e2403e..8575607d6e48 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -249,7 +249,7 @@ ScHeaderPage::ScHeaderPage( vcl::Window* pParent, const SfxItemSet& rSet )
VclPtr<SfxTabPage> ScHeaderPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
{
- return VclPtr<SfxTabPage>( new ScHeaderPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScHeaderPage>::Create( pParent, *rCoreSet );
}
const sal_uInt16* ScHeaderPage::GetRanges()
@@ -266,7 +266,7 @@ ScFooterPage::ScFooterPage( vcl::Window* pParent, const SfxItemSet& rSet )
VclPtr<SfxTabPage> ScFooterPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
{
- return VclPtr<SfxTabPage>( new ScFooterPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScFooterPage>::Create( pParent, *rCoreSet );
}
const sal_uInt16* ScFooterPage::GetRanges()
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index 910bc3f4423b..685e288796ed 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -156,7 +156,7 @@ void ScTablePage::dispose()
VclPtr<SfxTabPage> ScTablePage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
{
- return VclPtr<SfxTabPage>( new ScTablePage( pParent, *rCoreSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTablePage>::Create( pParent, *rCoreSet );
}
void ScTablePage::Reset( const SfxItemSet* rCoreSet )
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index d557584ab7fd..e3b77fdb8fc4 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -53,7 +53,7 @@ namespace sc { namespace sidebar {
svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent)
{
- return new CellLineStyleControl(pParent, *this);
+ return VclPtr<CellLineStyleControl>::Create(pParent, *this);
}
void CellAppearancePropertyPanel::EndCellLineStylePopupMode()
@@ -66,7 +66,7 @@ void CellAppearancePropertyPanel::EndCellLineStylePopupMode()
svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent)
{
- return new CellBorderStyleControl(pParent, *this);
+ return VclPtr<CellBorderStyleControl>::Create(pParent, *this);
}
void CellAppearancePropertyPanel::EndCellBorderStylePopupMode()
diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx
index 00e8eb14d454..7857685aa1c2 100644
--- a/sc/source/ui/sidebar/ScPanelFactory.cxx
+++ b/sc/source/ui/sidebar/ScPanelFactory.cxx
@@ -94,12 +94,12 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/NavigatorPanel"))
{
- pPanel = VclPtr<vcl::Window>(new ScNavigatorDlg(pBindings, NULL, pParentWindow, false), SAL_NO_ACQUIRE);
+ pPanel = VclPtr<ScNavigatorDlg>::Create(pBindings, nullptr, pParentWindow, false);
nMinimumSize = 0;
}
else if (rsResourceURL.endsWith("/FunctionsPanel"))
{
- pPanel = VclPtr<vcl::Window>(new ScFunctionDockWin(pBindings, NULL, pParentWindow, ScResId(FID_FUNCTION_BOX)), SAL_NO_ACQUIRE);;
+ pPanel = VclPtr<ScFunctionDockWin>::Create(pBindings, nullptr, pParentWindow, ScResId(FID_FUNCTION_BOX));
nMinimumSize = 0;
}
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 6c12d034440a..b1b5d7f6a8ed 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -835,8 +835,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
}
}
else
- MessageDialog (pDlgParent,
- ScGlobal::GetRscString(STR_INVALID_AFAREA) ).Execute();
+ ScopedVclPtrInstance<MessageDialog>(pDlgParent,
+ ScGlobal::GetRscString(STR_INVALID_AFAREA) )->Execute();
}
break;
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 29cfc5fe6990..c3ae18dfa9d8 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -412,9 +412,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
else
{
- nRet = MessageDialog(GetDialogParent(),
+ nRet = ScopedVclPtr<MessageDialog>::Create(GetDialogParent(),
aErrMsg
- ).Execute();
+ )->Execute();
}
}
}