cure a lot of unfortunate ScopedVclPtrs.

Change-Id: I2149511f958ba75e81dc41b10b01eb9d19610037
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 3f38946..129f539 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -2908,7 +2908,7 @@ namespace cppcanvas

            VectorOfOutDevStates    aStateStack;

            ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice;
            ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );
            aVDev->EnableOutput( false );

            // Setup VDev for state tracking and mapping
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 515b3c0..c088d48 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -437,7 +437,7 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt )

IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl )
{
    ScopedVclPtr<CuiAboutConfigTabPage> m_pExpertConfigDlg = new CuiAboutConfigTabPage(this);
    ScopedVclPtr<CuiAboutConfigTabPage> m_pExpertConfigDlg( new CuiAboutConfigTabPage(this) );
    m_pExpertConfigDlg->Reset();//initialize and reset function

    if( RET_OK == m_pExpertConfigDlg->Execute() )
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 935b0b5..8b26870 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -252,7 +252,7 @@ namespace drawinglayer
            const Rectangle aPrimitiveRectangle(
                basegfx::fround(aPrimitiveRange.getMinX()), basegfx::fround(aPrimitiveRange.getMinY()),
                basegfx::fround(aPrimitiveRange.getMaxX()), basegfx::fround(aPrimitiveRange.getMaxY()));
            ScopedVclPtr<VirtualDevice> aContentVDev = new VirtualDevice;
            ScopedVclPtr<VirtualDevice> aContentVDev( new VirtualDevice() );
            MapMode aNewMapMode(pLastOutputDevice->GetMapMode());

            mpOutputDevice = aContentVDev.get();
@@ -2016,7 +2016,7 @@ namespace drawinglayer
                            const Rectangle aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic));
                            Size aSizePixel(aRectPixel.GetSize());
                            const Point aEmptyPoint;
                            ScopedVclPtr<VirtualDevice> aBufferDevice = new VirtualDevice;
                            ScopedVclPtr<VirtualDevice> aBufferDevice( new VirtualDevice() );
                            const sal_uInt32 nMaxQuadratPixels(500000);
                            const sal_uInt32 nViewVisibleArea(aSizePixel.getWidth() * aSizePixel.getHeight());
                            double fReduceFactor(1.0);
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index e06356c..e64f7d3 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -73,7 +73,7 @@ namespace drawinglayer
                const Point aEmptyPoint;
                const Size aSizePixel(nDiscreteWidth, nDiscreteHeight);
                geometry::ViewInformation2D aViewInformation2D(rViewInformation2D);
                ScopedVclPtr<VirtualDevice> maContent = new VirtualDevice;
                ScopedVclPtr<VirtualDevice> maContent(new VirtualDevice());

                // prepare vdev
                maContent->SetOutputSizePixel(aSizePixel, false);
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index d795c0f6..d775fb1 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1755,7 +1755,7 @@ SvxFont EditEngine::GetStandardSvxFont( sal_Int32 nPara )

void EditEngine::StripPortions()
{
    ScopedVclPtr<VirtualDevice> aTmpDev = new VirtualDevice;
    ScopedVclPtr<VirtualDevice> aTmpDev( new VirtualDevice() );
    Rectangle aBigRect( Point( 0, 0 ), Size( 0x7FFFFFFF, 0x7FFFFFFF ) );
    if ( IsVertical() )
    {
diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx
index 3585ba3..7e7bee0 100644
--- a/extensions/source/propctrlr/propertyeditor.cxx
+++ b/extensions/source/propctrlr/propertyeditor.cxx
@@ -96,6 +96,11 @@ namespace pcr
            m_aPropertyPageIds.swap( aEmpty );
        }

        while ( !m_aHiddenPages.empty() )
        {
            m_aHiddenPages.begin()->second.pPage.disposeAndClear();
            m_aHiddenPages.erase( m_aHiddenPages.begin() );
        }
        m_aHiddenPages.clear();
    }

diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx
index 2e2d6fd..a43ee8d 100644
--- a/extensions/source/propctrlr/propertyeditor.hxx
+++ b/extensions/source/propctrlr/propertyeditor.hxx
@@ -49,7 +49,7 @@ namespace pcr
        struct HiddenPage
        {
            sal_uInt16  nPos;
            ScopedVclPtr<TabPage>    pPage;
            VclPtr<TabPage>    pPage;
            HiddenPage() : nPos( 0 ), pPage( NULL ) { }
            HiddenPage( sal_uInt16 _nPos, TabPage* _pPage ) : nPos( _nPos ), pPage( _pPage ) { }
        };
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx
index af7bf5d..07429f0 100644
--- a/forms/source/solar/control/navtoolbar.cxx
+++ b/forms/source/solar/control/navtoolbar.cxx
@@ -152,6 +152,8 @@ namespace frm

    void NavigationToolBar::dispose()
    {
        for (auto i = m_aChildWins.begin(); i != m_aChildWins.end(); ++i)
            i->disposeAndClear();
        m_aChildWins.clear();
        m_pToolbar.clear();
        vcl::Window::dispose();
diff --git a/forms/source/solar/inc/navtoolbar.hxx b/forms/source/solar/inc/navtoolbar.hxx
index ec66f92..79d1266 100644
--- a/forms/source/solar/inc/navtoolbar.hxx
+++ b/forms/source/solar/inc/navtoolbar.hxx
@@ -61,7 +61,7 @@ namespace frm
                                        m_pDescriptionProvider;
        ImageSize                       m_eImageSize;
        VclPtr<ImplNavToolBar>          m_pToolbar;
        ::std::vector< ScopedVclPtr<vcl::Window> > m_aChildWins;
        ::std::vector< VclPtr<vcl::Window> > m_aChildWins;

    public:
        NavigationToolBar(
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index f7a6318..6b65c70 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -158,7 +158,7 @@ void ScDocument::SetPrinter( SfxPrinter* pNewPrinter )
    }
    else
    {
        ScopedVclPtr<SfxPrinter> pOld = pPrinter;
        ScopedVclPtr<SfxPrinter> pOld( pPrinter );
        pPrinter = pNewPrinter;
        UpdateDrawPrinter();
        pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index d0e181b..9a6282a 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 );
    ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *this ) );
    pVDev->SetOutputSizePixel( aSliderWindowSize );

    Rectangle   aSlider = aRect;
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index dd6df46..a78b114 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -58,8 +58,6 @@ namespace
    }
}



void BrowseBox::ConstructImpl( BrowserMode nMode )
{
    OSL_TRACE( "BrowseBox: %p->ConstructImpl", this );
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index eb78198..b923ab3 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -1894,7 +1894,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c
        // First combine very small bitmaps into a larger tile


        ScopedVclPtr<VirtualDevice>   aVDev = new VirtualDevice;
        ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );
        const int       nNumTilesInCacheX( (nTileCacheSize1D + rSizePixel.Width()-1) / rSizePixel.Width() );
        const int       nNumTilesInCacheY( (nTileCacheSize1D + rSizePixel.Height()-1) / rSizePixel.Height() );

diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index 52e2149..e144f6b 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -634,7 +634,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal
    }
    else if ( ( rGraphic.GetType() == GRAPHIC_GDIMETAFILE ) && nImageResolution )
    {
        ScopedVclPtr<VirtualDevice> aDummyVDev = new VirtualDevice;
        ScopedVclPtr<VirtualDevice> aDummyVDev( new VirtualDevice() );
        GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() );
        Size aMtfSize( OutputDevice::LogicToLogic( aMtf.GetPrefSize(), aMtf.GetPrefMapMode(), MAP_100TH_MM ) );
        if ( aMtfSize.Width() && aMtfSize.Height() )
diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index a1cb7a8..889103d 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -1623,7 +1623,7 @@ OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const vcl::Font &r
{
    OUString sRet(makeRepresentativeTextForLanguage(rFont.GetLanguage()));

    ScopedVclPtr<VirtualDevice> aDevice = new VirtualDevice;
    ScopedVclPtr<VirtualDevice> aDevice( new VirtualDevice() );
    if (sRet.isEmpty() || (-1 != aDevice->HasGlyphs(rFont, sRet)))
    {
        aDevice->SetFont(rFont);
diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx
index 4f4ad26..b36ac6d 100644
--- a/svtools/source/table/gridtablerenderer.cxx
+++ b/svtools/source/table/gridtablerenderer.cxx
@@ -86,7 +86,7 @@ namespace svt { namespace table

            Point const aBitmapPos( 0, 0 );
            Size const aBitmapSize( nSortIndicatorWidth, nSortIndicatorHeight );
            ScopedVclPtr<VirtualDevice> aDevice = new VirtualDevice( i_device, 0, 0 );
            ScopedVclPtr<VirtualDevice> aDevice( new VirtualDevice( i_device, 0, 0 ) );
            aDevice->SetOutputSizePixel( aBitmapSize );

            DecorationView aDecoView( aDevice.get() );
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 18cd8dd..8cc8d9d 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;
            ScopedVclPtr<VirtualDevice> aVirDev( new VirtualDevice() );

            nMaxMem = 1024;
            nMaxMem *= 1024; // In Bytes
diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx
index d0fe0f1..95ae3fa 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;
    ScopedVclPtr<VirtualDevice> aOutDev( new VirtualDevice() );
    SgfVector aVect;
    sal_uInt8      nFarb;
    sal_uInt8      nFrb0=7;
diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx
index f40afac..88020be 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;
    ScopedVclPtr<VirtualDevice> aOutDev( new VirtualDevice() );
    OutputDevice* pOutDev;
    sal_uLong         nStdPos;
    sal_uLong         nCharPos;
diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx
index d3b2ed7..19d4620 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;
    ScopedVclPtr<VirtualDevice> vOut( new VirtualDevice() );
    UCHAR        c,c0;
    bool         First;               // first char ?
    sal_uInt8    Just = 0;            // paragraph format
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 4edff5d..c1b33ce 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;
    ScopedVclPtr<VirtualDevice>  aFontVDev( new VirtualDevice() );
    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;
    ScopedVclPtr<VirtualDevice>  aSaveVDev( new VirtualDevice() );
    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;
                    ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );
                    GDIMetaFile     aTmpMtf;

                    aVDev->AddHatchActions( rPolyPoly, rHatch, aTmpMtf );
diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx
index 32b7a83..4bb3240 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;
        ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );

        aVDev->SetOutputSizePixel(aSizePixel);
        aVDev->EnableMapMode(false);
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 9772a57..0720b7f 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;
    ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() );

    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;
    ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() );

    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;
    ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() );

    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 );
    ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( 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;
        ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() );
        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 );
    ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice( 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;
    ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );
    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/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index e271ae4..b225280 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -153,7 +153,7 @@ void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size

void ImplAnimView::drawToPos( sal_uLong nPos )
{
    ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice;
    ScopedVclPtrInstance<VirtualDevice> aVDev;
    std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( mpOut->GetClipRegion() ) : NULL);

    aVDev->SetOutputSizePixel( maSzPix, false );
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index a970919..b7d7b36 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;
            ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );
            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 a0ac4c3..6775985 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;
            ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );
            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 c71c52f..e7edf47 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;
    ScopedVclPtr<VirtualDevice> aDev( new VirtualDevice() );
    aDev->SetOutputSizePixel( rObject.m_aSize );
    aDev->SetMapMode( MapMode( MAP_PIXEL ) );
    if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 5a556c4..2ea36cc 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;
        ScopedVclPtr<VirtualDevice> aMapModeVDev( new VirtualDevice() );
        aMapModeVDev->mnDPIX = mnDPIX;
        aMapModeVDev->mnDPIY = mnDPIY;
        aMapModeVDev->EnableOutput(false);
@@ -1155,10 +1155,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, 
                        Point           aDstPtPix( aBoundRect.TopLeft() );
                        Size            aDstSzPix;

                        ScopedVclPtr<VirtualDevice> aMapVDev = new VirtualDevice;   // here, we record only mapmode information
                        ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() );   // here, we record only mapmode information
                        aMapVDev->EnableOutput(false);

                        ScopedVclPtr<VirtualDevice> aPaintVDev = new VirtualDevice; // into this one, we render.
                        ScopedVclPtr<VirtualDevice> aPaintVDev( new VirtualDevice() ); // into this one, we render.
                        aPaintVDev->SetBackground( aBackgroundComponent.aBgColor );

                        rOutMtf.AddAction( new MetaPushAction( PushFlags::MAPMODE ) );
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 711a64a..289fb1b 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 );
                ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( *this ) );

                if ( aVDev->SetOutputSizePixel( aRect.GetSize() ) )
                {
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index 7cff08f..81e8d8c 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 );
            ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( *this, 1 ) );
            const Size aDstSz( aDstRect.GetSize() );
            const sal_uInt8 cTrans = (sal_uInt8) MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 );

diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx
index 87f4314..5d01f31 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 );
                ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( *this ) );
                aVDev->SetBackground( rWallpaper.GetColor() );
                aVDev->SetOutputSizePixel( Size( nBmpWidth, nBmpHeight ) );
                aVDev->DrawBitmapEx( Point(), aBmpEx );