diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-06-22 10:28:42 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-04-03 17:54:01 +0200 |
commit | 335113741b2f4672a7813d8e6410dc5ec1b45527 (patch) | |
tree | 73a6ddbcd1a836e551c18464b3471aef5b61daf2 /sd | |
parent | 5a1f367b5573293cf3b2e8dbdffc7de22e99c058 (diff) |
pdfium: Avoid unnecessary copying + some warning fixes.
Change-Id: I114fa6b2d3dda86c55eb245d31ca3a1019197ae9
Reviewed-on: https://gerrit.libreoffice.org/56285
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/pdf/sdpdffilter.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index 3ef639853184..d78ccaa328b0 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -108,7 +108,7 @@ bool SdPdfFilter::Import() // Add as many pages as we need up-front. mrDocument.CreateFirstPages(); - for (int i = 0; i < aGraphics.size() - 1; ++i) + for (size_t i = 0; i < aGraphics.size() - 1; ++i) { mrDocument.DuplicatePage(0); } @@ -119,8 +119,7 @@ bool SdPdfFilter::Import() const Size& aSize = aPair.second; const sal_Int32 nPageNumber = aGraphic.getPageNumber(); - if (nPageNumber < 0 || nPageNumber >= aGraphics.size()) - continue; // Page is out of range + assert(nPageNumber >= 0 && nPageNumber < static_cast<sal_Int32>(aGraphics.size())); // Create the page and insert the Graphic. SdPage* pPage = mrDocument.GetSdPage(nPageNumber, PageKind::Standard); |