summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-04-11 10:02:09 -0700
committerWei Li <weili@chromium.org>2016-04-11 10:02:09 -0700
commite1aebd43b0c75133f94f8b141b33d12e2e715524 (patch)
tree863aded8c706db162eb3f69d6482100f9d61b842 /core/fpdfapi/fpdf_font/cpdf_type3font.cpp
parent2d4a4fc372159ac7562abea48498b6ab72c2f321 (diff)
downloadpdfium-e1aebd43b0c75133f94f8b141b33d12e2e715524.tar.xz
Use std::vector as internal storage for CPDF_Array
Replace the usage of CFX_ArrayTemplate inside CPDF_Array, which has non-standard APIs such as GetSize() returns int. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1867183002 .
Diffstat (limited to 'core/fpdfapi/fpdf_font/cpdf_type3font.cpp')
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_type3font.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
index 9f37d4adee..92f5102cdb 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
@@ -57,14 +57,12 @@ FX_BOOL CPDF_Type3Font::Load() {
int StartChar = m_pFontDict->GetIntegerBy("FirstChar");
CPDF_Array* pWidthArray = m_pFontDict->GetArrayBy("Widths");
if (pWidthArray && (StartChar >= 0 && StartChar < 256)) {
- uint32_t count = pWidthArray->GetCount();
- if (count > 256) {
+ size_t count = pWidthArray->GetCount();
+ if (count > 256)
count = 256;
- }
- if (StartChar + count > 256) {
+ if (StartChar + count > 256)
count = 256 - StartChar;
- }
- for (uint32_t i = 0; i < count; i++) {
+ for (size_t i = 0; i < count; i++) {
m_CharWidthL[StartChar + i] =
FXSYS_round(pWidthArray->GetNumberAt(i) * xscale * 1000);
}