diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-06-22 10:28:42 +0200 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2018-06-22 14:44:08 +0200 |
commit | 3d2b4942214f586f22640e84f6d48fee475521fb (patch) | |
tree | e357dffd04f9f8cfb1d8c36f73e1cd0252fc97cc /sd | |
parent | 204353d270b8df4659a2f854efc636955e9e2ef9 (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 62dbc3964f35..e157bef79de8 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); |