summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_flatten.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-28 19:29:29 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-28 19:29:29 +0000
commit0e12ed7557f060539122d535dcfc717e8763b138 (patch)
tree95b6d6ef08e90e23e50eda8f4f903e43928f8d50 /fpdfsdk/fpdf_flatten.cpp
parent679de53b6be33601c99dfbdad6f8fb8a0c246dd9 (diff)
downloadpdfium-0e12ed7557f060539122d535dcfc717e8763b138.tar.xz
Remove CollectionSize from fpdf_flatten.
Bug: pdfium:774 Change-Id: Ie733da2852d2721ef8007aa55d32ffa9537efb70 Reviewed-on: https://pdfium-review.googlesource.com/19630 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_flatten.cpp')
-rw-r--r--fpdfsdk/fpdf_flatten.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 07fbd7cd9e..2850c37bfb 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -299,8 +299,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
pPageXObject = pRes->SetNewFor<CPDF_Dictionary>("XObject");
ByteString key;
- int nStreams = pdfium::CollectionSize<int>(ObjectArray);
- if (nStreams > 0) {
+ if (!ObjectArray.empty()) {
int i = 0;
while (i < INT_MAX) {
ByteString sKey = ByteString::Format("FFT%d", i);
@@ -326,7 +325,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
pNewOXbjectDic->SetRectFor("BBox", rcBBox);
}
- for (int i = 0; i < nStreams; i++) {
+ for (size_t i = 0; i < ObjectArray.size(); ++i) {
CPDF_Dictionary* pAnnotDic = ObjectArray[i];
if (!pAnnotDic)
continue;