use std to impl this resource sharing

Change-Id: I41ea7bf672040089ccca5cf2bc449a0d0e78b903
Reviewed-on: https://gerrit.libreoffice.org/29219
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2016-09-23 11:27:02 +01:00
parent 04f50946de
commit 7adb5c683c
4 changed files with 74 additions and 103 deletions

View File

@@ -106,12 +106,12 @@ class VCL_DLLPUBLIC Graphic : public SvDataCopyStream
{ {
private: private:
ImpGraphic* mpImpGraphic; std::shared_ptr<ImpGraphic> mxImpGraphic;
public: public:
SAL_DLLPRIVATE void ImplTestRefCount(); SAL_DLLPRIVATE void ImplTestRefCount();
SAL_DLLPRIVATE ImpGraphic* ImplGetImpGraphic() const { return mpImpGraphic; } SAL_DLLPRIVATE ImpGraphic* ImplGetImpGraphic() const { return mxImpGraphic.get(); }
public: public:
Graphic(); Graphic();

View File

@@ -46,7 +46,6 @@ private:
std::unique_ptr<GfxLink> mpGfxLink; std::unique_ptr<GfxLink> mpGfxLink;
GraphicType meType; GraphicType meType;
mutable sal_uLong mnSizeBytes; mutable sal_uLong mnSizeBytes;
sal_uLong mnRefCount;
bool mbSwapOut; bool mbSwapOut;
bool mbSwapUnderway; bool mbSwapUnderway;
bool mbDummyContext; bool mbDummyContext;
@@ -62,7 +61,9 @@ private:
ImpGraphic(const SvgDataPtr& rSvgDataPtr); ImpGraphic(const SvgDataPtr& rSvgDataPtr);
ImpGraphic( const Animation& rAnimation ); ImpGraphic( const Animation& rAnimation );
ImpGraphic( const GDIMetaFile& rMtf ); ImpGraphic( const GDIMetaFile& rMtf );
public:
virtual ~ImpGraphic(); virtual ~ImpGraphic();
private:
ImpGraphic& operator=( const ImpGraphic& rImpGraphic ); ImpGraphic& operator=( const ImpGraphic& rImpGraphic );
bool operator==( const ImpGraphic& rImpGraphic ) const; bool operator==( const ImpGraphic& rImpGraphic ) const;

View File

@@ -179,45 +179,42 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
} }
Graphic::Graphic() Graphic::Graphic()
: mxImpGraphic(new ImpGraphic)
{ {
mpImpGraphic = new ImpGraphic;
} }
Graphic::Graphic( const Graphic& rGraphic ) : Graphic::Graphic( const Graphic& rGraphic ) :
SvDataCopyStream() SvDataCopyStream()
{ {
if( rGraphic.IsAnimated() ) if( rGraphic.IsAnimated() )
mpImpGraphic = new ImpGraphic( *rGraphic.mpImpGraphic ); mxImpGraphic.reset(new ImpGraphic(*rGraphic.mxImpGraphic));
else else
{ mxImpGraphic = rGraphic.mxImpGraphic;
mpImpGraphic = rGraphic.mpImpGraphic;
mpImpGraphic->mnRefCount++;
}
} }
Graphic::Graphic( const Bitmap& rBmp ) Graphic::Graphic(const Bitmap& rBmp)
: mxImpGraphic(new ImpGraphic(rBmp))
{ {
mpImpGraphic = new ImpGraphic( rBmp );
} }
Graphic::Graphic( const BitmapEx& rBmpEx ) Graphic::Graphic(const BitmapEx& rBmpEx)
: mxImpGraphic(new ImpGraphic(rBmpEx))
{ {
mpImpGraphic = new ImpGraphic( rBmpEx );
} }
Graphic::Graphic(const SvgDataPtr& rSvgDataPtr) Graphic::Graphic(const SvgDataPtr& rSvgDataPtr)
: mxImpGraphic(new ImpGraphic(rSvgDataPtr))
{ {
mpImpGraphic = new ImpGraphic(rSvgDataPtr);
} }
Graphic::Graphic( const Animation& rAnimation ) Graphic::Graphic(const Animation& rAnimation)
: mxImpGraphic(new ImpGraphic(rAnimation))
{ {
mpImpGraphic = new ImpGraphic( rAnimation );
} }
Graphic::Graphic( const GDIMetaFile& rMtf ) Graphic::Graphic(const GDIMetaFile& rMtf)
: mxImpGraphic(new ImpGraphic(rMtf))
{ {
mpImpGraphic = new ImpGraphic( rMtf );
} }
Graphic::Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic ) Graphic::Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic )
@@ -229,32 +226,24 @@ Graphic::Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic
if( pGraphic ) if( pGraphic )
{ {
if( pGraphic->IsAnimated() ) if (pGraphic->IsAnimated())
mpImpGraphic = new ImpGraphic( *pGraphic->mpImpGraphic ); mxImpGraphic.reset(new ImpGraphic(*pGraphic->mxImpGraphic));
else else
{ mxImpGraphic = pGraphic->mxImpGraphic;
mpImpGraphic = pGraphic->mpImpGraphic;
mpImpGraphic->mnRefCount++;
}
} }
else else
mpImpGraphic = new ImpGraphic; mxImpGraphic.reset(new ImpGraphic);
} }
Graphic::~Graphic() Graphic::~Graphic()
{ {
if( mpImpGraphic->mnRefCount == 1UL )
delete mpImpGraphic;
else
mpImpGraphic->mnRefCount--;
} }
void Graphic::ImplTestRefCount() void Graphic::ImplTestRefCount()
{ {
if( mpImpGraphic->mnRefCount > 1UL ) if (!mxImpGraphic.unique())
{ {
mpImpGraphic->mnRefCount--; mxImpGraphic.reset(new ImpGraphic(*mxImpGraphic));
mpImpGraphic = new ImpGraphic( *mpImpGraphic );
} }
} }
@@ -264,23 +253,11 @@ Graphic& Graphic::operator=( const Graphic& rGraphic )
{ {
if( rGraphic.IsAnimated() ) if( rGraphic.IsAnimated() )
{ {
if( mpImpGraphic->mnRefCount == 1UL ) mxImpGraphic.reset(new ImpGraphic(*rGraphic.mxImpGraphic));
delete mpImpGraphic;
else
mpImpGraphic->mnRefCount--;
mpImpGraphic = new ImpGraphic( *rGraphic.mpImpGraphic );
} }
else else
{ {
rGraphic.mpImpGraphic->mnRefCount++; mxImpGraphic = rGraphic.mxImpGraphic;
if( mpImpGraphic->mnRefCount == 1UL )
delete mpImpGraphic;
else
mpImpGraphic->mnRefCount--;
mpImpGraphic = rGraphic.mpImpGraphic;
} }
} }
@@ -289,79 +266,79 @@ Graphic& Graphic::operator=( const Graphic& rGraphic )
bool Graphic::operator==( const Graphic& rGraphic ) const bool Graphic::operator==( const Graphic& rGraphic ) const
{ {
return( *mpImpGraphic == *rGraphic.mpImpGraphic ); return (*mxImpGraphic == *rGraphic.mxImpGraphic);
} }
bool Graphic::operator!=( const Graphic& rGraphic ) const bool Graphic::operator!=( const Graphic& rGraphic ) const
{ {
return( *mpImpGraphic != *rGraphic.mpImpGraphic ); return (*mxImpGraphic != *rGraphic.mxImpGraphic);
} }
bool Graphic::operator!() const bool Graphic::operator!() const
{ {
return( GraphicType::NONE == mpImpGraphic->ImplGetType() ); return (GraphicType::NONE == mxImpGraphic->ImplGetType());
} }
void Graphic::Clear() void Graphic::Clear()
{ {
ImplTestRefCount(); ImplTestRefCount();
mpImpGraphic->ImplClear(); mxImpGraphic->ImplClear();
} }
GraphicType Graphic::GetType() const GraphicType Graphic::GetType() const
{ {
return mpImpGraphic->ImplGetType(); return mxImpGraphic->ImplGetType();
} }
void Graphic::SetDefaultType() void Graphic::SetDefaultType()
{ {
ImplTestRefCount(); ImplTestRefCount();
mpImpGraphic->ImplSetDefaultType(); mxImpGraphic->ImplSetDefaultType();
} }
bool Graphic::IsSupportedGraphic() const bool Graphic::IsSupportedGraphic() const
{ {
return mpImpGraphic->ImplIsSupportedGraphic(); return mxImpGraphic->ImplIsSupportedGraphic();
} }
bool Graphic::IsTransparent() const bool Graphic::IsTransparent() const
{ {
return mpImpGraphic->ImplIsTransparent(); return mxImpGraphic->ImplIsTransparent();
} }
bool Graphic::IsAlpha() const bool Graphic::IsAlpha() const
{ {
return mpImpGraphic->ImplIsAlpha(); return mxImpGraphic->ImplIsAlpha();
} }
bool Graphic::IsAnimated() const bool Graphic::IsAnimated() const
{ {
return mpImpGraphic->ImplIsAnimated(); return mxImpGraphic->ImplIsAnimated();
} }
bool Graphic::IsEPS() const bool Graphic::IsEPS() const
{ {
return mpImpGraphic->ImplIsEPS(); return mxImpGraphic->ImplIsEPS();
} }
Bitmap Graphic::GetBitmap(const GraphicConversionParameters& rParameters) const Bitmap Graphic::GetBitmap(const GraphicConversionParameters& rParameters) const
{ {
return mpImpGraphic->ImplGetBitmap(rParameters); return mxImpGraphic->ImplGetBitmap(rParameters);
} }
BitmapEx Graphic::GetBitmapEx(const GraphicConversionParameters& rParameters) const BitmapEx Graphic::GetBitmapEx(const GraphicConversionParameters& rParameters) const
{ {
return mpImpGraphic->ImplGetBitmapEx(rParameters); return mxImpGraphic->ImplGetBitmapEx(rParameters);
} }
Animation Graphic::GetAnimation() const Animation Graphic::GetAnimation() const
{ {
return mpImpGraphic->ImplGetAnimation(); return mxImpGraphic->ImplGetAnimation();
} }
const GDIMetaFile& Graphic::GetGDIMetaFile() const const GDIMetaFile& Graphic::GetGDIMetaFile() const
{ {
return mpImpGraphic->ImplGetGDIMetaFile(); return mxImpGraphic->ImplGetGDIMetaFile();
} }
uno::Reference< graphic::XGraphic > Graphic::GetXGraphic() const uno::Reference< graphic::XGraphic > Graphic::GetXGraphic() const
@@ -387,24 +364,24 @@ uno::Reference< graphic::XGraphic > Graphic::GetXGraphic() const
Size Graphic::GetPrefSize() const Size Graphic::GetPrefSize() const
{ {
return mpImpGraphic->ImplGetPrefSize(); return mxImpGraphic->ImplGetPrefSize();
} }
void Graphic::SetPrefSize( const Size& rPrefSize ) void Graphic::SetPrefSize( const Size& rPrefSize )
{ {
ImplTestRefCount(); ImplTestRefCount();
mpImpGraphic->ImplSetPrefSize( rPrefSize ); mxImpGraphic->ImplSetPrefSize( rPrefSize );
} }
MapMode Graphic::GetPrefMapMode() const MapMode Graphic::GetPrefMapMode() const
{ {
return mpImpGraphic->ImplGetPrefMapMode(); return mxImpGraphic->ImplGetPrefMapMode();
} }
void Graphic::SetPrefMapMode( const MapMode& rPrefMapMode ) void Graphic::SetPrefMapMode( const MapMode& rPrefMapMode )
{ {
ImplTestRefCount(); ImplTestRefCount();
mpImpGraphic->ImplSetPrefMapMode( rPrefMapMode ); mxImpGraphic->ImplSetPrefMapMode( rPrefMapMode );
} }
basegfx::B2DSize Graphic::GetPPI() const basegfx::B2DSize Graphic::GetPPI() const
@@ -433,8 +410,8 @@ Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
{ {
Size aRet; Size aRet;
if( GraphicType::Bitmap == mpImpGraphic->ImplGetType() ) if( GraphicType::Bitmap == mxImpGraphic->ImplGetType() )
aRet = mpImpGraphic->ImplGetBitmapEx(GraphicConversionParameters()).GetSizePixel(); aRet = mxImpGraphic->ImplGetBitmapEx(GraphicConversionParameters()).GetSizePixel();
else else
aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() ); aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() );
@@ -443,21 +420,21 @@ Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
sal_uLong Graphic::GetSizeBytes() const sal_uLong Graphic::GetSizeBytes() const
{ {
return mpImpGraphic->ImplGetSizeBytes(); return mxImpGraphic->ImplGetSizeBytes();
} }
void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const
{ {
mpImpGraphic->ImplDraw( pOutDev, rDestPt ); mxImpGraphic->ImplDraw( pOutDev, rDestPt );
} }
void Graphic::Draw( OutputDevice* pOutDev, void Graphic::Draw( OutputDevice* pOutDev,
const Point& rDestPt, const Size& rDestSz ) const const Point& rDestPt, const Size& rDestSz ) const
{ {
if( GraphicType::Default == mpImpGraphic->ImplGetType() ) if( GraphicType::Default == mxImpGraphic->ImplGetType() )
ImplDrawDefault( pOutDev, nullptr, nullptr, nullptr, nullptr, rDestPt, rDestSz ); ImplDrawDefault( pOutDev, nullptr, nullptr, nullptr, nullptr, rDestPt, rDestSz );
else else
mpImpGraphic->ImplDraw( pOutDev, rDestPt, rDestSz ); mxImpGraphic->ImplDraw( pOutDev, rDestPt, rDestSz );
} }
void Graphic::DrawEx( OutputDevice* pOutDev, const OUString& rText, void Graphic::DrawEx( OutputDevice* pOutDev, const OUString& rText,
@@ -472,136 +449,136 @@ void Graphic::StartAnimation( OutputDevice* pOutDev, const Point& rDestPt,
OutputDevice* pFirstFrameOutDev ) OutputDevice* pFirstFrameOutDev )
{ {
ImplTestRefCount(); ImplTestRefCount();
mpImpGraphic->ImplStartAnimation( pOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev ); mxImpGraphic->ImplStartAnimation( pOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev );
} }
void Graphic::StopAnimation( OutputDevice* pOutDev, long nExtraData ) void Graphic::StopAnimation( OutputDevice* pOutDev, long nExtraData )
{ {
ImplTestRefCount(); ImplTestRefCount();
mpImpGraphic->ImplStopAnimation( pOutDev, nExtraData ); mxImpGraphic->ImplStopAnimation( pOutDev, nExtraData );
} }
void Graphic::SetAnimationNotifyHdl( const Link<Animation*,void>& rLink ) void Graphic::SetAnimationNotifyHdl( const Link<Animation*,void>& rLink )
{ {
mpImpGraphic->ImplSetAnimationNotifyHdl( rLink ); mxImpGraphic->ImplSetAnimationNotifyHdl( rLink );
} }
Link<Animation*,void> Graphic::GetAnimationNotifyHdl() const Link<Animation*,void> Graphic::GetAnimationNotifyHdl() const
{ {
return mpImpGraphic->ImplGetAnimationNotifyHdl(); return mxImpGraphic->ImplGetAnimationNotifyHdl();
} }
sal_uLong Graphic::GetAnimationLoopCount() const sal_uLong Graphic::GetAnimationLoopCount() const
{ {
return mpImpGraphic->ImplGetAnimationLoopCount(); return mxImpGraphic->ImplGetAnimationLoopCount();
} }
std::shared_ptr<GraphicReader>& Graphic::GetContext() std::shared_ptr<GraphicReader>& Graphic::GetContext()
{ {
return mpImpGraphic->ImplGetContext(); return mxImpGraphic->ImplGetContext();
} }
void Graphic::SetContext( const std::shared_ptr<GraphicReader> &pReader ) void Graphic::SetContext( const std::shared_ptr<GraphicReader> &pReader )
{ {
mpImpGraphic->ImplSetContext( pReader ); mxImpGraphic->ImplSetContext( pReader );
} }
void Graphic::SetDummyContext( bool value ) void Graphic::SetDummyContext( bool value )
{ {
mpImpGraphic->ImplSetDummyContext( value ); mxImpGraphic->ImplSetDummyContext( value );
} }
bool Graphic::IsDummyContext() bool Graphic::IsDummyContext()
{ {
return mpImpGraphic->ImplIsDummyContext(); return mxImpGraphic->ImplIsDummyContext();
} }
bool Graphic::SwapOut() bool Graphic::SwapOut()
{ {
ImplTestRefCount(); ImplTestRefCount();
return mpImpGraphic->ImplSwapOut(); return mxImpGraphic->ImplSwapOut();
} }
void Graphic::SwapOutAsLink() void Graphic::SwapOutAsLink()
{ {
ImplTestRefCount(); ImplTestRefCount();
mpImpGraphic->ImplSwapOutAsLink(); mxImpGraphic->ImplSwapOutAsLink();
} }
bool Graphic::SwapOut( SvStream* pOStream ) bool Graphic::SwapOut( SvStream* pOStream )
{ {
ImplTestRefCount(); ImplTestRefCount();
return mpImpGraphic->ImplSwapOut( pOStream ); return mxImpGraphic->ImplSwapOut( pOStream );
} }
bool Graphic::SwapIn() bool Graphic::SwapIn()
{ {
ImplTestRefCount(); ImplTestRefCount();
return mpImpGraphic->ImplSwapIn(); return mxImpGraphic->ImplSwapIn();
} }
bool Graphic::SwapIn( SvStream* pStrm ) bool Graphic::SwapIn( SvStream* pStrm )
{ {
ImplTestRefCount(); ImplTestRefCount();
return mpImpGraphic->ImplSwapIn( pStrm ); return mxImpGraphic->ImplSwapIn( pStrm );
} }
bool Graphic::IsSwapOut() const bool Graphic::IsSwapOut() const
{ {
return mpImpGraphic->ImplIsSwapOut(); return mxImpGraphic->ImplIsSwapOut();
} }
void Graphic::SetLink( const GfxLink& rGfxLink ) void Graphic::SetLink( const GfxLink& rGfxLink )
{ {
ImplTestRefCount(); ImplTestRefCount();
mpImpGraphic->ImplSetLink( rGfxLink ); mxImpGraphic->ImplSetLink( rGfxLink );
} }
GfxLink Graphic::GetLink() const GfxLink Graphic::GetLink() const
{ {
return mpImpGraphic->ImplGetLink(); return mxImpGraphic->ImplGetLink();
} }
bool Graphic::IsLink() const bool Graphic::IsLink() const
{ {
return mpImpGraphic->ImplIsLink(); return mxImpGraphic->ImplIsLink();
} }
BitmapChecksum Graphic::GetChecksum() const BitmapChecksum Graphic::GetChecksum() const
{ {
return mpImpGraphic->ImplGetChecksum(); return mxImpGraphic->ImplGetChecksum();
} }
bool Graphic::ExportNative( SvStream& rOStream ) const bool Graphic::ExportNative( SvStream& rOStream ) const
{ {
return mpImpGraphic->ImplExportNative( rOStream ); return mxImpGraphic->ImplExportNative( rOStream );
} }
SvStream& ReadGraphic( SvStream& rIStream, Graphic& rGraphic ) SvStream& ReadGraphic( SvStream& rIStream, Graphic& rGraphic )
{ {
rGraphic.ImplTestRefCount(); rGraphic.ImplTestRefCount();
return ReadImpGraphic( rIStream, *rGraphic.mpImpGraphic ); return ReadImpGraphic(rIStream, *rGraphic.mxImpGraphic);
} }
SvStream& WriteGraphic( SvStream& rOStream, const Graphic& rGraphic ) SvStream& WriteGraphic( SvStream& rOStream, const Graphic& rGraphic )
{ {
return WriteImpGraphic( rOStream, *rGraphic.mpImpGraphic ); return WriteImpGraphic(rOStream, *rGraphic.mxImpGraphic);
} }
const SvgDataPtr& Graphic::getSvgData() const const SvgDataPtr& Graphic::getSvgData() const
{ {
return mpImpGraphic->getSvgData(); return mxImpGraphic->getSvgData();
} }
void Graphic::setPdfData(const uno::Sequence<sal_Int8>& rPdfData) void Graphic::setPdfData(const uno::Sequence<sal_Int8>& rPdfData)
{ {
ImplTestRefCount(); ImplTestRefCount();
mpImpGraphic->maPdfData = rPdfData; mxImpGraphic->maPdfData = rPdfData;
} }
const uno::Sequence<sal_Int8>& Graphic::getPdfData() const const uno::Sequence<sal_Int8>& Graphic::getPdfData() const
{ {
return mpImpGraphic->maPdfData; return mxImpGraphic->maPdfData;
} }
namespace { namespace {

View File

@@ -97,7 +97,6 @@ Size GraphicReader::GetPreviewSize() const
ImpGraphic::ImpGraphic() : ImpGraphic::ImpGraphic() :
meType ( GraphicType::NONE ), meType ( GraphicType::NONE ),
mnSizeBytes ( 0UL ), mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ), mbSwapOut ( false ),
mbSwapUnderway ( false ), mbSwapUnderway ( false ),
mbDummyContext ( false ) mbDummyContext ( false )
@@ -110,7 +109,6 @@ ImpGraphic::ImpGraphic( const ImpGraphic& rImpGraphic ) :
mpSwapFile ( rImpGraphic.mpSwapFile ), mpSwapFile ( rImpGraphic.mpSwapFile ),
meType ( rImpGraphic.meType ), meType ( rImpGraphic.meType ),
mnSizeBytes ( rImpGraphic.mnSizeBytes ), mnSizeBytes ( rImpGraphic.mnSizeBytes ),
mnRefCount ( 1UL ),
mbSwapOut ( rImpGraphic.mbSwapOut ), mbSwapOut ( rImpGraphic.mbSwapOut ),
mbSwapUnderway ( false ), mbSwapUnderway ( false ),
mbDummyContext ( rImpGraphic.mbDummyContext ) mbDummyContext ( rImpGraphic.mbDummyContext )
@@ -132,7 +130,6 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
maEx ( rBitmap ), maEx ( rBitmap ),
meType ( !rBitmap.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ), meType ( !rBitmap.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ),
mnSizeBytes ( 0UL ), mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ), mbSwapOut ( false ),
mbSwapUnderway ( false ), mbSwapUnderway ( false ),
mbDummyContext ( false ) mbDummyContext ( false )
@@ -143,7 +140,6 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) :
maEx ( rBitmapEx ), maEx ( rBitmapEx ),
meType ( !rBitmapEx.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ), meType ( !rBitmapEx.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ),
mnSizeBytes ( 0UL ), mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ), mbSwapOut ( false ),
mbSwapUnderway ( false ), mbSwapUnderway ( false ),
mbDummyContext ( false ) mbDummyContext ( false )
@@ -153,7 +149,6 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) :
ImpGraphic::ImpGraphic(const SvgDataPtr& rSvgDataPtr) ImpGraphic::ImpGraphic(const SvgDataPtr& rSvgDataPtr)
: meType( rSvgDataPtr.get() ? GraphicType::Bitmap : GraphicType::NONE ), : meType( rSvgDataPtr.get() ? GraphicType::Bitmap : GraphicType::NONE ),
mnSizeBytes( 0UL ), mnSizeBytes( 0UL ),
mnRefCount( 1UL ),
mbSwapOut( false ), mbSwapOut( false ),
mbSwapUnderway( false ), mbSwapUnderway( false ),
mbDummyContext ( false ), mbDummyContext ( false ),
@@ -166,7 +161,6 @@ ImpGraphic::ImpGraphic( const Animation& rAnimation ) :
mpAnimation ( o3tl::make_unique<Animation>( rAnimation ) ), mpAnimation ( o3tl::make_unique<Animation>( rAnimation ) ),
meType ( GraphicType::Bitmap ), meType ( GraphicType::Bitmap ),
mnSizeBytes ( 0UL ), mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ), mbSwapOut ( false ),
mbSwapUnderway ( false ), mbSwapUnderway ( false ),
mbDummyContext ( false ) mbDummyContext ( false )
@@ -177,7 +171,6 @@ ImpGraphic::ImpGraphic( const GDIMetaFile& rMtf ) :
maMetaFile ( rMtf ), maMetaFile ( rMtf ),
meType ( GraphicType::GdiMetafile ), meType ( GraphicType::GdiMetafile ),
mnSizeBytes ( 0UL ), mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ), mbSwapOut ( false ),
mbSwapUnderway ( false ), mbSwapUnderway ( false ),
mbDummyContext ( false ) mbDummyContext ( false )