From 3071871519db375e22950fad02b87aed43963efc Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 27 Nov 2017 18:45:56 +0000 Subject: Remove CollectionSize from CPDF_RenderStatus Bug: pdfium:774 Change-Id: I4996f5526884c33d92df964045bd5467c392df5e Reviewed-on: https://pdfium-review.googlesource.com/19490 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- core/fpdfapi/render/cpdf_renderstatus.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'core/fpdfapi/render') diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index e70e813cb4..b7b37edc4b 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -59,7 +59,6 @@ #include "third_party/base/logging.h" #include "third_party/base/numerics/safe_math.h" #include "third_party/base/ptr_util.h" -#include "third_party/base/stl_util.h" #ifdef _SKIA_SUPPORT_ #include "core/fxge/skia/fx_skia_device.h" @@ -1851,8 +1850,7 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj, return false; CPDF_RefType3Cache refTypeCache(pType3Font); - for (int iChar = 0; - iChar < pdfium::CollectionSize(textobj->GetCharCodes()); iChar++) { + for (size_t iChar = 0; iChar < textobj->GetCharCodes().size(); ++iChar) { uint32_t charcode = textobj->GetCharCodes()[iChar]; if (charcode == static_cast(-1)) continue; @@ -1862,12 +1860,12 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj, continue; CFX_Matrix matrix = char_matrix; - matrix.e += iChar ? textobj->GetCharPositions()[iChar - 1] : 0; + matrix.e += iChar > 0 ? textobj->GetCharPositions()[iChar - 1] : 0; matrix.Concat(text_matrix); matrix.Concat(*pObj2Device); if (!pType3Char->LoadBitmap(m_pContext.Get())) { if (!glyphs.empty()) { - for (int i = 0; i < iChar; i++) { + for (size_t i = 0; i < iChar; ++i) { const FXTEXT_GLYPHPOS& glyph = glyphs[i]; if (!glyph.m_pGlyph) continue; @@ -1879,6 +1877,7 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj, } glyphs.clear(); } + std::unique_ptr pStates = CloneObjStates(textobj, false); CPDF_RenderOptions options = m_Options; -- cgit v1.2.3