Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1730)

Unified Diff: core/fpdfapi/fpdf_page/cpdf_textobject.cpp

Issue 1840483003: Reduce signed/unsigned comparison warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_colorspace.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_page/cpdf_textobject.cpp
diff --git a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
index 7ca03b4f05b97d1f6799c5e1b6c0e1331205e502..444101fb9e0b373137a00816b0964a203b68981c 100644
--- a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
@@ -28,7 +28,7 @@ void CPDF_TextObject::GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const {
m_nChars == 1 ? (uint32_t)(uintptr_t)m_pCharCodes : m_pCharCodes[index];
pInfo->m_OriginX = index ? m_pCharPos[index - 1] : 0;
pInfo->m_OriginY = 0;
- if (pInfo->m_CharCode == -1) {
+ if (pInfo->m_CharCode == CPDF_Font::kInvalidCharCode) {
return;
}
CPDF_Font* pFont = m_TextState.GetFont();
@@ -54,7 +54,7 @@ int CPDF_TextObject::CountChars() const {
}
int count = 0;
for (int i = 0; i < m_nChars; ++i)
- if (m_pCharCodes[i] != (uint32_t)-1) {
+ if (m_pCharCodes[i] != CPDF_Font::kInvalidCharCode) {
++count;
}
return count;
@@ -70,10 +70,11 @@ void CPDF_TextObject::GetCharInfo(int index,
}
int count = 0;
for (int i = 0; i < m_nChars; ++i) {
- if (m_pCharCodes[i] != (uint32_t)-1) {
+ if (m_pCharCodes[i] != CPDF_Font::kInvalidCharCode) {
if (count == index) {
charcode = m_pCharCodes[i];
- if (i == m_nChars - 1 || m_pCharCodes[i + 1] != (uint32_t)-1) {
+ if (i == m_nChars - 1 ||
+ m_pCharCodes[i + 1] != CPDF_Font::kInvalidCharCode) {
kerning = 0;
} else {
kerning = m_pCharPos[i];
@@ -93,7 +94,7 @@ void CPDF_TextObject::GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const {
int count = 0;
for (int i = 0; i < m_nChars; ++i) {
uint32_t charcode = m_pCharCodes[i];
- if (charcode == (uint32_t)-1) {
+ if (charcode == CPDF_Font::kInvalidCharCode) {
continue;
}
if (count == index) {
@@ -156,7 +157,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
}
if (i != nsegs - 1) {
m_pCharPos[index - 1] = pKerning[i];
- m_pCharCodes[index++] = (uint32_t)-1;
+ m_pCharCodes[index++] = CPDF_Font::kInvalidCharCode;
}
}
} else {
@@ -206,7 +207,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
uint32_t charcode =
m_nChars == 1 ? (uint32_t)(uintptr_t)m_pCharCodes : m_pCharCodes[i];
if (i > 0) {
- if (charcode == (uint32_t)-1) {
+ if (charcode == CPDF_Font::kInvalidCharCode) {
curpos -= (m_pCharPos[i - 1] * fontsize) / 1000;
continue;
}
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_colorspace.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698