diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-04-02 20:34:11 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-06-07 10:45:19 +0200 |
commit | eb02d79c19405a39aac0af472116a1b99beb2cc6 (patch) | |
tree | 1e73deb831a97a997c85a2fde3d7a1499f9250f5 /vcl/source | |
parent | 455878f78ef6322f8b7832ddd22b4f64a05d3756 (diff) |
vcl: svx: preserve the imported PDF page number in Graphic
Change-Id: I1bb3fa7d44d5f92df2bb8c4ed4b85ccd984c2617
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/filter/ipdf/pdfread.cxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 24 |
2 files changed, 19 insertions, 6 deletions
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index 092be448b608..4d272720fdcf 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -239,6 +239,7 @@ bool ImportPDF(SvStream& rStream, Graphic& rGraphic) const bool bRet = ImportPDF(rStream, aBitmap, aPdfData); rGraphic = aBitmap; rGraphic.setPdfData(std::make_shared<css::uno::Sequence<sal_Int8>>(aPdfData)); + rGraphic.setPageNumber(0); // We currently import only the first page. return bRet; } diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 5a063dc7c93f..0ad7dcb59b3f 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -180,7 +180,8 @@ ImpGraphic::ImpGraphic() : mbSwapOut ( false ), mbDummyContext ( false ), maLastUsed (std::chrono::high_resolution_clock::now()), - mbPrepared ( false ) + mbPrepared ( false ), + mnPageNumber(-1) { } @@ -194,6 +195,7 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic) , mnSizeBytes(rImpGraphic.mnSizeBytes) , mbSwapOut(rImpGraphic.mbSwapOut) , mbDummyContext(rImpGraphic.mbDummyContext) + , mnPageNumber(-1) , maVectorGraphicData(rImpGraphic.maVectorGraphicData) , mpPdfData(rImpGraphic.mpPdfData) , maGraphicExternalLink(rImpGraphic.maGraphicExternalLink) @@ -222,6 +224,7 @@ ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic) , mnSizeBytes(rImpGraphic.mnSizeBytes) , mbSwapOut(rImpGraphic.mbSwapOut) , mbDummyContext(rImpGraphic.mbDummyContext) + , mnPageNumber(-1) , maVectorGraphicData(std::move(rImpGraphic.maVectorGraphicData)) , mpPdfData(std::move(rImpGraphic.mpPdfData)) , maGraphicExternalLink(rImpGraphic.maGraphicExternalLink) @@ -250,7 +253,8 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) : mbSwapOut ( false ), mbDummyContext ( false ), maLastUsed (std::chrono::high_resolution_clock::now()), - mbPrepared (false) + mbPrepared (false), + mnPageNumber(-1) { } @@ -261,7 +265,8 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) : mbSwapOut ( false ), mbDummyContext ( false ), maLastUsed (std::chrono::high_resolution_clock::now()), - mbPrepared (false) + mbPrepared (false), + mnPageNumber(-1) { } @@ -272,7 +277,8 @@ ImpGraphic::ImpGraphic(const VectorGraphicDataPtr& rVectorGraphicDataPtr) mbDummyContext ( false ), maVectorGraphicData(rVectorGraphicDataPtr), maLastUsed (std::chrono::high_resolution_clock::now()), - mbPrepared (false) + mbPrepared (false), + mnPageNumber(-1) { } @@ -284,7 +290,8 @@ ImpGraphic::ImpGraphic( const Animation& rAnimation ) : mbSwapOut ( false ), mbDummyContext ( false ), maLastUsed (std::chrono::high_resolution_clock::now()), - mbPrepared (false) + mbPrepared (false), + mnPageNumber(-1) { } @@ -295,7 +302,8 @@ ImpGraphic::ImpGraphic( const GDIMetaFile& rMtf ) : mbSwapOut ( false ), mbDummyContext ( false ), maLastUsed (std::chrono::high_resolution_clock::now()), - mbPrepared (false) + mbPrepared (false), + mnPageNumber(-1) { } @@ -317,6 +325,7 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic ) maSwapInfo = rImpGraphic.maSwapInfo; mpContext = rImpGraphic.mpContext; mbDummyContext = rImpGraphic.mbDummyContext; + mnPageNumber = rImpGraphic.mnPageNumber; maGraphicExternalLink = rImpGraphic.maGraphicExternalLink; mpAnimation.reset(); @@ -360,6 +369,7 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& rImpGraphic) maSwapInfo = std::move(rImpGraphic.maSwapInfo); mpContext = std::move(rImpGraphic.mpContext); mbDummyContext = rImpGraphic.mbDummyContext; + mnPageNumber = rImpGraphic.mnPageNumber; mpAnimation = std::move(rImpGraphic.mpAnimation); maEx = std::move(rImpGraphic.maEx); mbSwapOut = rImpGraphic.mbSwapOut; @@ -376,6 +386,8 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& rImpGraphic) vcl::graphic::Manager::get().changeExisting(this, aOldSizeBytes); + rImpGraphic.mnPageNumber = -1; + return *this; } |