diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-06-22 12:58:12 +0200 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2019-08-25 13:34:17 +0200 |
commit | 81f73f1c1706d790c010e8fc0abcb2a0e9e86ace (patch) | |
tree | e6c1e22b6168d05777cf8429f0664c6335304f63 /sd | |
parent | 7fc0ddd9b725e3ea955bb06ef82f6a99de706210 (diff) |
pdfium: Delay the swap out.
If we swap out too early, the constructor of GraphicObject forces a swap
in, so we'd render everything during the load anyway.
Change-Id: I0ea1a755242fd57ef28d082ce4bf534a32199f87
Reviewed-on: https://gerrit.libreoffice.org/56286
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 242c7663e275a712430a8c4ac8eeacbb8b3bd440)
Reviewed-on: https://gerrit.libreoffice.org/77690
Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/pdf/sdpdffilter.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index cbd83075338d..88986fe0e477 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -86,8 +86,14 @@ bool SdPdfFilter::Import() pPage->SetSize(aGrfSize); Point aPos(0, 0); - pPage->InsertObject(new SdrGrafObj(pPage->getSdrModelFromSdrPage(), rGraphic, - tools::Rectangle(aPos, aGrfSize))); + SdrGrafObj* pSdrGrafObj = new SdrGrafObj(pPage->getSdrModelFromSdrPage(), rGraphic, + tools::Rectangle(aPos, aGrfSize)); + pPage->InsertObject(pSdrGrafObj); + + // we know that the initial bitmap we provided was just a placeholder, + // we need to swap it out, so that on the next swap in, we render the + // correct one + // const_cast<GraphicObject&>(pSdrGrafObj->GetGraphicObject()).SwapOut(); } return true; |