diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-20 15:50:17 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-20 15:50:17 +0200 |
commit | b8bc9023a3190cd93150fb14c2e37ad4deb8b435 (patch) | |
tree | 9803ef0da4356b5768e028bf6dfc4233327c16e9 /sc/source | |
parent | 8e934e79407fba1b0ba564dbaf295a2102d557a4 (diff) |
sc: convert new to ::Create
Change-Id: I196ef015660a2d87a33957ed3442341001f4a303
Diffstat (limited to 'sc/source')
21 files changed, 179 insertions, 179 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 50cc31d177a5..4867827fac2f 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 0c4c04278806..d5942e6b752c 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 a8ca5903bb2c..0e142fdfdb31 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 113c0e77e4a2..3fa8a6a8d6ab 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 1076f7b14930..59d343195294 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 07e3548395b6..ac0bd5201492 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 98846c9d336c..d36dd1e04c2a 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 76e03951b467..c0adb89e590d 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 37fc651d9743..9dab72200314 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 7dd4ce661bbb..2d91c929f12c 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 457411d7c5ab..6fd373366eac 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 a6766cb24165..1a692d54dc80 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 f420316503de..ac1b5a4bb012 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 03e269b856c0..975cf1a695ce 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 2029fcd41900..5b1d6c8f2d6f 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 4c5fc95c232a..8141ca08aa03 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 013b89e5b661..9b4f998f56fe 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 68f1d7ff58cd..60be4c415bcf 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 ac80d100bd03..958b48596f9a 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 f5a105302363..090738cbe436 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 01e97cc8278f..5f0c238327ef 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)); |