Move OutputDevice members to VclPtr: filter, reportdesign, uui.

Change-Id: Iafac8812714a0be68f5608f657c76c159f2912a0
diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx
index 4e20212..7df9404 100644
--- a/filter/source/flash/swfwriter.cxx
+++ b/filter/source/flash/swfwriter.cxx
@@ -100,7 +100,7 @@ Writer::Writer( sal_Int32 nTWIPWidthOutput, sal_Int32 nTWIPHeightOutput, sal_Int

Writer::~Writer()
{
    delete mpVDev;
    mpVDev.disposeAndClear();
    delete mpSprite;
    delete mpTag;
}
diff --git a/filter/source/flash/swfwriter.hxx b/filter/source/flash/swfwriter.hxx
index 218459b..2e98ab1 100644
--- a/filter/source/flash/swfwriter.hxx
+++ b/filter/source/flash/swfwriter.hxx
@@ -395,7 +395,7 @@ private:
    sal_uInt16 mnWhiteBackgroundShapeId;
    sal_uInt16 mnPageButtonId;

    VirtualDevice*  mpVDev;
    VclPtr<VirtualDevice> mpVDev;

    const tools::PolyPolygon* mpClipPolyPolygon;

diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index c2bb584..c6404e50 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -157,7 +157,7 @@ private:
    sal_uInt32               nActBitmapPercent; // percentage of the next bitmap that's already written

    ScopedVclPtr<VirtualDevice>  apDummyVDev;
    OutputDevice*                       pCompDev;
    VclPtr<OutputDevice>         pCompDev;

    com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;

diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index c4f1b7b..925823a 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -257,7 +257,7 @@ PSWriter::PSWriter()
    , mpPS(NULL)
    , pMTF(NULL)
    , pAMTF(NULL)
    , aVDev()
    , pVDev()
    , nBoundingX1(0)
    , nBoundingY1(0)
    , nBoundingX2(0)
@@ -419,13 +419,13 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
        Bitmap aBmp( rGraphic.GetBitmap() );
        pAMTF = new GDIMetaFile();
        ScopedVclPtr<VirtualDevice> pTmpVDev(new VirtualDevice());
        pAMTF->Record( &aTmpVDev );
        pAMTF->Record( pTmpVDev );
        pTmpVDev->DrawBitmap( Point(), aBmp );
        pAMTF->Stop();
        pAMTF->SetPrefSize( aBmp.GetSizePixel() );
        pMTF = pAMTF;
    }
    aVDev.SetMapMode( pMTF->GetPrefMapMode() );
    pVDev->SetMapMode( pMTF->GetPrefMapMode() );
    nBoundingX1 = nBoundingY1 = 0;
    nBoundingX2 = pMTF->GetPrefSize().Width();
    nBoundingY2 = pMTF->GetPrefSize().Height();
@@ -454,7 +454,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
    {
        ImplWriteProlog( ( mnPreview & EPS_PREVIEW_EPSI ) ? &rGraphic : NULL );
        mnCursorPos = 0;
        ImplWriteActions( *pMTF, aVDev );
        ImplWriteActions( *pMTF, *pVDev.get() );
        ImplWriteEpilog();
        if ( mnPreview & EPS_PREVIEW_TIFF )
        {
@@ -1608,7 +1608,7 @@ void PSWriter::ImplIntersect( const tools::PolyPolygon& rPolyPoly )

void PSWriter::ImplWriteGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient, VirtualDevice& rVDev )
{
    ScopedVclPtr<VirtualDevice> l_pVirDev( new VirtualDevice() );
    ScopedVclPtr<VirtualDevice> l_pVDev( new VirtualDevice() );
    GDIMetaFile     aTmpMtf;
    l_pVDev->SetMapMode( rVDev.GetMapMode() );
    l_pVDev->AddGradientActions( rPolyPoly.GetBoundRect(), rGradient, aTmpMtf );
diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index acd073e..f9b48b8 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -80,7 +80,7 @@ CGM::~CGM()
        mpGDIMetaFile->Stop();
        mpGDIMetaFile->SetPrefMapMode( MapMode() );
        mpGDIMetaFile->SetPrefSize( Size( static_cast< long >( mnOutdx ), static_cast< long >( mnOutdy ) ) );
        delete mpVirDev;
        mpVirDev.disposeAndClear();
        *mpGraphic = Graphic( *mpGDIMetaFile );
    }
    for( size_t i = 0, n = maDefRepList.size(); i < n; ++i )
diff --git a/filter/source/graphicfilter/icgm/cgm.hxx b/filter/source/graphicfilter/icgm/cgm.hxx
index c03b891..c6c0fa6 100644
--- a/filter/source/graphicfilter/icgm/cgm.hxx
+++ b/filter/source/graphicfilter/icgm/cgm.hxx
@@ -138,7 +138,7 @@ class CGM
                            ~CGM();

                            CGM( sal_uInt32 nMode, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > const & rModel );
        VirtualDevice*      mpVirDev;
        VclPtr<VirtualDevice> mpVirDev;
        GDIMetaFile*        mpGDIMetaFile;
        sal_uInt32              GetBackGroundColor();
        bool                IsValid() const { return mbStatus; };
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index 8429940..2d2b86b 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -885,7 +885,7 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
            rMTF.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
    }

    delete pVirDev;
    pVirDev.disposeAndClear();
    return bStatus;
}

diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.hxx b/filter/source/graphicfilter/idxf/dxf2mtf.hxx
index 354cd09..a9eab71 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.hxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.hxx
@@ -34,7 +34,7 @@ enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT,
class DXF2GDIMetaFile {
private:

    VirtualDevice * pVirDev;
    VclPtr<VirtualDevice> pVirDev;
    const DXFRepresentation * pDXF;
    bool bStatus;

diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 4a77e38..9e8b894 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -345,7 +345,7 @@ private:
    long ErrorCode;

    SvStream      * pOS2MET;             // the OS2MET file to be read
    VirtualDevice * pVirDev;             // here the drawing methods are being called
    VclPtr<VirtualDevice> pVirDev;       // here the drawing methods are being called
                                         // While doing this a recording in the GDIMetaFile
                                         // will take place.
    sal_uLong       nOrigPos;            // initial position  in pOS2MET
@@ -2665,7 +2665,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
    }

    rGDIMetaFile.Stop();
    delete pVirDev;
    pVirDev.disposeAndClear();

    rGDIMetaFile.SetPrefMapMode( aGlobMapMode );

diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 9ab206f..a578272 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -146,7 +146,7 @@ class PictReader {
private:

    SvStream    * pPict;             // The Pict file to read.
    VirtualDevice * pVirDev;         // Here the drawing methos will be called.
    VclPtr<VirtualDevice> pVirDev;         // Here the drawing methos will be called.
                                     // A recording into the GDIMetaFile will take place.

    sal_uLong     nOrigPos;          // Initial position in pPict.
@@ -1942,7 +1942,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )

    pVirDev->SetClipRegion();
    rGDIMetaFile.Stop();
    delete pVirDev;
    pVirDev.disposeAndClear();

    rGDIMetaFile.SetPrefMapMode( MapMode( MAP_INCH, Point(), aHRes, aVRes ) );
    rGDIMetaFile.SetPrefSize( aBoundingRect.GetSize() );
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 44fe125..b003673 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1658,7 +1658,7 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport
SVGActionWriter::~SVGActionWriter()
{
    DBG_ASSERT( !mpContext, "Not all contexts are closed" );
    delete mpVDev;
    mpVDev.disposeAndClear();
}

long SVGActionWriter::ImplMap( sal_Int32 nVal ) const
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index a74ca30..2de237a 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -178,7 +178,7 @@ class SVGTextWriter
  private:
    SVGExport&                                  mrExport;
    SVGAttributeWriter*                         mpContext;
    VirtualDevice*                              mpVDev;
    VclPtr<VirtualDevice>                       mpVDev;
    bool                                    mbIsTextShapeStarted;
    Reference<XText>                            mrTextShape;
    OUString                             msShapeId;
@@ -303,7 +303,7 @@ private:
    SVGFontExport&                              mrFontExport;
    SVGAttributeWriter*                         mpContext;
    SVGTextWriter                               maTextWriter;
    VirtualDevice*                              mpVDev;
    VclPtr<VirtualDevice>                       mpVDev;
    MapMode                                     maTargetMapMode;
    sal_uInt32                                  mnInnerMtfCount;
    bool                                    mbClipAttrChanged;
diff --git a/reportdesign/source/ui/inc/ColorChanger.hxx b/reportdesign/source/ui/inc/ColorChanger.hxx
index 7a26c60..247863a 100644
--- a/reportdesign/source/ui/inc/ColorChanger.hxx
+++ b/reportdesign/source/ui/inc/ColorChanger.hxx
@@ -27,7 +27,7 @@ namespace rptui
    class ColorChanger
    {
    protected:
        OutputDevice*   m_pDev;
        VclPtr<OutputDevice> m_pDev;

    public:
        ColorChanger( OutputDevice* _pDev, const Color& _rNewLineColor)
diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx
index 1bd824b..c2135be 100644
--- a/uui/source/fltdlg.cxx
+++ b/uui/source/fltdlg.cxx
@@ -169,7 +169,7 @@ class StringCalculator : public ::cppu::WeakImplHelper1< ::com::sun::star::util:
{
    public:
        StringCalculator( const OutputDevice* pDevice )
            : m_pDevice( pDevice )
            : m_pDevice( const_cast< OutputDevice * >( pDevice ) )
        {
        }

@@ -179,7 +179,7 @@ class StringCalculator : public ::cppu::WeakImplHelper1< ::com::sun::star::util:
        }

    private:
        const OutputDevice* m_pDevice;
        VclPtr<OutputDevice> m_pDevice;
};

/*-************************************************************************************************************