diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-31 23:04:14 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 13:40:25 +0100 |
commit | 8a65284fe31e6c0a927cb88b75df7845cd248572 (patch) | |
tree | 0427685579288f412d1890619e8bc224339bb228 /sc/source/ui | |
parent | d46e0d9656670dcd7dcca2f32062606400ff6246 (diff) |
Automated conversion of VclPtr construction to use Instance template.
Change-Id: I8be9141b9653e73ebd23a5a3d810f240c376f97e
Diffstat (limited to 'sc/source/ui')
34 files changed, 53 insertions, 53 deletions
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 5990bb1b7d42..b31ce187f479 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -337,7 +337,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt Rectangle aMMRect = pDoc->GetMMRect( aBlock.aStart.Col(), aBlock.aStart.Row(), aBlock.aEnd.Col(), aBlock.aEnd.Row(), aBlock.aStart.Tab() ); - ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev; pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) ); PaintToDev( pVirtDev, pDoc, 1.0, aBlock, false ); @@ -358,7 +358,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt // like SvEmbeddedTransfer::GetData: GDIMetaFile aMtf; - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; MapMode aMapMode( pEmbObj->GetMapUnit() ); Rectangle aVisArea( pEmbObj->GetVisArea( ASPECT_CONTENT ) ); diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index 9a6282a1af82..618a5af268a9 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -401,7 +401,7 @@ void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ ) Size aSliderWindowSize = GetOutputSizePixel(); Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *this ) ); + ScopedVclPtrInstance< VirtualDevice > pVDev( *this ); pVDev->SetOutputSizePixel( aSliderWindowSize ); Rectangle aSlider = aRect; diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index cfcae9e2d015..5c08ecb1fc96 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -287,7 +287,7 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl ) if(bWarn) { //show warning message and don't close - ScopedVclPtr<WarningBox> aWarn(new WarningBox(this, WB_OK, maStrWarnSameValue )); + ScopedVclPtrInstance< WarningBox > aWarn(this, WB_OK, maStrWarnSameValue ); aWarn->Execute(); } else diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index e58d36f449b0..7df39d8335b2 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -519,7 +519,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl) aBuf.append(aStrDelMsg.getToken(0, '#')); aBuf.append(aStrEntry); aBuf.append(aStrDelMsg.getToken(1, '#')); - ScopedVclPtr<QueryBox> aBox(new QueryBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear())); + ScopedVclPtrInstance< QueryBox > aBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear()); if (RET_YES == aBox->Execute()) { diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index a73629c3ba65..4cc9de6ed1b0 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -539,7 +539,7 @@ IMPL_LINK( ScDPSubtotalDlg, ClickHdl, PushButton*, pBtn ) { if (pBtn == mpBtnOptions) { - VclPtr<ScDPSubtotalOptDlg> pDlg(new ScDPSubtotalOptDlg( this, mrDPObj, maLabelData, mrDataFields, mbEnableLayout )); + VclPtrInstance< ScDPSubtotalOptDlg > pDlg( this, mrDPObj, maLabelData, mrDataFields, mbEnableLayout ); if( pDlg->Execute() == RET_OK ) pDlg->FillLabelData( maLabelData ); } diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index a236448b5cbc..df197e37db44 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -635,7 +635,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, nErrStringId = STR_MSSG_IMPORTDATA_0; aErrorMessage = ScGlobal::GetRscString( nErrStringId ); } - ScopedVclPtr<InfoBox> aInfoBox(new InfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage ) ); + ScopedVclPtrInstance< InfoBox > aInfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage ); aInfoBox->Execute(); } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 22c7986b6114..305ab149d229 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -3756,7 +3756,7 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) { if (!bApi) { - ScopedVclPtr<InfoBox> aBox(new InfoBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) ); + ScopedVclPtrInstance< InfoBox > aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ); aBox->Execute(); } return false; @@ -3786,7 +3786,7 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) { if (!bApi) { - ScopedVclPtr<InfoBox> aBox(new InfoBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) ); + ScopedVclPtrInstance< InfoBox > aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ); aBox->Execute(); } return false; diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index b8fd016fb433..191a284b0e16 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -821,7 +821,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) ); aMessage = aMessage.replaceFirst( "%1", aUserName ); - ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage ) ); + ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage ); if ( aBox->Execute() == RET_RETRY ) { bRetry = true; @@ -1457,7 +1457,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) Fraction aZoom( 1, 1 ); double nPPTX = ScGlobal::nScreenPPTX * (double) aZoom / GetOutputFactor(); // Factor is printer display ratio double nPPTY = ScGlobal::nScreenPPTY * (double) aZoom; - ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev; // all sheets (for Excel import) SCTAB nTabCount = aDocument.GetTableCount(); for (SCTAB nTab=0; nTab<nTabCount; nTab++) diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 66269ec2ebbb..b97bf8675e89 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -368,7 +368,7 @@ void ScDocShell::CalcOutputFactor() pRefDev->SetFont(aOldFont); pRefDev->SetMapMode(aOldMode); - ScopedVclPtr<VirtualDevice> pVirtWindow( new VirtualDevice( *Application::GetDefaultDevice() ) ); + ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *Application::GetDefaultDevice() ); pVirtWindow->SetMapMode(MAP_PIXEL); pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // font color doesn't matter here pVirtWindow->SetFont(aDefFont); @@ -1202,7 +1202,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) while ( bLoop ) { bLoop = false; - ScopedVclPtr<ScConflictsDlg> aDlg(new ScConflictsDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList ) ); + ScopedVclPtrInstance< ScConflictsDlg > aDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList ); if ( aDlg->Execute() == RET_CANCEL ) { ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), @@ -1320,7 +1320,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) PostPaintExtras(); PostPaintGridAll(); - ScopedVclPtr<InfoBox> aInfoBox(new InfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) ) ); + ScopedVclPtrInstance< InfoBox > aInfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) ); aInfoBox->Execute(); } diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 9fd3dee3ef76..714919b71c97 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -222,7 +222,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) aMessage += sTarget; aMessage += aTemplate.getToken( 1, '#' ); - ScopedVclPtr<QueryBox> aBox(new QueryBox( 0, WinBits(WB_YES_NO | WB_DEF_YES), aMessage )); + ScopedVclPtrInstance< QueryBox > aBox( nullptr, WinBits(WB_YES_NO | WB_DEF_YES), aMessage ); bDo = ( aBox->Execute() == RET_YES ); } @@ -913,7 +913,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) break; } - ScopedVclPtr<ScShareDocumentDlg> aDlg(new ScShareDocumentDlg( GetActiveDialogParent(), pViewData ) ); + ScopedVclPtrInstance< ScShareDocumentDlg > aDlg( GetActiveDialogParent(), pViewData ); if ( aDlg->Execute() == RET_OK ) { bool bSetShared = aDlg->IsShareDocumentChecked(); @@ -1016,7 +1016,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) ); aMessage = aMessage.replaceFirst( "%1", aUserName ); - ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage ) ); + ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage ); aBox->Execute(); } else diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index db1b60b32f82..f95815389e66 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -81,7 +81,7 @@ void ScDocShell::ErrorMessage( sal_uInt16 nGlobStrId ) } } - ScopedVclPtr<InfoBox> aBox(new InfoBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ) ); + ScopedVclPtrInstance< InfoBox > aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ); aBox->Execute(); if (bFocus) pParent->GrabFocus(); diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 039f1dc9d289..4cd55805c1e0 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -531,7 +531,7 @@ void ScDocShell::CheckConfigOptions() if (pViewShell) { vcl::Window* pParent = pViewShell->GetFrameWin(); - ScopedVclPtr<InfoBox> aBox(new InfoBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS))); + ScopedVclPtrInstance< InfoBox > aBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS)); aBox->Execute(); } diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx index 3fb31fc3bbc4..42745eb3f344 100644 --- a/sc/source/ui/docshell/documentlinkmgr.cxx +++ b/sc/source/ui/docshell/documentlinkmgr.cxx @@ -165,7 +165,7 @@ bool DocumentLinkManager::updateDdeLinks( vcl::Window* pWin ) aBuf.append(aElem); aBuf.appendAscii("\nType : "); aBuf.append(aType); - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pWin, aBuf.makeStringAndClear())); + ScopedVclPtrInstance< MessageDialog > aBox(pWin, aBuf.makeStringAndClear()); aBox->Execute(); } } diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index b68471cb76b1..e11b6be89f79 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1452,7 +1452,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) if ( !mbApi && nStartCol != nEndCol && !pDoc->IsBlockEmpty( nTab, nStartCol + 1, nStartRow, nEndCol, nRow ) ) { - ScopedVclPtr<ScReplaceWarnBox> aBox(new ScReplaceWarnBox( pDocSh->GetActiveDialogParent() )); + ScopedVclPtrInstance< ScReplaceWarnBox > aBox( pDocSh->GetActiveDialogParent() ); if ( aBox->Execute() != RET_YES ) { return false; diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 160f083e562d..43b8f0616b54 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -271,7 +271,7 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh, // really store as link only? if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() ) { - ScopedVclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(pWin,aFileName)); + ScopedVclPtrInstance< SvxLinkWarningDialog > aWarnDlg(pWin,aFileName); if( aWarnDlg->Execute() != RET_OK ) bAsLink = false; // don't store as link } diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index cfe48e0a0047..f8c2be9ca17b 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -200,7 +200,7 @@ void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& ) if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj); - ScopedVclPtr<CompressGraphicsDialog> dialog(new CompressGraphicsDialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() ) ); + ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() ); if ( dialog->Execute() == RET_OK ) { SdrGrafObj* pNewObject = dialog->GetCompressedSdrGrafObj(); diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index f31138d32643..013b89e5b661 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -861,7 +861,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal { // show progress dialog - ScopedVclPtr<ScSolverProgressDialog> aProgress(new ScSolverProgressDialog( this ) ); + ScopedVclPtrInstance< ScSolverProgressDialog > aProgress( this ); sal_Int32 nTimeout = 0; if ( FindTimeout( nTimeout ) ) aProgress->SetTimeLimit( nTimeout ); @@ -1086,7 +1086,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal static_cast<SCCOL>(aObjective.Column), static_cast<SCROW>(aObjective.Row), static_cast<SCTAB>(aObjective.Sheet)); - ScopedVclPtr<ScSolverSuccessDialog> aDialog(new ScSolverSuccessDialog( this, aResultStr ) ); + ScopedVclPtrInstance< ScSolverSuccessDialog > aDialog( this, aResultStr ); if ( aDialog->Execute() == RET_OK ) { // keep results and close dialog @@ -1100,7 +1100,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal uno::Reference<sheet::XSolverDescription> xDesc( xSolver, uno::UNO_QUERY ); if ( xDesc.is() ) aError = xDesc->getStatusDescription(); // error description from component - ScopedVclPtr<ScSolverNoSolutionDialog> aDialog(new ScSolverNoSolutionDialog( this, aError ) ); + ScopedVclPtrInstance< ScSolverNoSolutionDialog > aDialog( this, aError ); aDialog->Execute(); } diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx index 5865738948fd..68f1d7ff58cd 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.cxx +++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx @@ -293,7 +293,7 @@ IMPL_LINK( ScRetypePassDlg, RetypeBtnHdl, PushButton*, pBtn ) // What the ... !? return 0; - ScopedVclPtr<ScRetypePassInputDlg> aDlg(new ScRetypePassInputDlg(this, pProtected)); + ScopedVclPtrInstance< ScRetypePassInputDlg > aDlg(this, pProtected); if (aDlg->Execute() == RET_OK) { // OK is pressed. Update the protected item. diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 7b29f03666d5..447c6a0bd887 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -317,7 +317,7 @@ void ScSolverOptionsDialog::EditOption() { if ( pStringItem->IsDouble() ) { - ScopedVclPtr<ScSolverValueDialog> aValDialog(new ScSolverValueDialog( this )); + ScopedVclPtrInstance< ScSolverValueDialog > aValDialog( this ); aValDialog->SetOptionName( pStringItem->GetText() ); aValDialog->SetValue( pStringItem->GetDoubleValue() ); if ( aValDialog->Execute() == RET_OK ) @@ -328,7 +328,7 @@ void ScSolverOptionsDialog::EditOption() } else { - ScopedVclPtr<ScSolverIntegerDialog> aIntDialog(new ScSolverIntegerDialog( this )); + ScopedVclPtrInstance< ScSolverIntegerDialog > aIntDialog( this ); aIntDialog->SetOptionName( pStringItem->GetText() ); aIntDialog->SetValue( pStringItem->GetIntValue() ); if ( aIntDialog->Execute() == RET_OK ) diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 5ae0899ccd63..d3717aa8cd6a 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -139,7 +139,7 @@ void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault) void ScTpFormulaOptions::LaunchCustomCalcSettings() { - ScopedVclPtr<ScCalcOptionsDialog> aDlg(new ScCalcOptionsDialog(this, maCurrentConfig)); + ScopedVclPtrInstance< ScCalcOptionsDialog > aDlg(this, maCurrentConfig); if (aDlg->Execute() == RET_OK) { maCurrentConfig = aDlg->GetConfig(); diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index 6f39b90a33eb..1f3b9bed4b30 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -201,7 +201,7 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl) else { OUString aText; - VclPtr<SfxSingleTabDialog> pDlg(new SfxSingleTabDialog(this, aDataSet)); + VclPtrInstance< SfxSingleTabDialog > pDlg(this, aDataSet); const int nSettingsId = 42; bool bRightPage = m_pCntSharedBox->IsChecked() || ( SVX_PAGE_LEFT != SvxPageUsage(nPageUsage) ); diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 39e221a0af81..a383eed17f2f 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -257,7 +257,7 @@ bool ScBlockUndo::AdjustHeight() { ScDocument& rDoc = pDocShell->GetDocument(); - ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev; Fraction aZoomX( 1, 1 ); Fraction aZoomY = aZoomX; double nPPTX, nPPTY; @@ -355,7 +355,7 @@ void ScMultiBlockUndo::AdjustHeight() { ScDocument& rDoc = pDocShell->GetDocument(); - ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev; Fraction aZoomX( 1, 1 ); Fraction aZoomY = aZoomX; double nPPTX, nPPTY; diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index d6817c7753c0..fbf3d5a251a5 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1182,7 +1182,7 @@ void ScUndoDragDrop::PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const if (pViewShell) { - ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev; ScViewData& rViewData = pViewShell->GetViewData(); sc::RowHeightContext aCxt( rViewData.GetPPTX(), rViewData.GetPPTY(), rViewData.GetZoomX(), rViewData.GetZoomY(), diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 85ae2b85c012..8187858f64a9 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -841,7 +841,7 @@ void ScUndoAutoFormat::Redo() if (bSize) { - ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev; Fraction aZoomX(1,1); Fraction aZoomY = aZoomX; double nPPTX,nPPTY; diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index 96fbf37cf94b..6e9c5f61b902 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -106,7 +106,7 @@ static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, bo { //! move to document or docshell - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 3a6cdaa873c8..7bbce7a4b1cb 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -755,7 +755,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName ) if ( eFamily == SFX_STYLE_FAMILY_PARA ) { // wie ScViewFunc::RemoveStyleSheetInUse - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; @@ -1096,7 +1096,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle ) { // Zeilenhoehen anpassen... - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; @@ -1463,7 +1463,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault() { // row heights - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; @@ -1845,7 +1845,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt { // Zeilenhoehen anpassen... - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index cc5206614a33..0f2624572b22 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2682,7 +2682,7 @@ void ScCellShell::ExecuteDataPilotDialog() if (nSrcErrorId) { // Error occurred during data creation. Launch an error and bail out. - ScopedVclPtr<InfoBox> aBox(new InfoBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId))); + ScopedVclPtrInstance< InfoBox > aBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId)); aBox->Execute(); return; } diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 43704b5793b8..fb6b9f81c01b 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -740,7 +740,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) break; case SID_DATA_STREAMS: { - ScopedVclPtr<sc::DataStreamDlg> aDialog(new sc::DataStreamDlg( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() ) ); + ScopedVclPtrInstance< sc::DataStreamDlg > aDialog( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() ); ScDocument *pDoc = GetViewData()->GetDocument(); sc::DocumentLinkManager& rMgr = pDoc->GetDocLinkManager(); sc::DataStream* pStrm = rMgr.getDataStream(); diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 3fac550a1b84..efe371abb2dc 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -1422,7 +1422,7 @@ void ScTabView::ErrorMessage( sal_uInt16 nGlobStrId ) } } - ScopedVclPtr<InfoBox> aBox(new InfoBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ) ); + ScopedVclPtrInstance< InfoBox > aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ); aBox->Execute(); if (bFocus) pParent->GrabFocus(); diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 6b6927384b6c..b37fbcaa9ca9 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -975,7 +975,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) { OUString aText(ScResId(SCSTR_PASSWORD)); - VclPtr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText)); + VclPtrInstance< SfxPasswordDialog > pDlg(GetDialogParent(), &aText); pDlg->SetText( ScResId(SCSTR_UNPROTECTDOC) ); pDlg->SetMinLen( 0 ); pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand() ); @@ -997,7 +997,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) { OUString aText(ScResId(SCSTR_PASSWORDOPT)); - VclPtr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText)); + VclPtrInstance< SfxPasswordDialog > pDlg(GetDialogParent(), &aText); pDlg->SetText( ScResId(SCSTR_PROTECTDOC) ); pDlg->SetMinLen( 0 ); pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand() ); @@ -1043,7 +1043,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) if (pProtect && pProtect->isProtectedWithPass()) { OUString aText( ScResId(SCSTR_PASSWORDOPT) ); - VclPtr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText)); + VclPtrInstance< SfxPasswordDialog > pDlg(GetDialogParent(), &aText); pDlg->SetText( ScResId(SCSTR_UNPROTECTTAB) ); pDlg->SetMinLen( 0 ); pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand() ); @@ -1069,7 +1069,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) { // Protect a current sheet. - VclPtr<ScTableProtectionDlg> pDlg(new ScTableProtectionDlg(GetDialogParent())); + VclPtrInstance< ScTableProtectionDlg > pDlg(GetDialogParent()); ScTableProtection* pProtect = pDoc->GetTabProtection(nTab); if (pProtect) diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx index 0a5ed833d235..17dbaa8d2831 100644 --- a/sc/source/ui/view/tabvwshh.cxx +++ b/sc/source/ui/view/tabvwshh.cxx @@ -263,7 +263,7 @@ bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash) { ScDocument* pDoc = GetViewData().GetDocument(); - VclPtr<ScRetypePassDlg> pDlg(new ScRetypePassDlg(GetDialogParent())); + VclPtrInstance< ScRetypePassDlg > pDlg(GetDialogParent()); pDlg->SetDataFromDocument(*pDoc); pDlg->SetDesiredHash(eDesiredHash); if (pDlg->Execute() != RET_OK) diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 9f1549a4412d..f1dd83099799 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -832,7 +832,7 @@ bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument if (!bIsEmpty) { - ScopedVclPtr<ScReplaceWarnBox> aBox(new ScReplaceWarnBox(pParentWnd)); + ScopedVclPtrInstance< ScReplaceWarnBox > aBox(pParentWnd); if (aBox->Execute() != RET_YES) { // changing the configuration is within the ScReplaceWarnBox diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 2b8ef53a601d..0ccf18bd5b2b 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -99,7 +99,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow, if (pActWin) { pEngine->SetPaperSize(Size(100000,100000)); - VclPtr<vcl::Window> aWin(new vcl::Window( pActWin )); + VclPtrInstance< vcl::Window > aWin( pActWin ); EditView aEditView( pEngine.get(), aWin.get() ); aEditView.SetOutputArea(Rectangle(0,0,100000,100000)); @@ -387,7 +387,7 @@ void ScViewFunc::DoThesaurus( bool bRecord ) LanguageType eLnge = ScViewUtil::GetEffLanguage( &rDoc, ScAddress( nCol, nRow, nTab ) ); OUString aErr = SvtLanguageTable::GetLanguageString(eLnge); aErr += ScGlobal::GetRscString( STR_SPELLING_NO_LANG ); - ScopedVclPtr<InfoBox> aBox(new InfoBox( GetViewData().GetDialogParent(), aErr ) ); + ScopedVclPtrInstance< InfoBox > aBox( GetViewData().GetDialogParent(), aErr ); aBox->Execute(); } if (pThesaurusEngine->IsModified()) diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index c3942f0006f9..403cf230156f 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1403,7 +1403,7 @@ void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) ScDocShellModificator aModificator( *pDocSh ); - ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev; pVirtDev->SetMapMode(MAP_PIXEL); pDoc->StyleSheetChanged( pStyleSheet, true, pVirtDev, rViewData.GetPPTX(), @@ -1429,7 +1429,7 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) ScDocShellModificator aModificator( *pDocSh ); - ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev; pVirtDev->SetMapMode(MAP_PIXEL); pDoc->StyleSheetChanged( pStyleSheet, false, pVirtDev, rViewData.GetPPTX(), |