summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/impgraph.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/impgraph.cxx')
-rw-r--r--vcl/source/gdi/impgraph.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 2d73357ec43d..8027d0d85b1d 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -115,7 +115,6 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
, maSwapInfo(rImpGraphic.maSwapInfo)
, mpContext(rImpGraphic.mpContext)
, mpSwapFile(rImpGraphic.mpSwapFile)
- , mpGfxLink(rImpGraphic.mpGfxLink)
, meType(rImpGraphic.meType)
, mnSizeBytes(rImpGraphic.mnSizeBytes)
, mbSwapOut(rImpGraphic.mbSwapOut)
@@ -125,6 +124,9 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
, maGraphicExternalLink(rImpGraphic.maGraphicExternalLink)
, mnPageNumber(rImpGraphic.mnPageNumber)
{
+ if( rImpGraphic.mpGfxLink )
+ mpGfxLink = o3tl::make_unique<GfxLink>( *rImpGraphic.mpGfxLink );
+
if( rImpGraphic.mpAnimation )
{
mpAnimation = o3tl::make_unique<Animation>( *rImpGraphic.mpAnimation );
@@ -237,7 +239,10 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic )
mbSwapOut = rImpGraphic.mbSwapOut;
mpSwapFile = rImpGraphic.mpSwapFile;
- mpGfxLink = rImpGraphic.mpGfxLink;
+ mpGfxLink.reset();
+
+ if( rImpGraphic.mpGfxLink )
+ mpGfxLink = o3tl::make_unique<GfxLink>( *rImpGraphic.mpGfxLink );
maVectorGraphicData = rImpGraphic.maVectorGraphicData;
mpPdfData = rImpGraphic.mpPdfData;
@@ -1365,11 +1370,11 @@ bool ImpGraphic::ImplSwapIn( SvStream* xIStm )
return bRet;
}
-void ImpGraphic::ImplSetLink(const GfxLink& rGfxLink)
+void ImpGraphic::ImplSetLink( const GfxLink& rGfxLink )
{
- mpGfxLink = rGfxLink;
+ mpGfxLink = o3tl::make_unique<GfxLink>( rGfxLink );
- if (mpGfxLink && mpGfxLink->IsNative())
+ if( mpGfxLink->IsNative() )
mpGfxLink->SwapOut();
}
@@ -1484,7 +1489,7 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic )
// set dummy link to avoid creation of additional link after filtering;
// we set a default link to avoid unnecessary swapping of native data
- aGraphic.SetLink(GfxLink());
+ aGraphic.SetLink( GfxLink() );
if( !rIStm.GetError() && aLink.LoadNative( aGraphic ) )
{
@@ -1501,7 +1506,7 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic )
rImpGraphic.ImplSetPrefSize( aLink.GetPrefSize() );
if( bSetLink )
- rImpGraphic.ImplSetLink(aLink);
+ rImpGraphic.ImplSetLink( aLink );
}
else
{