[Libreoffice-commits] core.git: Branch 'feature/vclptr' - 2 commits - sc/source
Noel Grandin
noel at peralex.com
Mon Apr 20 06:55:49 PDT 2015
sc/source/core/data/documen8.cxx | 6 -
sc/source/ui/app/inputwin.cxx | 16 +-
sc/source/ui/attrdlg/scdlgfact.cxx | 114 +++++++++----------
sc/source/ui/cctrl/checklistmenu.cxx | 14 +-
sc/source/ui/condformat/condformatdlg.cxx | 44 +++----
sc/source/ui/condformat/condformatdlgentry.cxx | 100 ++++++++--------
sc/source/ui/condformat/condformatmgr.cxx | 2
sc/source/ui/dbgui/csvgrid.cxx | 4
sc/source/ui/dbgui/csvtablebox.cxx | 10 -
sc/source/ui/dialogs/searchresults.cxx | 4
sc/source/ui/docshell/docsh.cxx | 2
sc/source/ui/formdlg/dwfunctr.cxx | 14 +-
sc/source/ui/miscdlgs/acredlin.cxx | 2
sc/source/ui/miscdlgs/conflictsdlg.cxx | 2
sc/source/ui/miscdlgs/datafdlg.cxx | 4
sc/source/ui/miscdlgs/highred.cxx | 2
sc/source/ui/miscdlgs/optsolver.cxx | 4
sc/source/ui/miscdlgs/retypepassdlg.cxx | 8 -
sc/source/ui/miscdlgs/sharedocdlg.cxx | 2
sc/source/ui/namedlg/namedlg.cxx | 2
sc/source/ui/namedlg/namepast.cxx | 2
sc/source/ui/navipi/navipi.cxx | 18 +--
sc/source/ui/navipi/scenwnd.cxx | 4
sc/source/ui/sidebar/AlignmentPropertyPanel.cxx | 6 -
sc/source/ui/sidebar/AlignmentPropertyPanel.hxx | 11 -
sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx | 6 -
sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx | 11 -
sc/source/ui/sidebar/CellBorderStyleControl.cxx | 10 -
sc/source/ui/sidebar/CellLineStyleControl.cxx | 4
sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx | 6 -
sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx | 11 -
sc/source/ui/view/cellsh1.cxx | 6 -
sc/source/ui/view/gridwin.cxx | 10 -
sc/source/ui/view/gridwin2.cxx | 2
sc/source/ui/view/prevwsh.cxx | 8 -
sc/source/ui/view/reffact.cxx | 7 -
sc/source/ui/view/tabview.cxx | 32 ++---
sc/source/ui/view/tabview3.cxx | 2
sc/source/ui/view/tabview5.cxx | 12 +-
sc/source/ui/view/tabvwshc.cxx | 60 +++++-----
40 files changed, 288 insertions(+), 296 deletions(-)
New commits:
commit b8bc9023a3190cd93150fb14c2e37ad4deb8b435
Author: Noel Grandin <noel at peralex.com>
Date: Mon Apr 20 15:50:17 2015 +0200
sc: convert new to ::Create
Change-Id: I196ef015660a2d87a33957ed3442341001f4a303
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 50cc31d..4867827 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -138,7 +138,7 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
pSet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, static_cast<int>(nFlags) ) );
pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) );
- pPrinter = new SfxPrinter( pSet );
+ pPrinter = VclPtr<SfxPrinter>::Create( pSet );
pPrinter->SetMapMode( MAP_100TH_MM );
UpdateDrawPrinter();
pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
@@ -193,9 +193,9 @@ VirtualDevice* ScDocument::GetVirtualDevice_100th_mm()
if (!pVirtualDevice_100th_mm)
{
#ifdef IOS
- pVirtualDevice_100th_mm = new VirtualDevice( 8 );
+ pVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create( 8 );
#else
- pVirtualDevice_100th_mm = new VirtualDevice( 1 );
+ pVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create( 1 );
#endif
pVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::REFDEV_MODE_MSO1);
MapMode aMapMode( pVirtualDevice_100th_mm->GetMapMode() );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 0c4c042..d5942e6 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -124,7 +124,7 @@ ScInputWindowWrapper::ScInputWindowWrapper( vcl::Window* pParentP,
SfxChildWinInfo* /* pInfo */ )
: SfxChildWindow( pParentP, nId )
{
- ScInputWindow* pWin=new ScInputWindow( pParentP, pBindings );
+ VclPtr<ScInputWindow> pWin=VclPtr<ScInputWindow>::Create( pParentP, pBindings );
pWindow = pWin;
pWin->Show();
@@ -154,7 +154,7 @@ static inline bool lcl_isExperimentalMode()
// class ScInputWindow
-static ScTextWndBase* lcl_chooseRuntimeImpl( vcl::Window* pParent, SfxBindings* pBind )
+static VclPtr<ScTextWndBase> lcl_chooseRuntimeImpl( vcl::Window* pParent, SfxBindings* pBind )
{
ScTabViewShell* pViewSh = NULL;
SfxDispatcher* pDisp = pBind->GetDispatcher();
@@ -166,14 +166,14 @@ static ScTextWndBase* lcl_chooseRuntimeImpl( vcl::Window* pParent, SfxBindings*
}
if ( !lcl_isExperimentalMode() )
- return new ScTextWnd( pParent, pViewSh );
- return new ScInputBarGroup( pParent, pViewSh );
+ return VclPtr<ScTextWnd>::Create( pParent, pViewSh );
+ return VclPtr<ScInputBarGroup>::Create( pParent, pViewSh );
}
ScInputWindow::ScInputWindow( vcl::Window* pParent, SfxBindings* pBind ) :
// With WB_CLIPCHILDREN otherwise we get flickering
ToolBox ( pParent, WinBits(WB_CLIPCHILDREN) ),
- aWndPos ( new ScPosWnd(this) ),
+ aWndPos ( VclPtr<ScPosWnd>::Create(this) ),
pRuntimeWindow ( lcl_chooseRuntimeImpl( this, pBind ) ),
aTextWindow ( *pRuntimeWindow ),
pInputHdl ( NULL ),
@@ -907,9 +907,9 @@ void ScInputWindow::MouseButtonUp( const MouseEvent& rMEvt )
ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, ScTabViewShell* pViewSh)
: ScTextWndBase ( pParent, WinBits(WB_HIDE | WB_TABSTOP ) ),
- aMultiTextWnd ( new ScMultiTextWnd(this, pViewSh) ),
- aButton ( new ImageButton(this, WB_TABSTOP | WB_RECTSTYLE | WB_SMALLSTYLE) ),
- aScrollBar ( new ScrollBar(this, WB_TABSTOP | WB_VERT | WB_DRAG) ),
+ aMultiTextWnd ( VclPtr<ScMultiTextWnd>::Create(this, pViewSh) ),
+ aButton ( VclPtr<ImageButton>::Create(this, WB_TABSTOP | WB_RECTSTYLE | WB_SMALLSTYLE) ),
+ aScrollBar ( VclPtr<ScrollBar>::Create(this, WB_TABSTOP | WB_VERT | WB_DRAG) ),
nVertOffset ( 0 )
{
aMultiTextWnd->Show();
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index a8ca590..0e142fd 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -603,13 +603,13 @@ bool AbstractScTextImportOptionsDlg_Impl::IsDateConversionSet() const
AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg ( vcl::Window* pParent, const OUString& aDatName,
SvStream* pInStream, ScImportAsciiCall eCall )
{
- ScImportAsciiDlg* pDlg = new ScImportAsciiDlg( pParent, aDatName,pInStream, eCall );
+ VclPtr<ScImportAsciiDlg> pDlg = VclPtr<ScImportAsciiDlg>::Create( pParent, aDatName,pInStream, eCall );
return new AbstractScImportAsciiDlg_Impl( pDlg );
}
AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg(vcl::Window* pParent)
{
- ScTextImportOptionsDlg* pDlg = new ScTextImportOptionsDlg(pParent);
+ VclPtr<ScTextImportOptionsDlg> pDlg = VclPtr<ScTextImportOptionsDlg>::Create(pParent);
return new AbstractScTextImportOptionsDlg_Impl(pDlg);
}
@@ -618,7 +618,7 @@ AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg(vc
const ScAutoFormatData* pSelFormatData,
ScViewData *pViewData)
{
- ScAutoFormatDlg* pDlg = new ScAutoFormatDlg(pParent, pAutoFormat, pSelFormatData, pViewData);
+ VclPtr<ScAutoFormatDlg> pDlg = VclPtr<ScAutoFormatDlg>::Create(pParent, pAutoFormat, pSelFormatData, pViewData);
return new AbstractScAutoFormatDlg_Impl(pDlg);
}
@@ -626,24 +626,24 @@ AbstractScColRowLabelDlg * ScAbstractDialogFactory_Impl::CreateScColRowLabelDlg
bool bCol ,
bool bRow)
{
- ScColRowLabelDlg* pDlg = new ScColRowLabelDlg( pParent, bCol,bRow );
+ VclPtr<ScColRowLabelDlg> pDlg = VclPtr<ScColRowLabelDlg>::Create( pParent, bCol,bRow );
return new AbstractScColRowLabelDlg_Impl( pDlg );
}
AbstractScSortWarningDlg* ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( vcl::Window* pParent, const OUString& rExtendText, const OUString& rCurrentText )
{
- ScSortWarningDlg* pDlg = new ScSortWarningDlg(pParent, rExtendText, rCurrentText );
+ VclPtr<ScSortWarningDlg> pDlg = VclPtr<ScSortWarningDlg>::Create(pParent, rExtendText, rCurrentText );
return new AbstractScSortWarningDlg_Impl( pDlg );
}
AbstractScCondFormatManagerDlg* ScAbstractDialogFactory_Impl::CreateScCondFormatMgrDlg(vcl::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList,
const ScAddress& rPos, int nId )
{
- ScCondFormatManagerDlg* pDlg = NULL;
+ VclPtr<ScCondFormatManagerDlg> pDlg;
switch( nId )
{
case RID_SCDLG_COND_FORMAT_MANAGER:
- pDlg = new ScCondFormatManagerDlg( pParent, pDoc, pFormatList, rPos );
+ pDlg = VclPtr<ScCondFormatManagerDlg>::Create( pParent, pDoc, pFormatList, rPos );
break;
default:
break;
@@ -656,14 +656,14 @@ AbstractScCondFormatManagerDlg* ScAbstractDialogFactory_Impl::CreateScCondFormat
AbstractScDataPilotDatabaseDlg * ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg(vcl::Window* pParent)
{
- ScDataPilotDatabaseDlg * pDlg = new ScDataPilotDatabaseDlg( pParent );
+ VclPtr<ScDataPilotDatabaseDlg> pDlg = VclPtr<ScDataPilotDatabaseDlg>::Create( pParent );
return new AbstractScDataPilotDatabaseDlg_Impl( pDlg );
}
AbstractScDataPilotSourceTypeDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSourceTypeDlg(
vcl::Window* pParent, bool bEnableExternal)
{
- ScDataPilotSourceTypeDlg* pDlg = new ScDataPilotSourceTypeDlg(pParent, bEnableExternal);
+ VclPtr<ScDataPilotSourceTypeDlg> pDlg = VclPtr<ScDataPilotSourceTypeDlg>::Create(pParent, bEnableExternal);
return new AbstractScDataPilotSourceTypeDlg_Impl(pDlg);
}
@@ -671,11 +671,11 @@ AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSe
const com::sun::star::uno::Sequence<OUString>& rServices,
int nId )
{
- ScDataPilotServiceDlg * pDlg=NULL;
+ VclPtr<ScDataPilotServiceDlg> pDlg;
switch ( nId )
{
case RID_SCDLG_DAPISERVICE :
- pDlg = new ScDataPilotServiceDlg( pParent, rServices );
+ pDlg = VclPtr<ScDataPilotServiceDlg>::Create( pParent, rServices );
break;
default:
break;
@@ -689,21 +689,21 @@ AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSe
AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg(vcl::Window* pParent,
bool bDisallowCellMove)
{
- ScDeleteCellDlg * pDlg = new ScDeleteCellDlg(pParent, bDisallowCellMove);
+ VclPtr<ScDeleteCellDlg> pDlg = VclPtr<ScDeleteCellDlg>::Create(pParent, bDisallowCellMove);
return new AbstractScDeleteCellDlg_Impl( pDlg );
}
AbstractScDataFormDlg* ScAbstractDialogFactory_Impl::CreateScDataFormDlg(vcl::Window* pParent,
ScTabViewShell* pTabViewShell)
{
- ScDataFormDlg* pDlg = new ScDataFormDlg(pParent, pTabViewShell);
+ VclPtr<ScDataFormDlg> pDlg = VclPtr<ScDataFormDlg>::Create(pParent, pTabViewShell);
return new AbstractScDataFormDlg_Impl(pDlg);
}
AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(vcl::Window* pParent,
InsertDeleteFlags nCheckDefaults)
{
- ScDeleteContentsDlg* pDlg = new ScDeleteContentsDlg(pParent, nCheckDefaults);
+ VclPtr<ScDeleteContentsDlg> pDlg = VclPtr<ScDeleteContentsDlg>::Create(pParent, nCheckDefaults);
return new AbstractScDeleteContentsDlg_Impl( pDlg );
}
@@ -717,15 +717,15 @@ AbstractScFillSeriesDlg* ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( vc
double fMax,
sal_uInt16 nPossDir)
{
- ScFillSeriesDlg * pDlg = new ScFillSeriesDlg( pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nPossDir);
- return new AbstractScFillSeriesDlg_Impl( pDlg );
+ VclPtr<ScFillSeriesDlg> pDlg = VclPtr<ScFillSeriesDlg>::Create( pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nPossDir);
+ return new AbstractScFillSeriesDlg_Impl( pDlg );
}
AbstractScGroupDlg* ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg( vcl::Window* pParent,
bool bUnGroup,
bool bRows )
{
- ScGroupDlg * pDlg = new ScGroupDlg( pParent, bUnGroup, bRows);
+ VclPtr<ScGroupDlg> pDlg = VclPtr<ScGroupDlg>::Create( pParent, bUnGroup, bRows);
return new AbstractScGroupDlg_Impl( pDlg );
}
@@ -733,11 +733,11 @@ AbstractScInsertCellDlg * ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( v
int nId,
bool bDisallowCellMove )
{
- ScInsertCellDlg * pDlg=NULL;
+ VclPtr<ScInsertCellDlg> pDlg;
switch ( nId )
{
case RID_SCDLG_INSCELL :
- pDlg = new ScInsertCellDlg( pParent, bDisallowCellMove);
+ pDlg = VclPtr<ScInsertCellDlg>::Create( pParent, bDisallowCellMove);
break;
default:
break;
@@ -752,27 +752,27 @@ AbstractScInsertContentsDlg * ScAbstractDialogFactory_Impl::CreateScInsertConten
InsertDeleteFlags nCheckDefaults,
const OUString* pStrTitle )
{
- ScInsertContentsDlg * pDlg = new ScInsertContentsDlg(pParent, nCheckDefaults, pStrTitle);
+ VclPtr<ScInsertContentsDlg> pDlg = VclPtr<ScInsertContentsDlg>::Create(pParent, nCheckDefaults, pStrTitle);
return new AbstractScInsertContentsDlg_Impl( pDlg );
}
AbstractScInsertTableDlg * ScAbstractDialogFactory_Impl::CreateScInsertTableDlg(vcl::Window* pParent, ScViewData& rViewData,
SCTAB nTabCount, bool bFromFile)
{
- ScInsertTableDlg* pDlg = new ScInsertTableDlg( pParent, rViewData,nTabCount, bFromFile );
+ VclPtr<ScInsertTableDlg> pDlg = VclPtr<ScInsertTableDlg>::Create( pParent, rViewData,nTabCount, bFromFile );
return new AbstractScInsertTableDlg_Impl( pDlg );
}
AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( vcl::Window* pParent,
const std::vector<OUString> &rEntryList )
{
- ScSelEntryDlg * pDlg = new ScSelEntryDlg( pParent, rEntryList );
+ VclPtr<ScSelEntryDlg> pDlg = VclPtr<ScSelEntryDlg>::Create( pParent, rEntryList );
return new AbstractScSelEntryDlg_Impl( pDlg );
}
AbstractScLinkedAreaDlg * ScAbstractDialogFactory_Impl::CreateScLinkedAreaDlg(vcl::Window* pParent)
{
- ScLinkedAreaDlg* pDlg = new ScLinkedAreaDlg( pParent );
+ VclPtr<ScLinkedAreaDlg> pDlg = VclPtr<ScLinkedAreaDlg>::Create( pParent );
return new AbstractScLinkedAreaDlg_Impl( pDlg );
}
@@ -787,7 +787,7 @@ AbstractScMetricInputDlg * ScAbstractDialogFactory_Impl::CreateScMetricInputDlg
long nFirst,
long nLast )
{
- ScMetricInputDlg * pDlg = new ScMetricInputDlg(pParent, sDialogName, nCurrent ,nDefault, eFUnit,
+ VclPtr<ScMetricInputDlg> pDlg = VclPtr<ScMetricInputDlg>::Create(pParent, sDialogName, nCurrent ,nDefault, eFUnit,
nDecimals, nMaximum , nMinimum , nFirst, nLast);
return new AbstractScMetricInputDlg_Impl( pDlg );
}
@@ -795,26 +795,26 @@ AbstractScMetricInputDlg * ScAbstractDialogFactory_Impl::CreateScMetricInputDlg
AbstractScMoveTableDlg * ScAbstractDialogFactory_Impl::CreateScMoveTableDlg(vcl::Window* pParent,
const OUString& rDefault)
{
- ScMoveTableDlg * pDlg = new ScMoveTableDlg( pParent, rDefault );
+ VclPtr<ScMoveTableDlg> pDlg = VclPtr<ScMoveTableDlg>::Create( pParent, rDefault );
return new AbstractScMoveTableDlg_Impl( pDlg );
}
AbstractScNameCreateDlg * ScAbstractDialogFactory_Impl::CreateScNameCreateDlg(vcl::Window * pParent, sal_uInt16 nFlags)
{
- ScNameCreateDlg * pDlg = new ScNameCreateDlg( pParent, nFlags );
+ VclPtr<ScNameCreateDlg> pDlg = VclPtr<ScNameCreateDlg>::Create( pParent, nFlags );
return new AbstractScNameCreateDlg_Impl( pDlg );
}
AbstractScNamePasteDlg * ScAbstractDialogFactory_Impl::CreateScNamePasteDlg ( vcl::Window * pParent, ScDocShell* pShell, bool bInsList )
{
- ScNamePasteDlg * pDlg = new ScNamePasteDlg( pParent, pShell, bInsList );
+ VclPtr<ScNamePasteDlg> pDlg = VclPtr<ScNamePasteDlg>::Create( pParent, pShell, bInsList );
return new AbstractScNamePasteDlg_Impl( pDlg );
}
AbstractScPivotFilterDlg * ScAbstractDialogFactory_Impl::CreateScPivotFilterDlg(vcl::Window* pParent,
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab)
{
- ScPivotFilterDlg *pDlg = new ScPivotFilterDlg(pParent, rArgSet, nSourceTab);
+ VclPtr<ScPivotFilterDlg> pDlg = VclPtr<ScPivotFilterDlg>::Create(pParent, rArgSet, nSourceTab);
return new AbstractScPivotFilterDlg_Impl(pDlg);
}
@@ -823,7 +823,7 @@ AbstractScDPFunctionDlg * ScAbstractDialogFactory_Impl::CreateScDPFunctionDlg (
const ScDPLabelData& rLabelData,
const ScPivotFuncData& rFuncData )
{
- ScDPFunctionDlg * pDlg = new ScDPFunctionDlg( pParent, rLabelVec, rLabelData, rFuncData );
+ VclPtr<ScDPFunctionDlg> pDlg = VclPtr<ScDPFunctionDlg>::Create( pParent, rLabelVec, rLabelData, rFuncData );
return new AbstractScDPFunctionDlg_Impl( pDlg );
}
@@ -834,7 +834,7 @@ AbstractScDPSubtotalDlg * ScAbstractDialogFactory_Impl::CreateScDPSubtotalDlg (
const ScDPNameVec& rDataFields,
bool bEnableLayout )
{
- ScDPSubtotalDlg * pDlg = new ScDPSubtotalDlg( pParent, rDPObj, rLabelData, rFuncData, rDataFields, bEnableLayout );
+ VclPtr<ScDPSubtotalDlg> pDlg = VclPtr<ScDPSubtotalDlg>::Create( pParent, rDPObj, rLabelData, rFuncData, rDataFields, bEnableLayout );
return new AbstractScDPSubtotalDlg_Impl( pDlg );
}
@@ -842,7 +842,7 @@ AbstractScDPNumGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPNumGroupDlg(
vcl::Window* pParent, int nId, const ScDPNumGroupInfo& rInfo )
{
if( nId == RID_SCDLG_DPNUMGROUP )
- return new AbstractScDPNumGroupDlg_Impl( new ScDPNumGroupDlg( pParent, rInfo ) );
+ return new AbstractScDPNumGroupDlg_Impl( VclPtr<ScDPNumGroupDlg>::Create( pParent, rInfo ) );
return 0;
}
@@ -851,7 +851,7 @@ AbstractScDPDateGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPDateGroupDlg(
const ScDPNumGroupInfo& rInfo, sal_Int32 nDatePart, const Date& rNullDate )
{
if( nId == RID_SCDLG_DPDATEGROUP )
- return new AbstractScDPDateGroupDlg_Impl( new ScDPDateGroupDlg( pParent, rInfo, nDatePart, rNullDate ) );
+ return new AbstractScDPDateGroupDlg_Impl( VclPtr<ScDPDateGroupDlg>::Create( pParent, rInfo, nDatePart, rNullDate ) );
return 0;
}
@@ -859,20 +859,20 @@ AbstractScDPShowDetailDlg * ScAbstractDialogFactory_Impl::CreateScDPShowDetailDl
vcl::Window* pParent, int nId, ScDPObject& rDPObj, sal_uInt16 nOrient )
{
if( nId == RID_SCDLG_DPSHOWDETAIL )
- return new AbstractScDPShowDetailDlg_Impl( new ScDPShowDetailDlg( pParent, rDPObj, nOrient ) );
+ return new AbstractScDPShowDetailDlg_Impl( VclPtr<ScDPShowDetailDlg>::Create( pParent, rDPObj, nOrient ) );
return 0;
}
AbstractScNewScenarioDlg * ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg(vcl::Window* pParent, const OUString& rName,
bool bEdit, bool bSheetProtected)
{
- ScNewScenarioDlg *pDlg = new ScNewScenarioDlg(pParent, rName, bEdit, bSheetProtected);
+ VclPtr<ScNewScenarioDlg> pDlg = VclPtr<ScNewScenarioDlg>::Create(pParent, rName, bEdit, bSheetProtected);
return new AbstractScNewScenarioDlg_Impl( pDlg );
}
AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg(vcl::Window* pParent)
{
- ScShowTabDlg * pDlg = new ScShowTabDlg( pParent);
+ VclPtr<ScShowTabDlg> pDlg = VclPtr<ScShowTabDlg>::Create( pParent);
return new AbstractScShowTabDlg_Impl( pDlg );
}
@@ -882,7 +882,7 @@ AbstractScStringInputDlg * ScAbstractDialogFactory_Impl::CreateScStringInputDlg
const OUString& rDefault,
const OString& sHelpId, const OString& sEditHelpId )
{
- ScStringInputDlg *pDlg = new ScStringInputDlg( pParent, rTitle, rEditTitle, rDefault, sHelpId, sEditHelpId );
+ VclPtr<ScStringInputDlg> pDlg = VclPtr<ScStringInputDlg>::Create( pParent, rTitle, rEditTitle, rDefault, sHelpId, sEditHelpId );
return new AbstractScStringInputDlg_Impl( pDlg );
}
@@ -893,7 +893,7 @@ AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg(
const Color& rDefaultColor,
const OString& sHelpId)
{
- ScTabBgColorDlg * pDlg = new ScTabBgColorDlg( pParent, rTitle, rTabBgColorNoColorText, rDefaultColor, sHelpId );
+ VclPtr<ScTabBgColorDlg> pDlg = VclPtr<ScTabBgColorDlg>::Create( pParent, rTitle, rTabBgColorNoColorText, rDefaultColor, sHelpId );
return new AbstractScTabBgColorDlg_Impl( pDlg );
}
@@ -905,14 +905,14 @@ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptions
bool bOnlyDbtoolsEncodings,
bool bImport )
{
- ScImportOptionsDlg * pDlg = new ScImportOptionsDlg( pParent, bAscii, pOptions,pStrTitle, bMultiByte,bOnlyDbtoolsEncodings, bImport );
+ VclPtr<ScImportOptionsDlg> pDlg = VclPtr<ScImportOptionsDlg>::Create( pParent, bAscii, pOptions,pStrTitle, bMultiByte,bOnlyDbtoolsEncodings, bImport );
return new AbstractScImportOptionsDlg_Impl( pDlg );
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg(SfxViewFrame* pFrame,
vcl::Window* pParent, const SfxItemSet* pCellAttrs)
{
- SfxTabDialog* pDlg = new ScAttrDlg(pFrame, pParent, pCellAttrs);
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScAttrDlg>::Create(pFrame, pParent, pCellAttrs);
return new ScAbstractTabDialog_Impl(pDlg);
}
@@ -922,42 +922,42 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScHFEditDlg( SfxViewF
const OUString& rPageStyle,
sal_uInt16 nResId )
{
- SfxTabDialog* pDlg = NULL;
+ VclPtr<SfxTabDialog> pDlg;
switch (nResId)
{
case RID_SCDLG_HFED_HEADER:
case RID_SCDLG_HFEDIT_HEADER:
- pDlg = new ScHFEditHeaderDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditHeaderDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFED_FOOTER:
case RID_SCDLG_HFEDIT_FOOTER:
- pDlg = new ScHFEditFooterDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditFooterDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_LEFTHEADER:
- pDlg = new ScHFEditLeftHeaderDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditLeftHeaderDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_RIGHTHEADER:
- pDlg = new ScHFEditRightHeaderDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditRightHeaderDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_LEFTFOOTER:
- pDlg = new ScHFEditLeftFooterDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditLeftFooterDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_RIGHTFOOTER:
- pDlg = new ScHFEditRightFooterDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditRightFooterDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_SHDR:
- pDlg = new ScHFEditSharedHeaderDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditSharedHeaderDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_SFTR:
- pDlg = new ScHFEditSharedFooterDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditSharedFooterDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_ALL:
- pDlg = new ScHFEditAllDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditAllDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
default:
case RID_SCDLG_HFEDIT:
- pDlg = new ScHFEditActiveDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditActiveDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
}
@@ -969,12 +969,12 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( vcl::Wind
sal_uInt16 nRscId,
int nId)
{
- SfxTabDialog* pDlg=NULL;
+ VclPtr<SfxTabDialog> pDlg;
switch ( nId )
{
case RID_SCDLG_STYLES_PAGE :
case RID_SCDLG_STYLES_PAR :
- pDlg = new ScStyleDlg( pParent, rStyleBase, nRscId );
+ pDlg = VclPtr<ScStyleDlg>::Create( pParent, rStyleBase, nRscId );
break;
default:
break;
@@ -987,34 +987,34 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( vcl::Wind
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
{
- SfxTabDialog* pDlg = new ScSubTotalDlg( pParent, pArgSet );
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScSubTotalDlg>::Create( pParent, pArgSet );
return new ScAbstractTabDialog_Impl( pDlg );
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg(
vcl::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell)
{
- SfxTabDialog* pDlg = new ScCharDlg(pParent, pAttr, pDocShell);
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScCharDlg>::Create(pParent, pAttr, pDocShell);
return new ScAbstractTabDialog_Impl(pDlg);
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg(
vcl::Window* pParent, const SfxItemSet* pAttr)
{
- SfxTabDialog* pDlg = new ScParagraphDlg(pParent, pAttr);
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScParagraphDlg>::Create(pParent, pAttr);
return new ScAbstractTabDialog_Impl(pDlg);
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScValidationDlg(vcl::Window* pParent,
const SfxItemSet* pArgSet, ScTabViewShell *pTabVwSh)
{
- SfxTabDialog* pDlg = new ScValidationDlg(pParent, pArgSet, pTabVwSh);
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScValidationDlg>::Create(pParent, pArgSet, pTabVwSh);
return new ScAbstractTabDialog_Impl(pDlg);
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
{
- SfxTabDialog* pDlg = new ScSortDlg( pParent, pArgSet );
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScSortDlg>::Create( pParent, pArgSet );
return new ScAbstractTabDialog_Impl( pDlg );
}
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 113c0e7..3fa8a6a8 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -314,7 +314,7 @@ ScMenuFloatingWindow* ScMenuFloatingWindow::addSubMenuItem(const OUString& rText
MenuItemData aItem;
aItem.maText = rText;
aItem.mbEnabled = bEnabled;
- aItem.mpSubMenuWin.reset(new ScMenuFloatingWindow(this, mpDoc, GetMenuStackLevel()+1));
+ aItem.mpSubMenuWin.reset(VclPtr<ScMenuFloatingWindow>::Create(this, mpDoc, GetMenuStackLevel()+1));
aItem.mpSubMenuWin->setName(rText);
maMenuItems.push_back(aItem);
return aItem.mpSubMenuWin.get();
@@ -875,12 +875,12 @@ void ScCheckListMenuWindow::CancelButton::Click()
ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc) :
ScMenuFloatingWindow(pParent, pDoc),
maEdSearch(new Edit (this)),
- maChecks(new ScCheckListBox(this, WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT) ),
- maChkToggleAll(new TriStateBox(this, 0)),
- maBtnSelectSingle(new ImageButton(this, 0)),
- maBtnUnselectSingle(new ImageButton(this, 0)),
- maBtnOk(new OKButton(this)),
- maBtnCancel(new CancelButton(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)),
+ maBtnUnselectSingle(VclPtr<ImageButton>::Create(this, 0)),
+ maBtnOk(VclPtr<OKButton>::Create(this)),
+ maBtnCancel(VclPtr<CancelButton>::Create(this)),
mnCurTabStop(0),
mpExtendedData(NULL),
mpOKAction(NULL),
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 1076f7b..59d3431 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -37,7 +37,7 @@
ScCondFormatList::ScCondFormatList(vcl::Window* pParent, WinBits nStyle)
: Control(pParent, nStyle | WB_DIALOGCONTROL)
, mbHasScrollBar(false)
- , mpScrollBar(new ScrollBar(this, WB_VERT ))
+ , mpScrollBar(VclPtr<ScrollBar>::Create(this, WB_VERT ))
, mpDoc(NULL)
, mpDialogParent(NULL)
{
@@ -80,9 +80,9 @@ void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
{
const ScCondFormatEntry* pConditionEntry = static_cast<const ScCondFormatEntry*>( pEntry );
if(pConditionEntry->GetOperation() != SC_COND_DIRECT)
- maEntries.push_back(new ScConditionFrmtEntry( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
+ maEntries.push_back(VclPtr<ScConditionFrmtEntry>::Create( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
else
- maEntries.push_back(new ScFormulaFrmtEntry( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
+ maEntries.push_back(VclPtr<ScFormulaFrmtEntry>::Create( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
}
break;
@@ -90,19 +90,19 @@ void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
{
const ScColorScaleFormat* pColorScale = static_cast<const ScColorScaleFormat*>( pEntry );
if( pColorScale->size() == 2 )
- maEntries.push_back(new ScColorScale2FrmtEntry( this, mpDoc, maPos, pColorScale ) );
+ maEntries.push_back(VclPtr<ScColorScale2FrmtEntry>::Create( this, mpDoc, maPos, pColorScale ) );
else
- maEntries.push_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos, pColorScale ) );
+ maEntries.push_back(VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos, pColorScale ) );
}
break;
case condformat::DATABAR:
- maEntries.push_back(new ScDataBarFrmtEntry( this, mpDoc, maPos, static_cast<const ScDataBarFormat*>( pEntry ) ) );
+ maEntries.push_back(VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos, static_cast<const ScDataBarFormat*>( pEntry ) ) );
break;
case condformat::ICONSET:
- maEntries.push_back(new ScIconSetFrmtEntry( this, mpDoc, maPos, static_cast<const ScIconSetFormat*>( pEntry ) ) );
+ maEntries.push_back(VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos, static_cast<const ScIconSetFormat*>( pEntry ) ) );
break;
case condformat::DATE:
- maEntries.push_back(new ScDateFrmtEntry( this, mpDoc, static_cast<const ScCondDateFormatEntry*>( pEntry ) ) );
+ maEntries.push_back(VclPtr<ScDateFrmtEntry>::Create( this, mpDoc, static_cast<const ScCondDateFormatEntry*>( pEntry ) ) );
break;
}
}
@@ -114,19 +114,19 @@ void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
switch(eType)
{
case condformat::dialog::CONDITION:
- maEntries.push_back(new ScConditionFrmtEntry( this, mpDoc, pDialogParent, maPos ));
+ maEntries.push_back(VclPtr<ScConditionFrmtEntry>::Create( this, mpDoc, pDialogParent, maPos ));
break;
case condformat::dialog::COLORSCALE:
- maEntries.push_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos ));
+ maEntries.push_back(VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos ));
break;
case condformat::dialog::DATABAR:
- maEntries.push_back(new ScDataBarFrmtEntry( this, mpDoc, maPos ));
+ maEntries.push_back(VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos ));
break;
case condformat::dialog::ICONSET:
- maEntries.push_back(new ScIconSetFrmtEntry( this, mpDoc, maPos ));
+ maEntries.push_back(VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos ));
break;
case condformat::dialog::DATE:
- maEntries.push_back(new ScDateFrmtEntry( this, mpDoc ));
+ maEntries.push_back(VclPtr<ScDateFrmtEntry>::Create( this, mpDoc ));
break;
case condformat::dialog::NONE:
break;
@@ -250,25 +250,25 @@ IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox*, pBox)
if((*itr)->GetType() == condformat::entry::COLORSCALE2)
return 0;
- *itr = new ScColorScale2FrmtEntry( this, mpDoc, maPos );
+ *itr = VclPtr<ScColorScale2FrmtEntry>::Create( this, mpDoc, maPos );
break;
case 1:
if((*itr)->GetType() == condformat::entry::COLORSCALE3)
return 0;
- *itr = new ScColorScale3FrmtEntry( this, mpDoc, maPos );
+ *itr = VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos );
break;
case 2:
if((*itr)->GetType() == condformat::entry::DATABAR)
return 0;
- *itr = new ScDataBarFrmtEntry( this, mpDoc, maPos );
+ *itr = VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos );
break;
case 3:
if((*itr)->GetType() == condformat::entry::ICONSET)
return 0;
- *itr = new ScIconSetFrmtEntry( this, mpDoc, maPos );
+ *itr = VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos );
break;
default:
break;
@@ -316,7 +316,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox)
case condformat::entry::ICONSET:
return 0;
}
- *itr = new ScColorScale3FrmtEntry(this, mpDoc, maPos);
+ *itr = VclPtr<ScColorScale3FrmtEntry>::Create(this, mpDoc, maPos);
mpDialogParent->InvalidateRefData();
(*itr)->SetActive();
break;
@@ -324,7 +324,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox)
if((*itr)->GetType() == condformat::entry::CONDITION)
return 0;
- *itr = new ScConditionFrmtEntry(this, mpDoc, mpDialogParent, maPos);
+ *itr = VclPtr<ScConditionFrmtEntry>::Create(this, mpDoc, mpDialogParent, maPos);
mpDialogParent->InvalidateRefData();
(*itr)->SetActive();
break;
@@ -332,7 +332,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox)
if((*itr)->GetType() == condformat::entry::FORMULA)
return 0;
- *itr = new ScFormulaFrmtEntry(this, mpDoc, mpDialogParent, maPos);
+ *itr = VclPtr<ScFormulaFrmtEntry>::Create(this, mpDoc, mpDialogParent, maPos);
mpDialogParent->InvalidateRefData();
(*itr)->SetActive();
break;
@@ -340,7 +340,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox)
if((*itr)->GetType() == condformat::entry::DATE)
return 0;
- *itr = new ScDateFrmtEntry( this, mpDoc );
+ *itr = VclPtr<ScDateFrmtEntry>::Create( this, mpDoc );
mpDialogParent->InvalidateRefData();
(*itr)->SetActive();
break;
@@ -352,7 +352,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox)
IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl )
{
- ScCondFrmtEntry* pNewEntry = new ScConditionFrmtEntry(this, mpDoc, mpDialogParent, maPos);
+ VclPtr<ScCondFrmtEntry> pNewEntry = VclPtr<ScConditionFrmtEntry>::Create(this, mpDoc, mpDialogParent, maPos);
maEntries.push_back( pNewEntry );
for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 07e3548..ac0bd52 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -38,11 +38,11 @@
ScCondFrmtEntry::ScCondFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos):
Control(pParent, ScResId( RID_COND_ENTRY ) ),
mbActive(false),
- maFtCondNr( new FixedText( this, ScResId( FT_COND_NR ) ) ),
- maFtCondition( new FixedText( this, ScResId( FT_CONDITION ) ) ),
+ maFtCondNr( VclPtr<FixedText>::Create( this, ScResId( FT_COND_NR ) ) ),
+ maFtCondition( VclPtr<FixedText>::Create( this, ScResId( FT_CONDITION ) ) ),
mnIndex(0),
maStrCondition(ScResId( STR_CONDITION ).toString()),
- maLbType( new ListBox( this, ScResId( LB_TYPE ) ) ),
+ maLbType( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE ) ) ),
mpDoc(pDoc),
maPos(rPos)
{
@@ -188,13 +188,13 @@ const ScConditionMode ScConditionFrmtEntry::mpEntryToCond[ScConditionFrmtEntry::
ScConditionFrmtEntry::ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbCondType( new ListBox( this, ScResId( LB_CELLIS_TYPE ) ) ),
- maEdVal1( new formula::RefEdit( this, NULL, NULL, ScResId( ED_VAL1 ) ) ),
- maEdVal2( new formula::RefEdit( this, NULL, NULL, ScResId( ED_VAL2 ) ) ),
- maFtVal( new FixedText( this, ScResId( FT_VAL ) ) ),
- maFtStyle( new FixedText( this, ScResId( FT_STYLE ) ) ),
- maLbStyle( new ListBox( this, ScResId( LB_STYLE ) ) ),
- maWdPreview( new SvxFontPrevWindow( this, ScResId( WD_PREVIEW ) ) ),
+ maLbCondType( VclPtr<ListBox>::Create( this, ScResId( LB_CELLIS_TYPE ) ) ),
+ maEdVal1( VclPtr<formula::RefEdit>::Create( this, nullptr, nullptr, ScResId( ED_VAL1 ) ) ),
+ maEdVal2( VclPtr<formula::RefEdit>::Create( this, nullptr, nullptr, ScResId( ED_VAL2 ) ) ),
+ maFtVal( VclPtr<FixedText>::Create( this, ScResId( FT_VAL ) ) ),
+ maFtStyle( VclPtr<FixedText>::Create( this, ScResId( FT_STYLE ) ) ),
+ maLbStyle( VclPtr<ListBox>::Create( this, ScResId( LB_STYLE ) ) ),
+ maWdPreview( VclPtr<SvxFontPrevWindow>::Create( this, ScResId( WD_PREVIEW ) ) ),
mbIsInStyleCreate(false)
{
@@ -591,10 +591,10 @@ IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl)
ScFormulaFrmtEntry::ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maFtStyle( new FixedText( this, ScResId( FT_STYLE ) ) ),
- maLbStyle( new ListBox( this, ScResId( LB_STYLE ) ) ),
- maWdPreview( new SvxFontPrevWindow( this, ScResId( WD_PREVIEW ) ) ),
- maEdFormula( new formula::RefEdit(this, NULL, NULL, ScResId( ED_FORMULA ) ) )
+ maFtStyle( VclPtr<FixedText>::Create( this, ScResId( FT_STYLE ) ) ),
+ maLbStyle( VclPtr<ListBox>::Create( this, ScResId( LB_STYLE ) ) ),
+ maWdPreview( VclPtr<SvxFontPrevWindow>::Create( this, ScResId( WD_PREVIEW ) ) ),
+ maEdFormula( VclPtr<formula::RefEdit>::Create(this, nullptr, nullptr, ScResId( ED_FORMULA ) ) )
{
Init(pDialogParent);
@@ -775,13 +775,13 @@ ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListB
ScColorScale2FrmtEntry::ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbColorFormat( new ListBox( this, ScResId( LB_COLOR_FORMAT ) ) ),
- maLbEntryTypeMin( new ListBox( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ),
- maLbEntryTypeMax( new ListBox( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ),
- maEdMin( new Edit( this, ScResId( ED_COL_SCALE_MIN ) ) ),
- maEdMax( new Edit( this, ScResId( ED_COL_SCALE_MAX ) ) ),
- maLbColMin( new ColorListBox( this, ScResId( LB_COL_MIN ) ) ),
- maLbColMax( new ColorListBox( this, ScResId( LB_COL_MAX ) ) )
+ maLbColorFormat( VclPtr<ListBox>::Create( this, ScResId( LB_COLOR_FORMAT ) ) ),
+ maLbEntryTypeMin( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ),
+ maLbEntryTypeMax( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ),
+ maEdMin( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MIN ) ) ),
+ maEdMax( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MAX ) ) ),
+ maLbColMin( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MIN ) ) ),
+ maLbColMax( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MAX ) ) )
{
// remove the automatic entry from color scales
maLbEntryTypeMin->RemoveEntry(0);
@@ -943,16 +943,16 @@ IMPL_LINK( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox*, pBox )
ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbColorFormat( new ListBox( this, ScResId( LB_COLOR_FORMAT ) ) ),
- maLbEntryTypeMin( new ListBox( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ),
- maLbEntryTypeMiddle( new ListBox( this, ScResId( LB_TYPE_COL_SCALE_MIDDLE ) ) ),
- maLbEntryTypeMax( new ListBox( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ),
- maEdMin( new Edit( this, ScResId( ED_COL_SCALE_MIN ) ) ),
- maEdMiddle( new Edit( this, ScResId( ED_COL_SCALE_MIDDLE ) ) ),
- maEdMax( new Edit( this, ScResId( ED_COL_SCALE_MAX ) ) ),
- maLbColMin( new ColorListBox( this, ScResId( LB_COL_MIN ) ) ),
- maLbColMiddle( new ColorListBox( this, ScResId( LB_COL_MIDDLE ) ) ),
- maLbColMax( new ColorListBox( this, ScResId( LB_COL_MAX ) ) )
+ maLbColorFormat( VclPtr<ListBox>::Create( this, ScResId( LB_COLOR_FORMAT ) ) ),
+ maLbEntryTypeMin( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ),
+ maLbEntryTypeMiddle( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MIDDLE ) ) ),
+ maLbEntryTypeMax( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ),
+ maEdMin( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MIN ) ) ),
+ maEdMiddle( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MIDDLE ) ) ),
+ maEdMax( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MAX ) ) ),
+ maLbColMin( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MIN ) ) ),
+ maLbColMiddle( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MIDDLE ) ) ),
+ maLbColMax( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MAX ) ) )
{
// remove the automatic entry from color scales
maLbEntryTypeMin->RemoveEntry(0);
@@ -1197,12 +1197,12 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Ed
ScDataBarFrmtEntry::ScDataBarFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbColorFormat( new ListBox( this, ScResId( LB_COLOR_FORMAT ) ) ),
- maLbDataBarMinType( new ListBox( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ),
- maLbDataBarMaxType( new ListBox( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ),
- maEdDataBarMin( new Edit( this, ScResId( ED_COL_SCALE_MIN ) ) ),
- maEdDataBarMax( new Edit( this, ScResId( ED_COL_SCALE_MAX ) ) ),
- maBtOptions( new PushButton( this, ScResId( BTN_OPTIONS ) ) )
+ maLbColorFormat( VclPtr<ListBox>::Create( this, ScResId( LB_COLOR_FORMAT ) ) ),
+ maLbDataBarMinType( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ),
+ maLbDataBarMaxType( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ),
+ maEdDataBarMin( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MIN ) ) ),
+ maEdDataBarMax( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MAX ) ) ),
+ maBtOptions( VclPtr<PushButton>::Create( this, ScResId( BTN_OPTIONS ) ) )
{
maLbColorFormat->SelectEntryPos(2);
maLbType->SelectEntryPos(0);
@@ -1326,7 +1326,7 @@ IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl )
{
SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), *maLbDataBarMinType.get(), *maEdDataBarMin.get(), mpDoc, maPos, true);
SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), *maLbDataBarMaxType.get(), *maEdDataBarMax.get(), mpDoc, maPos, true);
- ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData, mpDoc, maPos);
+ ScopedVclPtrInstance<ScDataBarSettingsDlg> pDlg(this, *mpDataBarData, mpDoc, maPos);
if( pDlg->Execute() == RET_OK)
{
mpDataBarData.reset(pDlg->GetData());
@@ -1339,10 +1339,10 @@ IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl )
ScDateFrmtEntry::ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat ):
ScCondFrmtEntry( pParent, pDoc, ScAddress() ),
- maLbDateEntry( new ListBox( this, ScResId( LB_DATE_TYPE ) ) ),
- maFtStyle( new FixedText( this, ScResId( FT_STYLE ) ) ),
- maLbStyle( new ListBox( this, ScResId( LB_STYLE ) ) ),
- maWdPreview( new SvxFontPrevWindow( this, ScResId( WD_PREVIEW ) ) ),
+ maLbDateEntry( VclPtr<ListBox>::Create( this, ScResId( LB_DATE_TYPE ) ) ),
+ maFtStyle( VclPtr<FixedText>::Create( this, ScResId( FT_STYLE ) ) ),
+ maLbStyle( VclPtr<ListBox>::Create( this, ScResId( LB_STYLE ) ) ),
+ maWdPreview( VclPtr<SvxFontPrevWindow>::Create( this, ScResId( WD_PREVIEW ) ) ),
mbIsInStyleCreate(false)
{
Init();
@@ -1464,10 +1464,10 @@ class ScIconSetFrmtDataEntry : public Control
ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc, sal_Int32 i, const ScColorScaleEntry* pEntry ):
Control( pParent, ScResId( RID_ICON_SET_ENTRY ) ),
- maImgIcon( new FixedImage( this, ScResId( IMG_ICON ) ) ),
- maFtEntry( new FixedText( this, ScResId( FT_ICON_SET_ENTRY_TEXT ) ) ),
- maEdEntry( new Edit( this, ScResId( ED_ICON_SET_ENTRY_VALUE ) ) ),
- maLbEntryType( new ListBox( this, ScResId( LB_ICON_SET_ENTRY_TYPE ) ) )
+ maImgIcon( VclPtr<FixedImage>::Create( this, ScResId( IMG_ICON ) ) ),
+ maFtEntry( VclPtr<FixedText>::Create( this, ScResId( FT_ICON_SET_ENTRY_TEXT ) ) ),
+ maEdEntry( VclPtr<Edit>::Create( this, ScResId( ED_ICON_SET_ENTRY_VALUE ) ) ),
+ maLbEntryType( VclPtr<ListBox>::Create( this, ScResId( LB_ICON_SET_ENTRY_TYPE ) ) )
{
maImgIcon->SetImage(Image(ScIconSetFormat::getBitmap(eType, i)));
if(pEntry)
@@ -1560,8 +1560,8 @@ void ScIconSetFrmtDataEntry::SetFirstEntry()
ScIconSetFrmtEntry::ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbColorFormat( new ListBox( this, ScResId( LB_COLOR_FORMAT ) ) ),
- maLbIconSetType( new ListBox( this, ScResId( LB_ICONSET_TYPE ) ) )
+ maLbColorFormat( VclPtr<ListBox>::Create( this, ScResId( LB_COLOR_FORMAT ) ) ),
+ maLbIconSetType( VclPtr<ListBox>::Create( this, ScResId( LB_ICONSET_TYPE ) ) )
{
Init();
FreeResource();
@@ -1577,7 +1577,7 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc,
for(size_t i = 0, n = pIconSetFormatData->maEntries.size();
i < n; ++i)
{
- maEntries.push_back( new ScIconSetFrmtDataEntry( this, eType, pDoc, i, &pIconSetFormatData->maEntries[i] ) );
+ maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create( this, eType, pDoc, i, &pIconSetFormatData->maEntries[i] ) );
Point aPos = maEntries[0]->GetPosPixel();
aPos.Y() += maEntries[0]->GetSizePixel().Height() * i * 1.2;
maEntries[i]->SetPosPixel( aPos );
@@ -1619,7 +1619,7 @@ IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl )
for(size_t i = 0; i < nElements; ++i)
{
- maEntries.push_back( new ScIconSetFrmtDataEntry( this, static_cast<ScIconSetType>(nPos), mpDoc, i ) );
+ maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create( this, static_cast<ScIconSetType>(nPos), mpDoc, i ) );
Point aPos = maEntries[0]->GetPosPixel();
aPos.Y() += maEntries[0]->GetSizePixel().Height() * i * 1.2;
maEntries[i]->SetPosPixel( aPos );
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index 98846c9..d36dd1e 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -120,7 +120,7 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument*
Size aSize(LogicToPixel(Size(290, 220), MAP_APPFONT));
pContainer->set_width_request(aSize.Width());
pContainer->set_height_request(aSize.Height());
- m_pCtrlManager = new ScCondFormatManagerWindow(*pContainer, mpDoc, mpFormatList);
+ m_pCtrlManager = VclPtr<ScCondFormatManagerWindow>::Create(*pContainer, mpDoc, mpFormatList);
get(m_pBtnAdd, "add");
get(m_pBtnRemove, "remove");
get(m_pBtnEdit, "edit");
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 76e0395..c0adb89 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -62,8 +62,8 @@ struct Func_Select
ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) :
ScCsvControl( rParent ),
- mpBackgrDev( new VirtualDevice() ),
- mpGridDev( new VirtualDevice() ),
+ mpBackgrDev( VclPtr<VirtualDevice>::Create() ),
+ mpGridDev( VclPtr<VirtualDevice>::Create() ),
mpColorConfig( 0 ),
mpEditEngine( new ScEditEngineDefaulter( EditEngine::CreatePool(), true ) ),
maHeaderFont( GetFont() ),
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index 37fc651..9dab722 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -25,11 +25,11 @@
ScCsvTableBox::ScCsvTableBox( vcl::Window* pParent, WinBits nBits ) :
ScCsvControl( pParent, maData, nBits ),
- maRuler( new ScCsvRuler(*this) ),
- maGrid( new ScCsvGrid(*this) ),
- maHScroll( new ScrollBar( this, WB_HORZ | WB_DRAG ) ),
- maVScroll( new ScrollBar( this, WB_VERT | WB_DRAG ) ),
- maScrollBox( new ScrollBarBox(this) )
+ maRuler( VclPtr<ScCsvRuler>::Create(*this) ),
+ maGrid( VclPtr<ScCsvGrid>::Create(*this) ),
+ maHScroll( VclPtr<ScrollBar>::Create( this, WB_HORZ | WB_DRAG ) ),
+ maVScroll( VclPtr<ScrollBar>::Create( this, WB_VERT | WB_DRAG ) ),
+ maScrollBox( VclPtr<ScrollBarBox>::Create(this) )
{
mbFixedMode = false;
mnFixedWidth = 1;
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx
index 7dd4ce6..2d91c92 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -32,7 +32,7 @@ SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParen
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(aControlSize.Height());
- mpList = new SvSimpleTable(*pContainer);
+ mpList = VclPtr<SvSimpleTable>::Create(*pContainer);
long nTabs[] = {3, 0, 40, 60};
mpList->SetTabs(&nTabs[0]);
mpList->InsertHeaderEntry(SC_RESSTR(STR_SHEET) + "\t" + SC_RESSTR(STR_CELL) + "\t" + SC_RESSTR(STR_CONTENT));
@@ -124,7 +124,7 @@ SearchResultsDlgWrapper::SearchResultsDlgWrapper(
vcl::Window* _pParent, sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* /*pInfo*/ ) :
SfxChildWindow(_pParent, nId)
{
- pWindow = new SearchResultsDlg(pBindings, _pParent, nId);
+ pWindow = VclPtr<SearchResultsDlg>::Create(pBindings, _pParent, nId);
}
SearchResultsDlgWrapper::~SearchResultsDlgWrapper() {}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 457411d..6fd3733 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2886,7 +2886,7 @@ void ScDocShell::GetDocStat( ScDocStat& rDocStat )
VclPtr<SfxDocumentInfoDialog> ScDocShell::CreateDocumentInfoDialog(
vcl::Window *pParent, const SfxItemSet &rSet )
{
- SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog( pParent, rSet );
+ VclPtr<SfxDocumentInfoDialog> pDlg = VclPtr<SfxDocumentInfoDialog>::Create( pParent, rSet );
ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
// Only for statistics, if this Doc is shown; not from the Doc Manager
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index a6766cb..1a692d5 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -63,7 +63,7 @@ ScFunctionChildWindow::ScFunctionChildWindow( vcl::Window* pParentP,
SfxChildWinInfo* pInfo ) :
SfxChildWindow( pParentP, nId )
{
- ScFunctionDockWin* pWin = new ScFunctionDockWin( pBindings, this,
+ VclPtr<ScFunctionDockWin> pWin = VclPtr<ScFunctionDockWin>::Create( pBindings, this,
pParentP, ScResId( FID_FUNCTION_BOX ) );
pWindow = pWin;
@@ -90,12 +90,12 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP,
SfxChildWindow *pCW, vcl::Window* pParent, const ResId& rResId ) :
SfxDockingWindow( pBindingsP, pCW, pParent, rResId ),
- aPrivatSplit ( new ScPrivatSplit( this, ResId( FT_SPLIT, *rResId.GetResMgr() ),SC_SPLIT_VERT) ),
- aCatBox ( new ListBox( this, ResId( CB_CAT, *rResId.GetResMgr() ) ) ),
- aFuncList ( new ListBox( this, ResId( LB_FUNC, *rResId.GetResMgr() ) ) ),
- aDDFuncList ( new ListBox( this, ResId( DDLB_FUNC, *rResId.GetResMgr() ) ) ),
- aInsertButton ( new ImageButton( this, ResId( IMB_INSERT, *rResId.GetResMgr() ) ) ),
- aFiFuncDesc ( new FixedText( this, ResId( FI_FUNCDESC, *rResId.GetResMgr() ) ) ),
+ aPrivatSplit ( VclPtr<ScPrivatSplit>::Create( this, ResId( FT_SPLIT, *rResId.GetResMgr() ),SC_SPLIT_VERT) ),
+ aCatBox ( VclPtr<ListBox>::Create( this, ResId( CB_CAT, *rResId.GetResMgr() ) ) ),
+ aFuncList ( VclPtr<ListBox>::Create( this, ResId( LB_FUNC, *rResId.GetResMgr() ) ) ),
+ aDDFuncList ( VclPtr<ListBox>::Create( this, ResId( DDLB_FUNC, *rResId.GetResMgr() ) ) ),
+ aInsertButton ( VclPtr<ImageButton>::Create( this, ResId( IMB_INSERT, *rResId.GetResMgr() ) ) ),
+ aFiFuncDesc ( VclPtr<FixedText>::Create( this, ResId( FI_FUNCDESC, *rResId.GetResMgr() ) ) ),
aOldSize (0,0),
pFuncDesc (NULL)
{
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index f420316..ac1b5a4 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -111,7 +111,7 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window
bHasFilterEntry(false),
bUseColor(false)
{
- m_pAcceptChgCtr = new SvxAcceptChgCtr(get_content_area(), this);
+ m_pAcceptChgCtr = VclPtr<SvxAcceptChgCtr>::Create(get_content_area(), this);
nAcceptCount=0;
nRejectCount=0;
aReOpenIdle.SetPriority(SchedulerPriority::MEDIUM);
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 03e269b..975cf1a 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -374,7 +374,7 @@ void ScConflictsResolver::HandleAction( ScChangeAction* pAction, bool bIsSharedA
ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScDocument* pSharedDoc, ScConflictsList& rConflictsList )
:ModalDialog( pParent, "ConflictsDialog", "modules/scalc/ui/conflictsdialog.ui" )
,m_pLbConflictsContainer ( get<SvSimpleTableContainer>("container") )
- ,m_pLbConflicts ( new SvxRedlinTable(*m_pLbConflictsContainer) )
+ ,m_pLbConflicts ( VclPtr<SvxRedlinTable>::Create(*m_pLbConflictsContainer) )
,maStrTitleConflict ( ScResId( STR_TITLE_CONFLICT ) )
,maStrTitleAuthor ( ScResId( STR_TITLE_AUTHOR ) )
,maStrTitleDate ( ScResId( STR_TITLE_DATE ) )
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 2029fcd..5b1d6c8 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -154,8 +154,8 @@ ScDataFormDlg::ScDataFormDlg(vcl::Window* pParent, ScTabViewShell* pTabViewShell
int nColWidth = pDoc->GetColWidth( nIndex + nStartCol, nTab );
if (nColWidth)
{
- maFixedTexts.push_back( new FixedText(m_pGrid) );
- maEdits.push_back( new Edit(m_pGrid, WB_BORDER) );
+ maFixedTexts.push_back( VclPtr<FixedText>::Create(m_pGrid) );
+ maEdits.push_back( VclPtr<Edit>::Create(m_pGrid, WB_BORDER) );
maFixedTexts[nIndex]->set_grid_left_attach(0);
maEdits[nIndex]->set_grid_left_attach(1);
diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx
index 4c5fc95..8141ca0 100644
--- a/sc/source/ui/miscdlgs/highred.cxx
+++ b/sc/source/ui/miscdlgs/highred.cxx
@@ -46,7 +46,7 @@ ScHighlightChgDlg::ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl:
, pDoc(ptrViewData->GetDocument())
, aLocalRangeName(*(pDoc->GetRangeName()))
{
- m_pFilterCtr = new SvxTPFilter(get<VclContainer>("box"));
+ m_pFilterCtr = VclPtr<SvxTPFilter>::Create(get<VclContainer>("box"));
get(m_pHighlightBox, "showchanges");
get(m_pCbAccept, "showaccepted");
get(m_pCbReject, "showrejected");
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 013b89e..9b4f998 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -137,7 +137,7 @@ ScCursorRefEdit::ScCursorRefEdit( vcl::Window* pParent, vcl::Window *pLabel )
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeScCursorRefEdit(vcl::Window *pParent,
VclBuilder::stringmap &)
{
- return new ScCursorRefEdit(pParent, NULL);
+ return new ScCursorRefEdit(pParent, nullptr);
}
void ScCursorRefEdit::SetCursorLinks( const Link& rUp, const Link& rDown )
@@ -637,7 +637,7 @@ IMPL_LINK( ScOptSolverDlg, BtnHdl, PushButton*, pBtn )
{
//! move options dialog to UI lib?
ScopedVclPtr<ScSolverOptionsDialog> pOptDlg(
- new ScSolverOptionsDialog( this, maImplNames, maDescriptions, maEngine, maProperties ));
+ VclPtr<ScSolverOptionsDialog>::Create( this, maImplNames, maDescriptions, maEngine, maProperties ));
if ( pOptDlg->Execute() == RET_OK )
{
maEngine = pOptDlg->GetEngine();
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index 68f1d7f..60be4c4 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -110,17 +110,17 @@ void ScRetypePassDlg::SetDataFromDocument(const ScDocument& rDoc)
aTabItem.mpProtect.reset(new ScTableProtection(*pTabProtect));
maTableItems.push_back(aTabItem);
- VclHBox* pSheet = new VclHBox(mpSheetsBox, false, 12);
+ VclPtr<VclHBox> pSheet = VclPtr<VclHBox>::Create(mpSheetsBox, false, 12);
pSheet->Show(true);
- FixedText* pFtSheetName = new FixedText(pSheet);
+ VclPtr<FixedText> pFtSheetName = VclPtr<FixedText>::Create(pSheet);
pFtSheetName->Show(true);
pFtSheetName->SetStyle(WB_VCENTER);
- FixedText* pFtSheetStatus = new FixedText(pSheet);
+ FixedText* pFtSheetStatus = VclPtr<FixedText>::Create(pSheet);
pFtSheetStatus->Show(true);
pFtSheetStatus->SetStyle(WB_VCENTER);
- PushButton* pBtnSheet = new PushButton(pSheet);
+ VclPtr<PushButton> pBtnSheet = VclPtr<PushButton>::Create((vcl::Window*)pSheet);
pBtnSheet->SetText(ScResId(STR_RETYPE));
pBtnSheet->SetClickHdl(LINK(this, ScRetypePassDlg, RetypeBtnHdl));
pBtnSheet->Disable();
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index ac80d10..958b485 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -83,7 +83,7 @@ ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewD
SvSimpleTableContainer *pCtrl = get<SvSimpleTableContainer>("users");
pCtrl->set_height_request(pCtrl->GetTextHeight()*9);
- m_pLbUsers = new ScShareTable(*pCtrl);
+ m_pLbUsers = VclPtr<ScShareTable>::Create(*pCtrl);
m_aStrNoUserData = get<FixedText>("nouserdata")->GetText();
m_aStrUnknownUser = get<FixedText>("unknownuser")->GetText();
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index f5a1053..090738c 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -136,7 +136,7 @@ void ScNameDlg::Init()
SvSimpleTableContainer *pCtrl = get<SvSimpleTableContainer>("names");
pCtrl->set_height_request(pCtrl->GetTextHeight()*12);
- m_pRangeManagerTable = new ScRangeManagerTable(*pCtrl, maRangeMap, maCursorPos);
+ m_pRangeManagerTable = VclPtr<ScRangeManagerTable>::Create(*pCtrl, maRangeMap, maCursorPos);
m_pRangeManagerTable->setInitListener(this);
m_pRangeManagerTable->SetSelectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) );
m_pRangeManagerTable->SetDeselectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) );
diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx
index 01e97cc..5f0c238 100644
--- a/sc/source/ui/namedlg/namepast.cxx
+++ b/sc/source/ui/namedlg/namepast.cxx
@@ -50,7 +50,7 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(10 * GetTextHeight());
- mpTable = new ScRangeManagerTable(*pContainer, maRangeMap, aPos);
+ mpTable = VclPtr<ScRangeManagerTable>::Create(*pContainer, maRangeMap, aPos);
m_pBtnPaste->SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl) );
m_pBtnPasteAll->SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl));
commit 8e934e79407fba1b0ba564dbaf295a2102d557a4
Author: Noel Grandin <noel at peralex.com>
Date: Mon Apr 20 14:42:40 2015 +0200
sc: convert new to ::Create
Change-Id: I38bf7fe0dafe2cfd2535055f764293070de9c42c
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 7c1ea4d..687128e 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -483,7 +483,7 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper(
SfxChildWinInfo* /* pInfo */ ) :
SfxChildWindowContext( nId )
{
- pNavigator = new ScNavigatorDlg( pBind, this, pParent, true );
+ pNavigator = VclPtr<ScNavigatorDlg>::Create( pBind, this, pParent, true );
SetWindow( pNavigator );
// handle configurations elsewhere,
@@ -555,14 +555,14 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
Window( pParent, ScResId(RID_SCDLG_NAVIGATOR) ),
rBindings ( *pB ), // is used in CommandToolBox ctor
aCmdImageList( ScResId( IL_CMD ) ),
- aFtCol ( new FixedInfo( this, ScResId( FT_COL ) ) ),
- aEdCol ( new ColumnEdit( this, ScResId( ED_COL ) ) ),
- aFtRow ( new FixedInfo( this, ScResId( FT_ROW ) ) ),
- aEdRow ( new RowEdit( this, ScResId( ED_ROW ) ) ),
- aTbxCmd ( new CommandToolBox( this, ScResId( TBX_CMD ) ) ),
- aLbEntries ( new ScContentTree( this, ScResId( LB_ENTRIES ) ) ),
- aWndScenarios( new ScScenarioWindow( this,ScResId( STR_QHLP_SCEN_LISTBOX), ScResId(STR_QHLP_SCEN_COMMENT)) ),
- aLbDocuments( new ScDocListBox( this, ScResId( LB_DOCUMENTS ) ) ),
+ aFtCol ( VclPtr<FixedInfo>::Create( this, ScResId( FT_COL ) ) ),
+ aEdCol ( VclPtr<ColumnEdit>::Create( this, ScResId( ED_COL ) ) ),
+ aFtRow ( VclPtr<FixedInfo>::Create( this, ScResId( FT_ROW ) ) ),
+ aEdRow ( VclPtr<RowEdit>::Create( this, ScResId( ED_ROW ) ) ),
+ aTbxCmd ( VclPtr<CommandToolBox>::Create( this, ScResId( TBX_CMD ) ) ),
+ aLbEntries ( VclPtr<ScContentTree>::Create( this, ScResId( LB_ENTRIES ) ) ),
+ aWndScenarios( VclPtr<ScScenarioWindow>::Create( this,ScResId( STR_QHLP_SCEN_LISTBOX), ScResId(STR_QHLP_SCEN_COMMENT)) ),
+ aLbDocuments( VclPtr<ScDocListBox>::Create( this, ScResId( LB_DOCUMENTS ) ) ),
aStrDragMode ( ScResId( STR_DRAGMODE ) ),
aStrDisplay ( ScResId( STR_DISPLAY ) ),
aStrActiveWin( ScResId( STR_ACTIVEWIN ) ),
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index 0ff6af4..7791cff 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -197,8 +197,8 @@ void ScScenarioListBox::DeleteScenario( bool bQueryBox )
ScScenarioWindow::ScScenarioWindow( vcl::Window* pParent, const OUString& aQH_List,
const OUString& aQH_Comment)
: Window ( pParent, WB_TABSTOP | WB_DIALOGCONTROL ),
- aLbScenario ( new ScScenarioListBox(*this) ),
- aEdComment ( new MultiLineEdit(this, WB_BORDER | WB_LEFT | WB_READONLY | WB_VSCROLL | WB_TABSTOP) )
+ aLbScenario ( VclPtr<ScScenarioListBox>::Create(*this) ),
+ aEdComment ( VclPtr<MultiLineEdit>::Create(this, WB_BORDER | WB_LEFT | WB_READONLY | WB_VSCROLL | WB_TABSTOP) )
{
vcl::Font aFont( GetFont() );
aFont.SetTransparent( true );
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index c9d7d4af..d1da58a 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -238,10 +238,8 @@ VclPtr<vcl::Window> AlignmentPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to AlignmentPropertyPanel::Create", NULL, 2);
- return VclPtr<vcl::Window>(
- new AlignmentPropertyPanel(
- pParent, rxFrame, pBindings),
- SAL_NO_ACQUIRE);
+ return VclPtr<AlignmentPropertyPanel>::Create(
+ pParent, rxFrame, pBindings);
}
void AlignmentPropertyPanel::DataChanged(
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
index 207b110..dab38a7 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
@@ -58,6 +58,11 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ AlignmentPropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
virtual ~AlignmentPropertyPanel();
virtual void dispose() SAL_OVERRIDE;
@@ -93,12 +98,6 @@ private:
DECL_LINK( RotationHdl, void * );
DECL_LINK( ClickStackHdl, void * );
- // constructor/destuctor
- AlignmentPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
-
void Initialize();
void FormatDegrees(double& dTmp);
};
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index 5dae73b..b310838 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -255,10 +255,8 @@ VclPtr<vcl::Window> CellAppearancePropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to CellAppearancePropertyPanel::Create", NULL, 2);
- return VclPtr<vcl::Window>(
- new CellAppearancePropertyPanel(
- pParent, rxFrame, pBindings),
- SAL_NO_ACQUIRE);
+ return VclPtr<CellAppearancePropertyPanel>::Create(
+ pParent, rxFrame, pBindings);
}
void CellAppearancePropertyPanel::DataChanged(
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index 8bdf1b4..816db4d 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -69,6 +69,11 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ CellAppearancePropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
virtual ~CellAppearancePropertyPanel();
virtual void dispose() SAL_OVERRIDE;
@@ -148,12 +153,6 @@ private:
svx::sidebar::PopupControl* CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent);
void EndCellBorderStylePopupMode(void);
- // constructor/destuctor
- CellAppearancePropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
-
void Initialize();
void SetStyleIcon();
void UpdateControlState();
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index 9b98109..4f8a467 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -45,11 +45,11 @@ namespace sc { namespace sidebar {
CellBorderStyleControl::CellBorderStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel)
: svx::sidebar::PopupControl(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE)),
mrCellAppearancePropertyPanel(rPanel),
- maTBBorder1(new ToolBox(this, ScResId(TB_BORDER1))),
- maTBBorder2(new ToolBox(this, ScResId(TB_BORDER2))),
- maTBBorder3(new ToolBox(this, ScResId(TB_BORDER3))),
- maFL1(new FixedLine(this, ScResId(FL_1))),
- maFL2(new FixedLine(this, ScResId(FL_2))),
+ maTBBorder1(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER1))),
+ maTBBorder2(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER2))),
+ maTBBorder3(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER3))),
+ maFL1(VclPtr<FixedLine>::Create(this, ScResId(FL_1))),
+ maFL2(VclPtr<FixedLine>::Create(this, ScResId(FL_2))),
mpImageList(0)
{
Initialize();
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index 8186162..0528df7 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -36,8 +36,8 @@ namespace sc { namespace sidebar {
CellLineStyleControl::CellLineStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel)
: svx::sidebar::PopupControl(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE)),
mrCellAppearancePropertyPanel(rPanel),
- maPushButtonMoreOptions(new PushButton(this, ScResId(PB_OPTIONS))),
- maCellLineStyleValueSet(new sc::sidebar::CellLineStyleValueSet(this, ScResId(VS_STYLE))),
+ maPushButtonMoreOptions(VclPtr<PushButton>::Create(this, ScResId(PB_OPTIONS))),
+ maCellLineStyleValueSet(VclPtr<sc::sidebar::CellLineStyleValueSet>::Create(this, ScResId(VS_STYLE))),
mbVSfocus(true)
{
Initialize();
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index 035b65b..3d59a6d 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -194,10 +194,8 @@ VclPtr<vcl::Window> NumberFormatPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to NumberFormatPropertyPanel::Create", NULL, 2);
- return VclPtr<vcl::Window>(
- new NumberFormatPropertyPanel(
- pParent, rxFrame, pBindings),
- SAL_NO_ACQUIRE);
+ return VclPtr<NumberFormatPropertyPanel>::Create(
+ pParent, rxFrame, pBindings);
}
void NumberFormatPropertyPanel::DataChanged(
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
index ded7589..9a162be 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
@@ -56,6 +56,11 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ NumberFormatPropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
virtual ~NumberFormatPropertyPanel();
virtual void dispose() SAL_OVERRIDE;
private:
@@ -80,12 +85,6 @@ private:
DECL_LINK(NumFormatSelectHdl, ListBox*);
DECL_LINK(NumFormatValueHdl, void*);
- // constructor/destuctor
- NumberFormatPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
-
void Initialize();
};
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 0f26245..c28bb40 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1950,7 +1950,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
// found a matching range, edit this conditional format
nKey = pCondFormat->GetKey();
- pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) );
+ pCondFormatDlg.reset( VclPtr<ScCondFormatDlg>::Create( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) );
break;
}
}
@@ -1975,7 +1975,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
assert(pCondFormat);
const ScRangeList& rCondFormatRange = pCondFormat->GetRange();
nKey = pCondFormat->GetKey();
- pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) );
+ pCondFormatDlg.reset( VclPtr<ScCondFormatDlg>::Create( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) );
}
else
{
@@ -2023,7 +2023,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
assert(false);
break;
}
- pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), eType ) );
+ pCondFormatDlg.reset( VclPtr<ScCondFormatDlg>::Create( pTabViewShell->GetDialogParent(), pDoc, nullptr, aRangeList, aRangeList.GetTopLeftCorner(), eType ) );
}
sal_uInt16 nId = 1;
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index a1ab73b..159172b 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -703,7 +703,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
SCTAB nTab = pViewData->GetTabNo();
ScDocument* pDoc = pViewData->GetDocument();
- mpAutoFilterPopup.reset(new ScCheckListMenuWindow(this, pDoc));
+ mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc));
mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, Normal));
mpAutoFilterPopup->setPopupEndAction(
new AutoFilterPopupEndAction(this, ScAddress(nCol, nRow, nTab)));
@@ -994,9 +994,9 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
// Die ListBox direkt unter der schwarzen Linie auf dem Zellgitter
// (wenn die Linie verdeckt wird, sieht es komisch aus...)
- mpFilterFloat.reset(new ScFilterFloatingWindow(this, WinBits(WB_BORDER)));
+ mpFilterFloat.reset(VclPtr<ScFilterFloatingWindow>::Create(this, WinBits(WB_BORDER)));
mpFilterFloat->SetPopupModeEndHdl( LINK( this, ScGridWindow, PopupModeEndHdl ) );
- mpFilterBox.reset(new ScFilterListBox(mpFilterFloat.get(), this, nCol, nRow, SC_FILTERBOX_SCENARIO));
+ mpFilterBox.reset(VclPtr<ScFilterListBox>::Create(mpFilterFloat.get(), this, nCol, nRow, SC_FILTERBOX_SCENARIO));
if (bLayoutRTL)
mpFilterBox->EnableMirroring();
@@ -1120,10 +1120,10 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
aPos.X() -= 1;
aPos.Y() += nSizeY - 1;
- mpFilterFloat.reset(new ScFilterFloatingWindow(this, WinBits(WB_BORDER)));
+ mpFilterFloat.reset(VclPtr<ScFilterFloatingWindow>::Create(this, WinBits(WB_BORDER)));
mpFilterFloat->SetPopupModeEndHdl(LINK( this, ScGridWindow, PopupModeEndHdl));
ScFilterBoxMode eFilterMode = bDataSelect ? SC_FILTERBOX_DATASELECT : SC_FILTERBOX_FILTER;
- mpFilterBox.reset(new ScFilterListBox(mpFilterFloat.get(), this, nCol, nRow, eFilterMode));
+ mpFilterBox.reset(VclPtr<ScFilterListBox>::Create(mpFilterFloat.get(), this, nCol, nRow, eFilterMode));
// Fix for bug fdo#44925
if (AllSettings::GetLayoutRTL() != bLayoutRTL)
mpFilterBox->EnableMirroring();
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 3200a0e..0419490 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -455,7 +455,7 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
const ScDPLabelData& rLabelData = pDPData->maLabels;
- mpDPFieldPopup.reset(new ScCheckListMenuWindow(this, pViewData->GetDocument()));
+ mpDPFieldPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pViewData->GetDocument()));
mpDPFieldPopup->setName("DataPilot field member popup");
mpDPFieldPopup->setExtendedData(pDPData.release());
mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this));
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 5dc88fc..aa55c61 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -119,10 +119,10 @@ void ScPreviewShell::Construct( vcl::Window* pParent )
eZoom = SvxZoomType::WHOLEPAGE;
- pCorner = new ScrollBarBox( pParent, WB_SIZEABLE );
+ pCorner = VclPtr<ScrollBarBox>::Create( pParent, WB_SIZEABLE );
- pHorScroll = new ScrollBar(pParent, WB_HSCROLL );
- pVerScroll = new ScrollBar(pParent, WB_VSCROLL);
+ pHorScroll = VclPtr<ScrollBar>::Create(pParent, WB_HSCROLL );
+ pVerScroll = VclPtr<ScrollBar>::Create(pParent, WB_VSCROLL);
// SSA: --- RTL --- no mirroring for horizontal scrollbars
pHorScroll->EnableRTL( false );
@@ -130,7 +130,7 @@ void ScPreviewShell::Construct( vcl::Window* pParent )
pHorScroll->SetEndScrollHdl( LINK( this, ScPreviewShell, ScrollHandler ) );
pVerScroll->SetEndScrollHdl( LINK( this, ScPreviewShell, ScrollHandler ) );
- pPreview = new ScPreview( pParent, pDocShell, this );
+ pPreview = VclPtr<ScPreview>::Create( pParent, pDocShell, this );
SetPool( &SC_MOD()->GetPool() );
SetWindow( pPreview );
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index c378987..3b0e962 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -237,9 +237,10 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper( vcl::Window* pParentP,
ScTabViewShell* pViewShell =
PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
OSL_ENSURE( pViewShell, "missing view shell :-(" );
- pWindow = pViewShell ?
- new ScAcceptChgDlg( pBindings, this, pParentP, &pViewShell->GetViewData() ) :
- NULL;
+ if (pViewShell)
+ pWindow = VclPtr<ScAcceptChgDlg>::Create( pBindings, this, pParentP, &pViewShell->GetViewData() );
+ else
+ pWindow = NULL;
if(pWindow!=nullptr)
{
static_cast<ScAcceptChgDlg*>(pWindow.get())->Initialize( pInfo );
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 00c586c..57b71dd 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -199,13 +199,13 @@ ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell*
pHdrSelEng( NULL ),
aHdrFunc( &aViewData ),
pDrawView( NULL ),
- aVScrollTop( new ScrollBar( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ),
- aVScrollBottom( new ScrollBar( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ),
- aHScrollLeft( new ScrollBar( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ),
- aHScrollRight( new ScrollBar( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ),
- aCornerButton( new ScCornerButton( pFrameWin, &aViewData, false ) ),
- aTopButton( new ScCornerButton( pFrameWin, &aViewData, true ) ),
- aScrollBarBox( new ScrollBarBox( pFrameWin, WB_SIZEABLE ) ),
+ aVScrollTop( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ),
+ aVScrollBottom( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ),
+ aHScrollLeft( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ),
+ aHScrollRight( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ),
+ aCornerButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, false ) ),
+ aTopButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, true ) ),
+ aScrollBarBox( VclPtr<ScrollBarBox>::Create( pFrameWin, WB_SIZEABLE ) ),
mpInputHintWindow( NULL ),
pPageBreakData( NULL ),
pBrushDocument( NULL ),
@@ -1466,35 +1466,35 @@ void ScTabView::UpdateShow()
if (bShowH && !pGridWin[SC_SPLIT_BOTTOMRIGHT])
{
- pGridWin[SC_SPLIT_BOTTOMRIGHT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_BOTTOMRIGHT );
+ pGridWin[SC_SPLIT_BOTTOMRIGHT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOMRIGHT );
DoAddWin( pGridWin[SC_SPLIT_BOTTOMRIGHT] );
}
if (bShowV && !pGridWin[SC_SPLIT_TOPLEFT])
{
- pGridWin[SC_SPLIT_TOPLEFT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_TOPLEFT );
+ pGridWin[SC_SPLIT_TOPLEFT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_TOPLEFT );
DoAddWin( pGridWin[SC_SPLIT_TOPLEFT] );
}
if (bShowH && bShowV && !pGridWin[SC_SPLIT_TOPRIGHT])
{
- pGridWin[SC_SPLIT_TOPRIGHT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_TOPRIGHT );
+ pGridWin[SC_SPLIT_TOPRIGHT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_TOPRIGHT );
DoAddWin( pGridWin[SC_SPLIT_TOPRIGHT] );
}
if (bHOutline && !pColOutline[SC_SPLIT_LEFT])
- pColOutline[SC_SPLIT_LEFT] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMLEFT );
+ pColOutline[SC_SPLIT_LEFT] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMLEFT );
if (bShowH && bHOutline && !pColOutline[SC_SPLIT_RIGHT])
- pColOutline[SC_SPLIT_RIGHT] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMRIGHT );
+ pColOutline[SC_SPLIT_RIGHT] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMRIGHT );
if (bVOutline && !pRowOutline[SC_SPLIT_BOTTOM])
- pRowOutline[SC_SPLIT_BOTTOM] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_BOTTOMLEFT );
+ pRowOutline[SC_SPLIT_BOTTOM] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_BOTTOMLEFT );
if (bShowV && bVOutline && !pRowOutline[SC_SPLIT_TOP])
- pRowOutline[SC_SPLIT_TOP] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_TOPLEFT );
+ pRowOutline[SC_SPLIT_TOP] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_TOPLEFT );
if (bShowH && bHeader && !pColBar[SC_SPLIT_RIGHT])
- pColBar[SC_SPLIT_RIGHT] = new ScColBar( pFrameWin, &aViewData, SC_SPLIT_RIGHT,
+ pColBar[SC_SPLIT_RIGHT] = VclPtr<ScColBar>::Create( pFrameWin, &aViewData, SC_SPLIT_RIGHT,
&aHdrFunc, pHdrSelEng );
if (bShowV && bHeader && !pRowBar[SC_SPLIT_TOP])
- pRowBar[SC_SPLIT_TOP] = new ScRowBar( pFrameWin, &aViewData, SC_SPLIT_TOP,
+ pRowBar[SC_SPLIT_TOP] = VclPtr<ScRowBar>::Create( pFrameWin, &aViewData, SC_SPLIT_TOP,
&aHdrFunc, pHdrSelEng );
// Windows anzeigen
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 1ee8f4e..1e5d2da 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -623,7 +623,7 @@ void ScTabView::TestHintWindow()
aPos.X() < aWinSize.Width() && aPos.Y() < aWinSize.Height() )
{
// HintWindow anlegen, bestimmt seine Groesse selbst
- mpInputHintWindow.reset(new ScHintWindow(pWin, aTitle, aMessage));
+ mpInputHintWindow.reset(VclPtr<ScHintWindow>::Create(pWin, aTitle, aMessage));
Size aHintWndSize = mpInputHintWindow->GetSizePixel();
long nCellSizeX = 0;
long nCellSizeY = 0;
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index a01d9c4..6bb12f6 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -74,7 +74,7 @@ void ScTabView::Init()
for (i=0; i<4; i++)
pGridWin[i] = NULL;
- pGridWin[SC_SPLIT_BOTTOMLEFT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_BOTTOMLEFT );
+ pGridWin[SC_SPLIT_BOTTOMLEFT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOMLEFT );
pSelEngine = new ScViewSelectionEngine( pGridWin[SC_SPLIT_BOTTOMLEFT], this,
SC_SPLIT_BOTTOMLEFT );
@@ -82,23 +82,23 @@ void ScTabView::Init()
pHdrSelEng = new ScHeaderSelectionEngine( pFrameWin, &aHdrFunc );
- pColBar[SC_SPLIT_LEFT] = new ScColBar( pFrameWin, &aViewData, SC_SPLIT_LEFT,
+ pColBar[SC_SPLIT_LEFT] = VclPtr<ScColBar>::Create( pFrameWin, &aViewData, SC_SPLIT_LEFT,
&aHdrFunc, pHdrSelEng );
pColBar[SC_SPLIT_RIGHT] = NULL;
- pRowBar[SC_SPLIT_BOTTOM] = new ScRowBar( pFrameWin, &aViewData, SC_SPLIT_BOTTOM,
+ pRowBar[SC_SPLIT_BOTTOM] = VclPtr<ScRowBar>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOM,
&aHdrFunc, pHdrSelEng );
pRowBar[SC_SPLIT_TOP] = NULL;
for (i=0; i<2; i++)
pColOutline[i] = pRowOutline[i] = NULL;
- pHSplitter = new ScTabSplitter( pFrameWin, WinBits( WB_HSCROLL ), &aViewData );
- pVSplitter = new ScTabSplitter( pFrameWin, WinBits( WB_VSCROLL ), &aViewData );
+ pHSplitter = VclPtr<ScTabSplitter>::Create( pFrameWin, WinBits( WB_HSCROLL ), &aViewData );
+ pVSplitter = VclPtr<ScTabSplitter>::Create( pFrameWin, WinBits( WB_VSCROLL ), &aViewData );
// SSA: override default keyboard step size to allow snap to row/column
pHSplitter->SetKeyboardStepSize( 1 );
pVSplitter->SetKeyboardStepSize( 1 );
- pTabControl = new ScTabControl(pFrameWin, &aViewData);
+ pTabControl = VclPtr<ScTabControl>::Create(pFrameWin, &aViewData);
if (mbInlineWithScrollbar)
pTabControl->SetStyle(pTabControl->GetStyle() | WB_SIZEABLE);
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index bc5cff7..9b1feb0 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -145,14 +145,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
if (!mbInSwitch)
{
- pResult = new ScNameDlg( pB, pCW, pParent, &GetViewData(),
+ pResult = VclPtr<ScNameDlg>::Create( pB, pCW, pParent, &GetViewData(),
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ) );
}
else
{
- pResult = new ScNameDlg( pB, pCW, pParent, &GetViewData(),
+ pResult = VclPtr<ScNameDlg>::Create( pB, pCW, pParent, &GetViewData(),
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ), &maRangeMap);
@@ -168,7 +168,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
std::map<OUString, ScRangeName*> aRangeMap;
pDoc->GetRangeNameMap(aRangeMap);
- pResult = new ScNameDefDlg( pB, pCW, pParent, &GetViewData(), aRangeMap,
+ pResult = VclPtr<ScNameDefDlg>::Create( pB, pCW, pParent, &GetViewData(), aRangeMap,
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ), true );
@@ -181,7 +181,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
aRangeMap.insert(std::pair<OUString, ScRangeName*>(itr->first, itr->second));
}
- pResult = new ScNameDefDlg( pB, pCW, pParent, &GetViewData(), aRangeMap,
+ pResult = VclPtr<ScNameDefDlg>::Create( pB, pCW, pParent, &GetViewData(), aRangeMap,
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ), false );
@@ -191,7 +191,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
case SID_DEFINE_COLROWNAMERANGES:
{
- pResult = new ScColRowNameRangesDlg( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScColRowNameRangesDlg>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -229,7 +229,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
aArgSet.Put( ScConsolidateItem( SCITEM_CONSOLIDATEDATA, pDlgData ) );
}
- pResult = new ScConsolidateDlg( pB, pCW, pParent, aArgSet );
+ pResult = VclPtr<ScConsolidateDlg>::Create( pB, pCW, pParent, aArgSet );
}
break;
@@ -241,7 +241,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
MarkDataArea( false );
- pResult = new ScDbNameDlg( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScDbNameDlg>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -270,7 +270,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
// aktuelle Tabelle merken (wg. RefInput im Dialog)
GetViewData().SetRefTabNo( GetViewData().GetTabNo() );
- pResult = new ScSpecialFilterDlg( pB, pCW, pParent, aArgSet );
+ pResult = VclPtr<ScSpecialFilterDlg>::Create( pB, pCW, pParent, aArgSet );
}
break;
@@ -297,7 +297,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
// aktuelle Tabelle merken (wg. RefInput im Dialog)
GetViewData().SetRefTabNo( GetViewData().GetTabNo() );
- pResult = new ScFilterDlg( pB, pCW, pParent, aArgSet );
+ pResult = VclPtr<ScFilterDlg>::Create( pB, pCW, pParent, aArgSet );
}
break;
@@ -309,7 +309,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
rViewData.GetTabNo(),
false, false, false );
- pResult = new ScTabOpDlg( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
+ pResult = VclPtr<ScTabOpDlg>::Create( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
}
break;
@@ -319,79 +319,79 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
ScAddress aCurPos( rViewData.GetCurX(),
rViewData.GetCurY(),
rViewData.GetTabNo());
- pResult = new ScSolverDlg( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
+ pResult = VclPtr<ScSolverDlg>::Create( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
}
break;
case SID_RANDOM_NUMBER_GENERATOR_DIALOG:
{
- pResult = new ScRandomNumberGeneratorDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScRandomNumberGeneratorDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_SAMPLING_DIALOG:
{
- pResult = new ScSamplingDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScSamplingDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_DESCRIPTIVE_STATISTICS_DIALOG:
{
- pResult = new ScDescriptiveStatisticsDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScDescriptiveStatisticsDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_ANALYSIS_OF_VARIANCE_DIALOG:
{
- pResult = new ScAnalysisOfVarianceDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScAnalysisOfVarianceDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_CORRELATION_DIALOG:
{
- pResult = new ScCorrelationDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScCorrelationDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_COVARIANCE_DIALOG:
{
- pResult = new ScCovarianceDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScCovarianceDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_EXPONENTIAL_SMOOTHING_DIALOG:
{
- pResult = new ScExponentialSmoothingDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScExponentialSmoothingDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_MOVING_AVERAGE_DIALOG:
{
- pResult = new ScMovingAverageDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScMovingAverageDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_TTEST_DIALOG:
{
- pResult = new ScTTestDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScTTestDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_FTEST_DIALOG:
{
- pResult = new ScFTestDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScFTestDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_ZTEST_DIALOG:
{
- pResult = new ScZTestDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScZTestDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_CHI_SQUARE_TEST_DIALOG:
{
- pResult = new ScChiSquareTestDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScChiSquareTestDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -399,7 +399,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
ScViewData& rViewData = GetViewData();
ScAddress aCurPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo());
- pResult = new ScOptSolverDlg( pB, pCW, pParent, rViewData.GetDocShell(), aCurPos );
+ pResult = VclPtr<ScOptSolverDlg>::Create( pB, pCW, pParent, rViewData.GetDocShell(), aCurPos );
}
break;
@@ -413,14 +413,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
ScViewData& rViewData = GetViewData();
rViewData.SetRefTabNo( rViewData.GetTabNo() );
ScDPObject* pObj = pDoc->GetDPAtCursor(rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo());
- pResult = new ScPivotLayoutDialog(pB, pCW, pParent, &rViewData, pDialogDPObject, pObj == NULL);
+ pResult = VclPtr<ScPivotLayoutDialog>::Create(pB, pCW, pParent, &rViewData, pDialogDPObject, pObj == nullptr);
}
}
break;
case SID_OPENDLG_EDIT_PRINTAREA:
{
- pResult = new ScPrintAreasDlg( pB, pCW, pParent );
+ pResult = VclPtr<ScPrintAreasDlg>::Create( pB, pCW, pParent );
}
break;
@@ -428,14 +428,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
// Dialog schaut selber, was in der Zelle steht
- pResult = new ScFormulaDlg( pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr() );
+ pResult = VclPtr<ScFormulaDlg>::Create( pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr() );
}
break;
case SID_MANAGE_XML_SOURCE:
{
#if ENABLE_ORCUS
- pResult = new ScXMLSourceDlg(pB, pCW, pParent, pDoc);
+ pResult = VclPtr<ScXMLSourceDlg>::Create(pB, pCW, pParent, pDoc);
#endif
}
break;
@@ -444,7 +444,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
// Dialog schaut selber, was in der Zelle steht
- pResult = new ScHighlightChgDlg( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScHighlightChgDlg>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -454,7 +454,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list