diff options
33 files changed, 54 insertions, 57 deletions
diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx index 0c29f11d8e2d..c4c210b5b451 100644 --- a/include/vcl/vclptr.hxx +++ b/include/vcl/vclptr.hxx @@ -97,6 +97,12 @@ public: : m_rInnerRef(pBody) {} + /** Constructor... that doesn't take a ref. + */ + inline VclPtr (reference_type * pBody, __sal_NoAcquire) + : m_rInnerRef(pBody, SAL_NO_ACQUIRE) + {} + /** Copy constructor... */ inline VclPtr (const VclPtr<reference_type> & handle) @@ -215,11 +221,6 @@ public: { return (m_rInnerRef > handle.m_rInnerRef); } - -protected: - inline VclPtr (reference_type * pBody, __sal_NoAcquire) - : m_rInnerRef(pBody, SAL_NO_ACQUIRE) - {} }; // class VclPtr /** diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx index 689d9315762f..5e0b7a788b95 100644 --- a/vcl/generic/print/genprnpsp.cxx +++ b/vcl/generic/print/genprnpsp.cxx @@ -144,7 +144,7 @@ namespace int QueryFaxNumber(OUString& rNumber) { OUString aTmpString(VclResId(SV_PRINT_QUERYFAXNUMBER_TXT)); - ScopedVclPtr<QueryString> aQuery(new QueryString(NULL, aTmpString, rNumber)); + ScopedVclPtrInstance< QueryString > aQuery( nullptr, aTmpString, rNumber ); return aQuery->Execute(); } } diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index 3d34bb1fcdee..b44678700f28 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -502,7 +502,7 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey ) int SetupPrinterDriver(::psp::PrinterInfo& rJobData) { int nRet = 0; - ScopedVclPtr<RTSDialog> aDialog(new RTSDialog( rJobData, NULL ) ); + ScopedVclPtrInstance< RTSDialog > aDialog( rJobData, nullptr ); if( aDialog->Execute() ) { diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx index 4b1a44629a8d..cb0b0a208ebc 100644 --- a/vcl/qa/cppunit/outdev.cxx +++ b/vcl/qa/cppunit/outdev.cxx @@ -32,7 +32,7 @@ public: void VclOutdevTest::testVirtualDevice() { - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; pVDev->SetOutputSizePixel(Size(32,32)); pVDev->SetBackground(Wallpaper(COL_WHITE)); pVDev->Erase(); diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index 7d099d6598d9..b421606c5a24 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -369,7 +369,7 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt ) { if ( rHEvt.GetMode() & HelpEventMode::CONTEXT ) { - ScopedVclPtr<DbgInfoDialog> aInfoDialog(new DbgInfoDialog( this, true ) ); + ScopedVclPtrInstance< DbgInfoDialog > aInfoDialog( this, true ); OUString aHelpText; const sal_Char** pHelpStrs = pDbgHelpText; while ( *pHelpStrs ) @@ -833,7 +833,7 @@ void DbgGUIStart() if ( pData ) { - ScopedVclPtr<DbgDialog> pDialog(new DbgDialog); + ScopedVclPtrInstance< DbgDialog > pDialog; // we switch off dialog tests for the debug dialog sal_uLong nOldFlags = pData->nTestFlags; pData->nTestFlags &= ~DBG_TEST_DIALOG; diff --git a/vcl/source/app/stdtext.cxx b/vcl/source/app/stdtext.cxx index dcd8c9e69ffb..fcf7b9d129c7 100644 --- a/vcl/source/app/stdtext.cxx +++ b/vcl/source/app/stdtext.cxx @@ -39,7 +39,7 @@ void ShowServiceNotAvailableError(vcl::Window* pParent, { OUString aText = GetStandardText(STANDARD_TEXT_SERVICE_NOT_AVAILABLE). replaceAll("%s", rServiceName); - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pParent, aText, bError ? VCL_MESSAGE_ERROR : VCL_MESSAGE_WARNING)); + ScopedVclPtrInstance< MessageDialog > aBox( pParent, aText, bError ? VCL_MESSAGE_ERROR : VCL_MESSAGE_WARNING ); aBox->Execute(); } diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index b8563c518654..3a4920ac4921 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -172,7 +172,7 @@ ResMgr* ImplGetResMgr() "Missing vcl resource. This indicates that files vital to localization are missing. " "You might have a corrupt installation."; fprintf( stderr, "%s\n", pMsg ); - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, OUString(pMsg, strlen(pMsg), RTL_TEXTENCODING_ASCII_US))); + ScopedVclPtrInstance< MessageDialog > aBox( nullptr, OUString(pMsg, strlen(pMsg), RTL_TEXTENCODING_ASCII_US) ); aBox->Execute(); } } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 246df6ee6e75..6809481574c4 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -805,7 +805,7 @@ void Edit::ShowTruncationWarning( vcl::Window* pParent ) ResMgr* pResMgr = ImplGetResMgr(); if( pResMgr ) { - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pParent, ResId(SV_EDIT_WARNING_STR, *pResMgr), VCL_MESSAGE_WARNING)); + ScopedVclPtrInstance< MessageDialog > aBox( pParent, ResId(SV_EDIT_WARNING_STR, *pResMgr), VCL_MESSAGE_WARNING ); aBox->Execute(); } } @@ -2784,7 +2784,7 @@ Size Edit::CalcMinimumSize() const Size Edit::GetMinimumEditSize() { vcl::Window* pDefWin = ImplGetDefaultWindow(); - ScopedVclPtr<Edit> aEdit(new Edit( pDefWin, WB_BORDER ) ); + ScopedVclPtrInstance< Edit > aEdit( pDefWin, WB_BORDER ); Size aSize( aEdit->CalcMinimumSize() ); return aSize; } diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 8cc8d9d5770a..961679796fc7 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1892,7 +1892,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString { Size aSizePixel; sal_uLong nColorCount,nBitsPerPixel,nNeededMem,nMaxMem; - ScopedVclPtr<VirtualDevice> aVirDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aVirDev; nMaxMem = 1024; nMaxMem *= 1024; // In Bytes diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx index 95ae3fad1984..277e4af32366 100644 --- a/vcl/source/filter/sgfbram.cxx +++ b/vcl/source/filter/sgfbram.cxx @@ -390,7 +390,7 @@ Color Hpgl2SvFarbe( sal_uInt8 nFarb ) bool SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf) { - ScopedVclPtr<VirtualDevice> aOutDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aOutDev; SgfVector aVect; sal_uInt8 nFarb; sal_uInt8 nFrb0=7; diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx index 88020bedc5fb..ca754c28e4d9 100644 --- a/vcl/source/filter/sgvmain.cxx +++ b/vcl/source/filter/sgvmain.cxx @@ -794,7 +794,7 @@ bool SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) { bool bRet = false; PageType aPage; - ScopedVclPtr<VirtualDevice> aOutDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aOutDev; OutputDevice* pOutDev; sal_uLong nStdPos; sal_uLong nCharPos; diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index 19d4620510aa..290ff1427912 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -660,7 +660,7 @@ void FormatLine(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& double, double, UCHAR* cLine, bool TextFit) { - ScopedVclPtr<VirtualDevice> vOut( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > vOut; UCHAR c,c0; bool First; // first char ? sal_uInt8 Just = 0; // paragraph format diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index 1e807f1bb001..740ac493f353 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -236,8 +236,7 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont ) { // #i117968# VirtualDevice is not thread safe, but filter is used in multithreading SolarMutexGuard aGuard; - VclPtr<VirtualDevice> pVDev = new VirtualDevice(); - + VclPtrInstance< VirtualDevice > pVDev; // converting the cell height into a font height aFont.SetSize( aFontSize ); pVDev->SetFont( aFont ); @@ -1448,8 +1447,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b { // #i117968# VirtualDevice is not thread safe, but filter is used in multithreading SolarMutexGuard aGuard; - VclPtr<VirtualDevice> pVDev = new VirtualDevice(); - + VclPtrInstance< VirtualDevice > pVDev; sal_Int32 nTextWidth; pVDev->SetMapMode( MapMode( MAP_100TH_MM ) ); pVDev->SetFont( maFont ); @@ -1497,8 +1495,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b { // #i117968# VirtualDevice is not thread safe, but filter is used in multithreading SolarMutexGuard aGuard; - VclPtr<VirtualDevice> pVDev = new VirtualDevice(); - + VclPtrInstance< VirtualDevice > pVDev; pDX = new long[ rText.getLength() ]; pVDev->SetMapMode( MAP_100TH_MM ); pVDev->SetFont( maLatestFont ); @@ -1516,7 +1513,7 @@ void WinMtfOutput::ImplDrawBitmap( const Point& rPos, const Size& rSize, const B BitmapEx aBmpEx( rBitmap ); if ( mbComplexClip ) { - VclPtr<VirtualDevice> pVDev = new VirtualDevice(); + VclPtrInstance< VirtualDevice > pVDev; MapMode aMapMode( MAP_100TH_MM ); aMapMode.SetOrigin( Point( -rPos.X(), -rPos.Y() ) ); const Size aOutputSizePixel( pVDev->LogicToPixel( rSize, aMapMode ) ); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 157e506a030c..de3358cfb964 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -706,7 +706,7 @@ BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize Size aStdSize( aStandardSize, aStandardSize ); Rectangle aRect(aEmptyPoint, aStdSize ); - ScopedVclPtr<VirtualDevice> aVirDevice( new VirtualDevice(*Application::GetDefaultDevice(), 0, 1) ); + ScopedVclPtrInstance< VirtualDevice > aVirDevice( *Application::GetDefaultDevice(), 0, 1 ); aVirDevice->SetOutputSizePixel( aStdSize ); aVirDevice->SetFillColor( COL_TRANSPARENT ); aVirDevice->SetLineColor( COL_TRANSPARENT ); diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index c1b33ce63393..0c76698026ae 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -498,7 +498,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) LineInfo aLineInfo( LINE_NONE, 0 ); ::std::stack< LineInfo* > aLIStack; - ScopedVclPtr<VirtualDevice> aFontVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aFontVDev; rtl_TextEncoding eActualCharSet = osl_getThreadTextEncoding(); bool bFatLine = false; @@ -1374,7 +1374,7 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf ) rtl_TextEncoding eActualCharSet = osl_getThreadTextEncoding(); const Size aPrefSize( rMtf.GetPrefSize() ); bool bRop_0_1 = false; - ScopedVclPtr<VirtualDevice> aSaveVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aSaveVDev; Color aLineCol( COL_BLACK ); ::std::stack< Color* > aLineColStack; @@ -2311,7 +2311,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { // write actions for hatch - ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aVDev; GDIMetaFile aTmpMtf; aVDev->AddHatchActions( rPolyPoly, rHatch, aTmpMtf ); diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index 4bb32408706d..1c19a11a4305 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -161,7 +161,7 @@ namespace // in pixel mode for alpha channel painting (black is transparent, // white to paint 100% opacity) const Size aSizePixel(rBitmapEx.GetSizePixel()); - ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aVDev; aVDev->SetOutputSizePixel(aSizePixel); aVDev->EnableMapMode(false); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 0720b7f91a29..0eafc4f67e38 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -723,7 +723,7 @@ void GDIMetaFile::Move( long nX, long nY ) { const Size aBaseOffset( nX, nY ); Size aOffset( aBaseOffset ); - ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aMapVDev; aMapVDev->EnableOutput( false ); aMapVDev->SetMapMode( GetPrefMapMode() ); @@ -757,7 +757,7 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY ) { const Size aBaseOffset( nX, nY ); Size aOffset( aBaseOffset ); - ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aMapVDev; aMapVDev->EnableOutput( false ); aMapVDev->SetReferenceDevice( nDPIX, nDPIY ); @@ -825,7 +825,7 @@ void GDIMetaFile::Scale( const Fraction& rScaleX, const Fraction& rScaleY ) void GDIMetaFile::Clip( const Rectangle& i_rClipRect ) { Rectangle aCurRect( i_rClipRect ); - ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aMapVDev; aMapVDev->EnableOutput( false ); aMapVDev->SetMapMode( GetPrefMapMode() ); @@ -892,7 +892,7 @@ void GDIMetaFile::ImplAddGradientEx( GDIMetaFile& rMtf, const Gradient& rGrad ) { // Generate comment, GradientEx and Gradient actions (within DrawGradient) - ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( rMapDev, 0 ) ); + ScopedVclPtrInstance< VirtualDevice > aVDev( rMapDev, 0 ); aVDev->EnableOutput( false ); GDIMetaFile aGradMtf; @@ -917,7 +917,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) if( nAngle10 ) { GDIMetaFile aMtf; - ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aMapVDev; const double fAngle = F_PI1800 * nAngle10; const double fSin = sin( fAngle ); const double fCos = cos( fAngle ); @@ -1400,7 +1400,7 @@ static void ImplActionBounds( Rectangle& o_rOutBounds, Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHairline ) const { GDIMetaFile aMtf; - ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice( i_rReference ) ); + ScopedVclPtrInstance< VirtualDevice > aMapVDev( i_rReference ); aMapVDev->EnableOutput( false ); aMapVDev->SetMapMode( GetPrefMapMode() ); @@ -2890,7 +2890,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm ) bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent, BmpConversion eColorConversion, long nScaleFlag) const { // initialization seems to be complicated but is used to avoid rounding errors - ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aVDev; const Point aNullPt; const Point aTLPix( aVDev->LogicToPixel( aNullPt, GetPrefMapMode() ) ); const Point aBRPix( aVDev->LogicToPixel( Point( GetPrefSize().Width() - 1, GetPrefSize().Height() - 1 ), GetPrefMapMode() ) ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index b7d7b3640e22..0aace4e88651 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -467,7 +467,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters) if(maEx.IsEmpty()) { // calculate size - ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aVDev; Size aDrawSize(aVDev->LogicToPixel(maMetaFile.GetPrefSize(), maMetaFile.GetPrefMapMode())); if(rParameters.getSizePixel().Width() && rParameters.getSizePixel().Height()) diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 6775985de89a..bdb5f3114eeb 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -717,7 +717,7 @@ bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf, if( rMtf.GetActionSize() ) { MapMode aMap( MAP_100TH_MM ); - ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aVDev; const Size aLogSize1( aVDev->PixelToLogic( Size( 1, 1 ), aMap ) ); rMtf.SetPrefMapMode( aMap ); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index e7edf4703eaa..ba5a0bf5f5c3 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -10938,7 +10938,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject ) sal_Int32 nFunctionObject = createObject(); CHECK_RETURN( updateObject( nFunctionObject ) ); - ScopedVclPtr<VirtualDevice> aDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aDev; aDev->SetOutputSizePixel( rObject.m_aSize ); aDev->SetMapMode( MapMode( MAP_PIXEL ) ); if( m_aContext.ColorMode == PDFWriter::DrawGreyscale ) diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index c632f29197c9..74db239b7715 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -431,7 +431,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa if ( nPixelX && nPixelY ) { Size aDstSizePixel( nPixelX, nPixelY ); - ScopedVclPtr<VirtualDevice> xVDev(new VirtualDevice); + ScopedVclPtrInstance<VirtualDevice> xVDev; if( xVDev->SetOutputSizePixel( aDstSizePixel ) ) { Bitmap aPaint, aMask; diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index f66c139754b5..9e363aaff2b5 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -728,7 +728,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, ConnectedComponents aBackgroundComponent; // create an OutputDevice to record mapmode changes and the like - ScopedVclPtr<VirtualDevice> aMapModeVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aMapModeVDev; aMapModeVDev->mnDPIX = mnDPIX; aMapModeVDev->mnDPIY = mnDPIY; aMapModeVDev->EnableOutput(false); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index d3f5211a2705..56809dabfa10 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -321,7 +321,7 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, if (!xController->getPrinter()) { OUString aPrinterName( i_rInitSetup.GetPrinterName() ); - VclPtr<Printer> xPrinter( new Printer( aPrinterName ) ); + VclPtrInstance<Printer> xPrinter( aPrinterName ); xPrinter->SetJobSetup(i_rInitSetup); xController->setPrinter(xPrinter); } @@ -472,7 +472,7 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, { try { - ScopedVclPtrInstance<PrintDialog> aDlg( nullptr, xController ); + ScopedVclPtrInstance< PrintDialog > aDlg( nullptr, xController ); if( ! aDlg->Execute() ) { xController->abortJob(); diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 289fb1b57570..8ee76b8cef28 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -410,7 +410,7 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const // If the visible part has been clipped, we have to create a // Bitmap with the correct size in which we copy the clipped // Bitmap to the correct position. - ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( *this ) ); + ScopedVclPtrInstance< VirtualDevice > aVDev( *this ); if ( aVDev->SetOutputSizePixel( aRect.GetSize() ) ) { diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 62a92f450435..acbfd4b03c76 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -2493,7 +2493,7 @@ bool OutputDevice::GetTextBoundRect( Rectangle& rRect, // fall back to bitmap method to get the bounding rectangle, // so we need a monochrome virtual device with matching font - ScopedVclPtr<VirtualDevice> aVDev(new VirtualDevice( 1 )); + ScopedVclPtrInstance< VirtualDevice > aVDev( 1 ); vcl::Font aFont( GetFont() ); aFont.SetShadow( false ); aFont.SetOutline( false ); @@ -2717,7 +2717,7 @@ bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector, + mnEmphasisDescent; pSalLayout->Release(); - ScopedVclPtr<VirtualDevice> aVDev(new VirtualDevice(1)); + ScopedVclPtrInstance< VirtualDevice > aVDev( 1 ); vcl::Font aFont(GetFont()); aFont.SetShadow(false); diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 81e8d8cc3b1b..9f160f74236d 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -431,7 +431,7 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, if( !bDrawn ) { - ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( *this, 1 ) ); + ScopedVclPtrInstance< VirtualDevice > aVDev( *this, 1 ); const Size aDstSz( aDstRect.GetSize() ); const sal_uInt8 cTrans = (sal_uInt8) MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 ); @@ -682,7 +682,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, if( !aDstRect.IsEmpty() ) { - ScopedVclPtrInstance<VirtualDevice> xVDev; + ScopedVclPtrInstance< VirtualDevice > xVDev; ((OutputDevice*)xVDev.get())->mnDPIX = mnDPIX; ((OutputDevice*)xVDev.get())->mnDPIY = mnDPIY; diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx index 5d01f31278e7..ba7928b4f812 100644 --- a/vcl/source/outdev/wallpaper.cxx +++ b/vcl/source/outdev/wallpaper.cxx @@ -129,7 +129,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY, { if( !pCached && !rWallpaper.GetColor().GetTransparency() ) { - ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( *this ) ); + ScopedVclPtrInstance< VirtualDevice > aVDev( *this ); aVDev->SetBackground( rWallpaper.GetColor() ); aVDev->SetOutputSizePixel( Size( nBmpWidth, nBmpHeight ) ); aVDev->DrawBitmapEx( Point(), aBmpEx ); diff --git a/vcl/source/uipreviewer/previewer.cxx b/vcl/source/uipreviewer/previewer.cxx index 20074297e5a5..bb93b1207dd8 100644 --- a/vcl/source/uipreviewer/previewer.cxx +++ b/vcl/source/uipreviewer/previewer.cxx @@ -68,8 +68,7 @@ int UIPreviewApp::Main() try { - VclPtr<Dialog> pDialog = new Dialog(DIALOG_NO_PARENT, WB_STDDIALOG | WB_SIZEABLE); - + VclPtrInstance<Dialog> pDialog(DIALOG_NO_PARENT, WB_STDDIALOG | WB_SIZEABLE); { VclBuilder aBuilder(pDialog, OUString(), uifiles[0]); vcl::Window *pRoot = aBuilder.get_widget_root(); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index e6cb65a8559c..21532c35ce81 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1770,7 +1770,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c SAL_WARN_IF(!pWindow, "vcl.layout", "probably need to implement " << name.getStr() << " or add a make" << name.getStr() << " function"); if (pWindow) { - VclPtr< Window > xWindow( pWindow, SAL_NO_ACQUIRE ); + VclPtr< vcl::Window > xWindow( pWindow, SAL_NO_ACQUIRE ); pWindow->SetHelpId(m_sHelpRoot + id); SAL_INFO("vcl.layout", "for " << name.getStr() << ", created " << pWindow << " child of " << diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 0e29d4a44ca3..54fb42dc508c 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1092,7 +1092,7 @@ void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal if (!( GetStyle() & WB_NOBORDER )) { - ScopedVclPtr<ImplBorderWindow> aImplWin( new ImplBorderWindow(this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP) ); + ScopedVclPtrInstance< ImplBorderWindow > aImplWin( this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP ); aImplWin->SetText( GetText() ); aImplWin->setPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() ); aImplWin->SetDisplayActive( true ); diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx index f2cdb6eaebac..e349934a5af1 100644 --- a/vcl/workben/svdem.cxx +++ b/vcl/workben/svdem.cxx @@ -81,7 +81,7 @@ public: void Main() { - ScopedVclPtr<MyWin> aMainWin(new MyWin(NULL, WB_APP | WB_STDWORK) ); + ScopedVclPtrInstance< MyWin > aMainWin( nullptr, WB_APP | WB_STDWORK ); aMainWin->SetText(OUString("VCL - Workbench")); aMainWin->Show(); diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx index cda0b34bf521..428cfa7dbc6e 100644 --- a/vcl/workben/svpclient.cxx +++ b/vcl/workben/svpclient.cxx @@ -121,7 +121,7 @@ public: void Main() { - ScopedVclPtr<MyWin> aMainWin(new MyWin(NULL, WB_STDWORK) ); + ScopedVclPtrInstance< MyWin > aMainWin( nullptr, WB_STDWORK ); aMainWin->SetText( OUString( "SvpClient" ) ); aMainWin->Show(); diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 70c769b71719..ac2c5527a8e0 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -91,7 +91,7 @@ public: void Main() { - ScopedVclPtr<MyWin> aMainWin(new MyWin(NULL, WB_APP | WB_STDWORK) ); + ScopedVclPtrInstance< MyWin > aMainWin( nullptr, WB_APP | WB_STDWORK ); aMainWin->SetText( OUString( "VCL - Workbench" ) ); aMainWin->Show(); |