vclptr: various mistakes fixed, and more ptr types converted.

Change-Id: Iba04ec828f7ce37fc6ede28a64f1c286d81ff705
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 972c997..44a7f44 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -2810,7 +2810,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics
        if ( ( nIntLeading == 0 ) && ( pRefDev->GetOutDevType() == OUTDEV_PRINTER ) )
        {
            // Lets see what Leading one gets on the screen
            VirtualDevice* pVDev = GetVirtualDevice( pRefDev->GetMapMode(), pRefDev->GetDrawMode() );
            VclPtr<VirtualDevice> pVDev = GetVirtualDevice( pRefDev->GetMapMode(), pRefDev->GetDrawMode() );
            rFont.SetPhysFont( pVDev );
            aMetric = pVDev->GetFontMetric();

diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 925823a..ef1a731 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -2141,7 +2141,7 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const lo
        vcl::Font    aNotRotatedFont( maFont );
        aNotRotatedFont.SetOrientation( 0 );

        ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice() );
        ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice( 1 ) );
        pVirDev->SetMapMode( rVDev.GetMapMode() );
        pVirDev->SetFont( aNotRotatedFont );
        pVirDev->SetTextAlign( eTextAlign );
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e9d2185..4a4d613 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -482,7 +482,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
    aOutputData.SetMirrorWidth( nMirrorWidth ); // needed for RTL
    aOutputData.SetSpellCheckContext(mpSpellCheckCxt.get());

    std::unique_ptr<VirtualDevice> xFmtVirtDev;
    ScopedVclPtr< VirtualDevice > xFmtVirtDev;
    bool bLogicText = bTextWysiwyg; // call DrawStrings in logic MapMode?

    if ( bTextWysiwyg )
diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
index 9b992ee..327cadd 100644
--- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
@@ -121,7 +121,7 @@ public:
    void Dispose (void);

private:
    ::boost::shared_ptr<VirtualDevice> mpLayerDevice;
    ScopedVclPtr<VirtualDevice> mpLayerDevice;
    ::std::vector<SharedILayerPainter> maPainters;
    vcl::Region maInvalidationRegion;

diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 9c10297..adfbf58 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -907,7 +907,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, 
        if( !bSingleGraphic )
        {
            // create a metafile for all shapes
            ScopedVclPtr<VirtualDevice> aOut;
            ScopedVclPtr<VirtualDevice> aOut(new VirtualDevice());

            // calculate bound rect for all shapes
            Rectangle aBound;
diff --git a/vcl/source/filter/wmf/emfwr.hxx b/vcl/source/filter/wmf/emfwr.hxx
index dd34bbc..d4925c1 100644
--- a/vcl/source/filter/wmf/emfwr.hxx
+++ b/vcl/source/filter/wmf/emfwr.hxx
@@ -33,7 +33,7 @@ class EMFWriter
{
private:

    ScopedVclPtr<VirtualDevice>       maVDev;
    ScopedVclPtr<VirtualDevice> maVDev;
    MapMode             maDestMapMode;
    SvStream& m_rStm;
    bool*               mpHandlesUsed;
@@ -91,6 +91,7 @@ public:

    EMFWriter(SvStream &rStream)
        : m_rStm(rStream)
        , maVDev( new VirtualDevice() )
        , mpHandlesUsed(NULL)
        , mnHandleCount(0)
        , mnRecordCount(0)
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 7ba5645..7c48a7f 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1024,6 +1024,7 @@ void Printer::dispose()
    DBG_ASSERT( !IsJobActive(), "Printer::~Printer() - Job is active" );

    delete mpPrinterOptions;
    mpPrinterOptions = NULL;

    ReleaseGraphics();
    if ( mpInfoPrinter )
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index d0d35ce..beee1b7 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -221,6 +221,7 @@ void OutputDevice::dispose()
    ImplInvalidateViewTransform();

    delete mpOutDevData;
    mpOutDevData = NULL;

    // for some reason, we haven't removed state from the stack properly
    if ( !mpOutDevStateStack->empty() )
@@ -232,6 +233,7 @@ void OutputDevice::dispose()
        }
    }
    delete mpOutDevStateStack;
    mpOutDevStateStack = NULL;

    // release the active font instance
    if( mpFontEntry )
@@ -240,8 +242,10 @@ void OutputDevice::dispose()
    // remove cached results of GetDevFontList/GetDevSizeList
    // TODO: use smart pointers for them
    delete mpGetDevFontList;
    mpGetDevFontList = NULL;

    delete mpGetDevSizeList;
    mpGetDevSizeList = NULL;

    // release ImplFontCache specific to this OutputDevice
    // TODO: refcount ImplFontCache