summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-03-28 09:07:05 +0100
committerJan Holesovsky <kendy@collabora.com>2019-03-28 09:07:05 +0100
commita0ac37b9bc45c6016336447ab2ff5a5a251d5bdc (patch)
tree849c13579dcb34ffa6a0a28b47ab3ba9c7c30ac1
parentf1552a8bb74a5eb07ad7e675a50f60dec935b9e3 (diff)
Revert "pdfium: Share the GfxLink for PDF files."
-rw-r--r--include/vcl/graph.hxx1
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx2
-rw-r--r--vcl/inc/impgraph.hxx3
-rw-r--r--vcl/source/gdi/graph.cxx6
-rw-r--r--vcl/source/gdi/impgraph.cxx31
5 files changed, 5 insertions, 38 deletions
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index 881abda221e4..45268462155a 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -216,7 +216,6 @@ private:
public:
void SetLink( const GfxLink& );
- void SetSharedLink(const std::shared_ptr<GfxLink>& pGfxLink);
GfxLink GetLink() const;
bool IsLink() const;
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index 95daaeb479f1..a4747456123b 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -128,7 +128,7 @@ bool SdPdfFilter::Import()
Graphic aGraphic(aBitmap);
aGraphic.setPdfData(pPdfData);
aGraphic.setPageNumber(nPageNumber);
- aGraphic.SetSharedLink(pGfxLink);
+ aGraphic.SetLink(aGfxLink);
aGraphic.setOriginURL(aFileName);
// Create the page and insert the Graphic.
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 3d998ec94ac5..c462dc2c67ac 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -160,8 +160,7 @@ private:
bool ImplIsSwapOut() const { return mbSwapOut;}
bool ImplIsDummyContext() const { return mbDummyContext; }
- void ImplSetLink( const GfxLink& );
- void ImplSetSharedLink(const std::shared_ptr<GfxLink>& pGfxLink);
+ void ImplSetLink( const std::shared_ptr<GfxLink>& );
GfxLink ImplGetLink();
bool ImplIsLink() const;
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 04e567e44d5d..1fc7897ac90b 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -569,12 +569,6 @@ void Graphic::SetLink( const GfxLink& rGfxLink )
mxImpGraphic->ImplSetLink( rGfxLink );
}
-void Graphic::SetSharedLink(const std::shared_ptr<GfxLink>& pGfxLink)
-{
- ImplTestRefCount();
- mxImpGraphic->ImplSetSharedLink(pGfxLink);
-}
-
GfxLink Graphic::GetLink() const
{
return mxImpGraphic->ImplGetLink();
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 6e837c979e78..2d73357ec43d 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -125,14 +125,6 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
, maGraphicExternalLink(rImpGraphic.maGraphicExternalLink)
, mnPageNumber(rImpGraphic.mnPageNumber)
{
- if( rImpGraphic.mpGfxLink )
- {
- if (rImpGraphic.mpGfxLink->GetType() == GfxLinkType::NativePdf)
- mpGfxLink = rImpGraphic.mpGfxLink;
- else
- mpGfxLink = std::make_shared<GfxLink>(*rImpGraphic.mpGfxLink);
- }
-
if( rImpGraphic.mpAnimation )
{
mpAnimation = o3tl::make_unique<Animation>( *rImpGraphic.mpAnimation );
@@ -245,18 +237,9 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic )
mbSwapOut = rImpGraphic.mbSwapOut;
mpSwapFile = rImpGraphic.mpSwapFile;
- if (rImpGraphic.mpGfxLink)
- {
- if (rImpGraphic.mpGfxLink->GetType() == GfxLinkType::NativePdf)
- mpGfxLink = rImpGraphic.mpGfxLink;
- else
- {
- mpGfxLink.reset();
-
- mpGfxLink = std::make_shared<GfxLink>(*rImpGraphic.mpGfxLink);
- }
- }
+ mpGfxLink = rImpGraphic.mpGfxLink;
+ maVectorGraphicData = rImpGraphic.maVectorGraphicData;
mpPdfData = rImpGraphic.mpPdfData;
}
@@ -1384,15 +1367,7 @@ bool ImpGraphic::ImplSwapIn( SvStream* xIStm )
void ImpGraphic::ImplSetLink(const GfxLink& rGfxLink)
{
- mpGfxLink = std::make_shared<GfxLink>( rGfxLink );
-
- if( mpGfxLink->IsNative() )
- mpGfxLink->SwapOut();
-}
-
-void ImpGraphic::ImplSetSharedLink(const std::shared_ptr<GfxLink>& pGfxLink)
-{
- mpGfxLink = pGfxLink;
+ mpGfxLink = rGfxLink;
if (mpGfxLink && mpGfxLink->IsNative())
mpGfxLink->SwapOut();