summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-29 20:08:10 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-29 20:08:10 +0000
commitb7e2ae6a5fd44f5e181937aeca202a45aed07215 (patch)
tree5c7f475bddf2845f43c67580ac05cf5639b6f03c /xfa
parentebbc08b858b4bb3e0a2cb69eb43c51b740515b9a (diff)
downloadpdfium-b7e2ae6a5fd44f5e181937aeca202a45aed07215.tar.xz
Remove CollectionSize from fx_bidi
Bug: pdfium:774 Change-Id: I2056583c270f1bb0046250ce2ec53a2cbe46b893 Reviewed-on: https://pdfium-review.googlesource.com/19672 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fgas/layout/cfx_rtfbreak.cpp8
-rw-r--r--xfa/fgas/layout/cfx_txtbreak.cpp14
2 files changed, 12 insertions, 10 deletions
diff --git a/xfa/fgas/layout/cfx_rtfbreak.cpp b/xfa/fgas/layout/cfx_rtfbreak.cpp
index 0b556d89eb..761bd2fc03 100644
--- a/xfa/fgas/layout/cfx_rtfbreak.cpp
+++ b/xfa/fgas/layout/cfx_rtfbreak.cpp
@@ -363,10 +363,12 @@ void CFX_RTFBreak::EndBreak_BidiLine(std::deque<FX_TPO>* tpos,
std::vector<CFX_Char>& chars = m_pCurLine->m_LineChars;
int32_t iCount = m_pCurLine->CountChars();
if (!m_bPagination && m_pCurLine->m_iArabicChars > 0) {
- int32_t iBidiNum = 0;
- for (int32_t i = 0; i < iCount; ++i) {
+ ASSERT(iCount >= 0);
+
+ size_t iBidiNum = 0;
+ for (size_t i = 0; i < static_cast<size_t>(iCount); ++i) {
pTC = &chars[i];
- pTC->m_iBidiPos = i;
+ pTC->m_iBidiPos = static_cast<int32_t>(i);
if (pTC->GetCharType() != FX_CHARTYPE_Control)
iBidiNum = i;
if (i == 0)
diff --git a/xfa/fgas/layout/cfx_txtbreak.cpp b/xfa/fgas/layout/cfx_txtbreak.cpp
index 2d6e606e82..b028c9baf6 100644
--- a/xfa/fgas/layout/cfx_txtbreak.cpp
+++ b/xfa/fgas/layout/cfx_txtbreak.cpp
@@ -291,16 +291,16 @@ void CFX_TxtBreak::EndBreak_BidiLine(std::deque<FX_TPO>* tpos,
CFX_BreakPiece tp;
FX_TPO tpo;
CFX_Char* pTC;
- int32_t i;
- int32_t j;
std::vector<CFX_Char>& chars = m_pCurLine->m_LineChars;
int32_t iCount = m_pCurLine->CountChars();
bool bDone = m_pCurLine->m_iArabicChars > 0;
if (bDone) {
- int32_t iBidiNum = 0;
- for (i = 0; i < iCount; i++) {
+ ASSERT(iCount >= 0);
+
+ size_t iBidiNum = 0;
+ for (size_t i = 0; i < static_cast<size_t>(iCount); ++i) {
pTC = &chars[i];
- pTC->m_iBidiPos = i;
+ pTC->m_iBidiPos = static_cast<int32_t>(i);
if (pTC->GetCharType() != FX_CHARTYPE_Control)
iBidiNum = i;
if (i == 0)
@@ -315,8 +315,8 @@ void CFX_TxtBreak::EndBreak_BidiLine(std::deque<FX_TPO>* tpos,
tp.m_pChars = &m_pCurLine->m_LineChars;
int32_t iBidiLevel = -1;
int32_t iCharWidth;
- i = 0;
- j = -1;
+ int32_t i = 0;
+ int32_t j = -1;
while (i < iCount) {
pTC = &chars[i];
if (iBidiLevel < 0) {