diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-10 16:13:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-10 16:13:34 +0200 |
commit | 7a1fad0d4f6b95c9beafa9c34f34b70bb9a0c9ed (patch) | |
tree | 10280a4d4cde82967bba69ee1fe0f4a9db71bc9c | |
parent | 3bf4ada33f09e155f3350602e7a4b6cec77e40f0 (diff) |
convert ScopedVclPtr to ScopedVclPtrInstance
Change-Id: I22a9d9c313a81ccee885b9c8785d4b008a6f2058
-rw-r--r-- | chart2/source/controller/main/ChartController_Insert.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/main/ShapeController.cxx | 4 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 8 | ||||
-rw-r--r-- | cui/source/dialogs/scriptdlg.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/table/TableDesignPane.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 4 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabdash.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabgrdt.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabhtch.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xtablend.cxx | 2 | ||||
-rw-r--r-- | sw/qa/tiledrendering/tiledrendering.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/fecopy.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8gr.cxx | 4 | ||||
-rw-r--r-- | uui/source/iahndl-filter.cxx | 2 | ||||
-rw-r--r-- | uui/source/iahndl-locking.cxx | 6 | ||||
-rw-r--r-- | uui/source/iahndl-ssl.cxx | 4 | ||||
-rw-r--r-- | vcl/README.lifecycle | 2 | ||||
-rw-r--r-- | vcl/workben/vcldemo.cxx | 4 |
20 files changed, 32 insertions, 35 deletions
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index a3a2b20a61e1..e194016abd17 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -147,7 +147,7 @@ void ChartController::executeDispatch_InsertGrid() AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, false ); SolarMutexGuard aGuard; - ScopedVclPtr<SchGridDlg> aDlg(new SchGridDlg( m_pChartWindow, aDialogInput ));//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY ); + ScopedVclPtrInstance<SchGridDlg> aDlg(m_pChartWindow, aDialogInput);//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY ); if( aDlg->Execute() == RET_OK ) { // lock controllers till end of block diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index acfc945e55ea..97f2065fb3b6 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -549,7 +549,7 @@ void ShapeController::executeDispatch_FontDialog() SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() ); pDrawViewWrapper->GetAttributes( aAttr ); ViewElementListProvider aViewElementListProvider( pDrawModelWrapper ); - ScopedVclPtr< ShapeFontDialog > pDlg( new ShapeFontDialog( pParent, &aAttr, &aViewElementListProvider ) ); + ScopedVclPtrInstance< ShapeFontDialog > pDlg( pParent, &aAttr, &aViewElementListProvider ); if ( pDlg->Execute() == RET_OK ) { const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet(); @@ -587,7 +587,7 @@ void ShapeController::executeDispatch_ParagraphDialog() aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) ); aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) ); - ScopedVclPtr< ShapeParagraphDialog > pDlg( new ShapeParagraphDialog( pParent, &aNewAttr ) ); + ScopedVclPtrInstance< ShapeParagraphDialog > pDlg( pParent, &aNewAttr ); if ( pDlg->Execute() == RET_OK ) { const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet(); diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 05c5b5596860..248c765cb2ef 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -3044,8 +3044,8 @@ bool SvxToolbarConfigPage::DeleteSelectedContent() if ( m_pContentsListBox->GetEntryCount() == 0 && GetTopLevelSelection()->IsDeletable() ) { - ScopedVclPtr<MessageDialog> qbox(new MessageDialog(this, - CUI_RES(RID_SXVSTR_CONFIRM_DELETE_TOOLBAR), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtrInstance<MessageDialog> qbox(this, + CUI_RES(RID_SXVSTR_CONFIRM_DELETE_TOOLBAR), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); if ( qbox->Execute() == RET_YES ) { @@ -3124,8 +3124,8 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton ) } case ID_DEFAULT_STYLE: { - ScopedVclPtr<MessageDialog> qbox(new MessageDialog(this, - CUI_RES(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtrInstance<MessageDialog> qbox(this, + CUI_RES(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); if ( qbox->Execute() == RET_YES ) { diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 2ba044556f67..a67767099198 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -906,7 +906,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) } } - ScopedVclPtr< CuiInputDialog > xNewDlg( new CuiInputDialog( static_cast<vcl::Window*>(this), nMode ) ); + ScopedVclPtrInstance< CuiInputDialog > xNewDlg( static_cast<vcl::Window*>(this), nMode ); xNewDlg->SetObjectName( aNewName ); do @@ -1029,7 +1029,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry ) } sal_uInt16 nMode = INPUTMODE_RENAME; - ScopedVclPtr< CuiInputDialog > xNewDlg( new CuiInputDialog( static_cast<vcl::Window*>(this), nMode ) ); + ScopedVclPtrInstance< CuiInputDialog > xNewDlg( static_cast<vcl::Window*>(this), nMode ); xNewDlg->SetObjectName( aNewName ); bool bValid; diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index d8c7185bceb3..3c85b4a4ae77 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2722,9 +2722,8 @@ namespace pcr aCoreSet.Put( aFormatter ); // a tab dialog with a single page - ScopedVclPtr< SfxSingleTabDialog > xDialog(new SfxSingleTabDialog( - impl_getDefaultDialogParent_nothrow(), aCoreSet, - "FormatNumberDialog", "cui/ui/formatnumberdialog.ui")); + ScopedVclPtrInstance< SfxSingleTabDialog > xDialog( impl_getDefaultDialogParent_nothrow(), aCoreSet, + "FormatNumberDialog", "cui/ui/formatnumberdialog.ui"); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT( pFact, "CreateFactory fail!" ); ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ); diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index c55828795cc6..e002c1c41fc9 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -813,7 +813,7 @@ short TableDesignDialog::Execute() void showTableDesignDialog( ::vcl::Window* pParent, ViewShellBase& rBase ) { - ScopedVclPtr< TableDesignDialog > xDialog( new TableDesignDialog( pParent, rBase ) ); + ScopedVclPtrInstance< TableDesignDialog > xDialog( pParent, rBase ); xDialog->Execute(); } diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 5e4a7e7d8b99..d03b43b19af3 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -250,7 +250,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam { if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GRAPHIC_BITMAP ) ) { - ScopedVclPtr< VirtualDevice > pVDev(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pVDev; const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MAP_100TH_MM ) ); if( pVDev->SetOutputSizePixel( aSize ) ) @@ -283,7 +283,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam { if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GRAPHIC_BITMAP ) ) { - ScopedVclPtr< VirtualDevice > pVDev(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pVDev; const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MAP_100TH_MM ) ); if( pVDev->SetOutputSizePixel( aSize ) ) diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx index 07d02a1c724e..34e519dfb69b 100644 --- a/svx/source/xoutdev/xtabdash.cxx +++ b/svx/source/xoutdev/xtabdash.cxx @@ -135,7 +135,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash) aStrokeAttribute)); // prepare VirtualDevice - ScopedVclPtr< VirtualDevice > pVirtualDevice(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pVirtualDevice; const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D; pVirtualDevice->SetOutputSizePixel(aSize); diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx index 560765974e4c..16983e5c9882 100644 --- a/svx/source/xoutdev/xtabgrdt.cxx +++ b/svx/source/xoutdev/xtabgrdt.cxx @@ -181,7 +181,7 @@ Bitmap XGradientList::CreateBitmapForUI( long nIndex ) aBlack)); // prepare VirtualDevice - ScopedVclPtr< VirtualDevice > pVirtualDevice(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pVirtualDevice; const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D; pVirtualDevice->SetOutputSizePixel(rSize); diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx index 555347669a3b..30c05a273c70 100644 --- a/svx/source/xoutdev/xtabhtch.cxx +++ b/svx/source/xoutdev/xtabhtch.cxx @@ -142,7 +142,7 @@ Bitmap XHatchList::CreateBitmapForUI( long nIndex ) aBlack)); // prepare VirtualDevice - ScopedVclPtr< VirtualDevice > pVirtualDevice(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pVirtualDevice; const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D; pVirtualDevice->SetOutputSizePixel(rSize); diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx index 1c5b8a843bf3..70bfe2ffb513 100644 --- a/svx/source/xoutdev/xtablend.cxx +++ b/svx/source/xoutdev/xtablend.cxx @@ -125,7 +125,7 @@ Bitmap XLineEndList::CreateBitmapForUI( long nIndex ) aLineStartEndAttribute)); // prepare VirtualDevice - ScopedVclPtr< VirtualDevice > pVirtualDevice(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pVirtualDevice; const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D; pVirtualDevice->SetOutputSizePixel(aSize); diff --git a/sw/qa/tiledrendering/tiledrendering.cxx b/sw/qa/tiledrendering/tiledrendering.cxx index 2fddd6c33691..af67aee607d8 100644 --- a/sw/qa/tiledrendering/tiledrendering.cxx +++ b/sw/qa/tiledrendering/tiledrendering.cxx @@ -131,7 +131,7 @@ IMPL_LINK ( TiledRenderingDialog, RenderHdl, Button *, EMPTYARG ) // SystemGraphicsData aData; // [setup the aData] // VirtualDevice pDevice(&aData, [color depth]); - ScopedVclPtr< VirtualDevice > pDevice(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pDevice; // paint to it pViewShell->PaintTile(*pDevice.get(), contextWidth, contextHeight, tilePosX, tilePosY, tileWidth, tileHeight); diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index d8ec94862bd0..3ed004c9a617 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1239,7 +1239,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFmt, Graphic& rGrf ) co Point aPt; GetGrfSize( aSz ); - ScopedVclPtr< VirtualDevice > pVirtDev(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pVirtDev; pVirtDev->EnableOutput( false ); MapMode aTmp( GetWin()->GetMapMode() ); @@ -1266,7 +1266,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFmt, Graphic& rGrf ) co // Otherwise it could happen that for vector graphics // many MB's of memory are allocated. const Size aSz( FindFlyFrm()->Prt().SSize() ); - ScopedVclPtr< VirtualDevice > pVirtDev(new VirtualDevice(*GetWin())); + ScopedVclPtrInstance< VirtualDevice > pVirtDev(*GetWin()); MapMode aTmp( MAP_TWIP ); pVirtDev->SetMapMode( aTmp ); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index c22ab509338a..3afc80497d00 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -7640,7 +7640,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap ) SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pFirst); OutputDevice *pOld = pSh->GetOut(); - ScopedVclPtr< VirtualDevice > pDev( new VirtualDevice( *pOld ) ); + ScopedVclPtrInstance< VirtualDevice > pDev( *pOld ); pDev->EnableOutput( false ); GDIMetaFile aMet; diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 2d3db2b581fb..77bd84f96805 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -726,7 +726,7 @@ void SwWW8WrGrf::WriteGrfFromGrfNode(SvStream& rStrm, const SwGrfNode &rGrfNd, { case GRAPHIC_BITMAP: // Bitmap -> play in Metafile { - ScopedVclPtr< VirtualDevice > pVirt(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pVirt; aMeta.Record(pVirt.get()); pVirt->DrawBitmap( Point( 0,0 ), rGrf.GetBitmap() ); aMeta.Stop(); @@ -854,7 +854,7 @@ void SwWW8WrGrf::WriteGrfForBullet(SvStream& rStrm, const Graphic &rGrf, sal_uIn { case GRAPHIC_BITMAP: // Bitmap -> in Metafile abspielen { - ScopedVclPtr< VirtualDevice > pVirt(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > pVirt; aMeta.Record(pVirt.get()); pVirt->DrawBitmap( Point( 0,0 ), rGrf.GetBitmap() ); aMeta.Stop(); diff --git a/uui/source/iahndl-filter.cxx b/uui/source/iahndl-filter.cxx index a8d6c8d9625d..710cd8ae545c 100644 --- a/uui/source/iahndl-filter.cxx +++ b/uui/source/iahndl-filter.cxx @@ -55,7 +55,7 @@ executeFilterDialog( { SolarMutexGuard aGuard; - ScopedVclPtr< uui::FilterDialog > xDialog(new uui::FilterDialog(pParent)); + ScopedVclPtrInstance< uui::FilterDialog > xDialog(pParent); xDialog->SetURL(rURL); xDialog->ChangeFilters(&rFilters); diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx index ad9ddb700142..aac4cd87c960 100644 --- a/uui/source/iahndl-locking.cxx +++ b/uui/source/iahndl-locking.cxx @@ -93,8 +93,7 @@ handleLockedDocumentRequest_( aMessage = UUIInteractionHelper::replaceMessageWithArguments( aMessage, aArguments ); - ScopedVclPtr< OpenLockedQueryBox > xDialog(new OpenLockedQueryBox( - pParent, xManager.get(), aMessage ) ); + ScopedVclPtrInstance< OpenLockedQueryBox > xDialog(pParent, xManager.get(), aMessage); nResult = xDialog->Execute(); } else if ( nMode == UUI_DOC_SAVE_LOCK ) @@ -107,8 +106,7 @@ handleLockedDocumentRequest_( aMessage = UUIInteractionHelper::replaceMessageWithArguments( aMessage, aArguments ); - ScopedVclPtr< TryLaterQueryBox > xDialog( - new TryLaterQueryBox( pParent, xManager.get(), aMessage ) ); + ScopedVclPtrInstance< TryLaterQueryBox > xDialog( pParent, xManager.get(), aMessage ); nResult = xDialog->Execute(); } else if ( nMode == UUI_DOC_OWN_LOAD_LOCK || diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index 0e12165b2de5..e42ed909b5b2 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -145,7 +145,7 @@ executeUnknownAuthDialog( { SolarMutexGuard aGuard; - ScopedVclPtr< UnknownAuthDialog > xDialog(new UnknownAuthDialog(pParent, rXCert, xContext)); + ScopedVclPtrInstance< UnknownAuthDialog > xDialog(pParent, rXCert, xContext); // Get correct resource string OUString aMessage; @@ -186,7 +186,7 @@ executeSSLWarnDialog( { SolarMutexGuard aGuard; - ScopedVclPtr< SSLWarnDialog > xDialog(new SSLWarnDialog(pParent, rXCert, xContext)); + ScopedVclPtrInstance< SSLWarnDialog > xDialog(pParent, rXCert, xContext); // Get correct resource string OUString aMessage_1; diff --git a/vcl/README.lifecycle b/vcl/README.lifecycle index 6a9e080c176a..0b09f57b430e 100644 --- a/vcl/README.lifecycle +++ b/vcl/README.lifecycle @@ -125,7 +125,7 @@ or: + // someone else gets a VclPtr to xDialog or: - VirtualDevice aDev; -+ ScopedVclPtrInstance<VirtualDevice> pDev(); ++ ScopedVclPtrInstance<VirtualDevice> pDev; ** Why are these 'disposeOnce' calls in destructors ? diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 4347801e824d..84018793c5c4 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -944,8 +944,8 @@ public: BitmapEx AlphaRecovery(OutputDevice &rDev, Point aPt, BitmapEx &aSrc) { // Compositing onto 2x colors beyond our control - ScopedVclPtr< VirtualDevice > aWhite(new VirtualDevice()); - ScopedVclPtr< VirtualDevice > aBlack(new VirtualDevice()); + ScopedVclPtrInstance< VirtualDevice > aWhite; + ScopedVclPtrInstance< VirtualDevice > aBlack; aWhite->SetOutputSizePixel(aSrc.GetSizePixel()); aWhite->SetBackground(Wallpaper(COL_WHITE)); aWhite->Erase(); |