summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_charposlist.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2018-01-30 21:42:41 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-30 21:42:41 +0000
commit2334660053e044ca79a1831a6c73f69891f039e0 (patch)
tree1114eeb0e18288235dff4ff694a8c7129541a7f2 /core/fpdfapi/render/cpdf_charposlist.cpp
parent90d9386825b872a0b668eac5dff3e268fa7ad16c (diff)
downloadpdfium-chromium/3335.tar.xz
Use unsigned for char widthchromium/3335
Bug: 806612 Change-Id: I22bd9046dd37a1b596762c46a6b29a323d6e9fa1 Reviewed-on: https://pdfium-review.googlesource.com/24410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_charposlist.cpp')
-rw-r--r--core/fpdfapi/render/cpdf_charposlist.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fpdfapi/render/cpdf_charposlist.cpp b/core/fpdfapi/render/cpdf_charposlist.cpp
index c0c700c0ca..ddb215c48b 100644
--- a/core/fpdfapi/render/cpdf_charposlist.cpp
+++ b/core/fpdfapi/render/cpdf_charposlist.cpp
@@ -69,8 +69,8 @@ void CPDF_CharPosList::Load(const std::vector<uint32_t>& charCodes,
float scalingFactor = 1.0f;
if (!pFont->IsEmbedded() && pFont->HasFontWidths() && !bVertWriting &&
!pCurrentFont->GetSubstFont()->m_bFlagMM) {
- int pdfGlyphWidth = pFont->GetCharWidthF(CharCode);
- int ftGlyphWidth =
+ uint32_t pdfGlyphWidth = pFont->GetCharWidthF(CharCode);
+ uint32_t ftGlyphWidth =
pCurrentFont ? pCurrentFont->GetGlyphWidth(charpos.m_GlyphIndex) : 0;
if (ftGlyphWidth && pdfGlyphWidth > ftGlyphWidth + 1) {
// Move the initial x position by half of the excess (transformed to
@@ -80,7 +80,6 @@ void CPDF_CharPosList::Load(const std::vector<uint32_t>& charCodes,
} else if (pdfGlyphWidth && ftGlyphWidth &&
pdfGlyphWidth < ftGlyphWidth) {
scalingFactor = static_cast<float>(pdfGlyphWidth) / ftGlyphWidth;
- ASSERT(scalingFactor >= 0.0f);
charpos.m_AdjustMatrix[0] = scalingFactor;
charpos.m_AdjustMatrix[1] = 0.0f;
charpos.m_AdjustMatrix[2] = 0.0f;