From 8b45eb1443e5a31f6f172fa16169b9b56177b639 Mon Sep 17 00:00:00 2001 From: thestig Date: Thu, 19 May 2016 18:35:02 -0700 Subject: Work around sign compare error from commit be9b894. Review-Url: https://codereview.chromium.org/1989203007 --- xfa/fwl/basewidget/fwl_editimp.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp index b734ec6e77..423d0b5c28 100644 --- a/xfa/fwl/basewidget/fwl_editimp.cpp +++ b/xfa/fwl/basewidget/fwl_editimp.cpp @@ -10,6 +10,7 @@ #include #include +#include "third_party/base/stl_util.h" #include "xfa/fde/cfde_txtedtengine.h" #include "xfa/fde/fde_gedevice.h" #include "xfa/fde/fde_render.h" @@ -779,7 +780,7 @@ FX_BOOL CFWL_EditImp::CanUndo() { } FX_BOOL CFWL_EditImp::CanRedo() { - return m_iCurRecord < m_DoRecords.size() - 1; + return m_iCurRecord < pdfium::CollectionSize(m_DoRecords) - 1; } FWL_Error CFWL_EditImp::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) { @@ -1462,7 +1463,7 @@ FX_BOOL CFWL_EditImp::IsContentHeightOverflow() { return pPage->GetContentsBox().height > m_rtEngine.height + 1.0f; } int32_t CFWL_EditImp::AddDoRecord(IFDE_TxtEdtDoRecord* pRecord) { - int32_t nCount = m_DoRecords.size(); + int32_t nCount = pdfium::CollectionSize(m_DoRecords); if (m_iCurRecord == nCount - 1) { if (nCount == m_iMaxRecord) { m_DoRecords.pop_front(); @@ -1474,7 +1475,7 @@ int32_t CFWL_EditImp::AddDoRecord(IFDE_TxtEdtDoRecord* pRecord) { } m_DoRecords.push_back(std::unique_ptr(pRecord)); - m_iCurRecord = m_DoRecords.size() - 1; + m_iCurRecord = pdfium::CollectionSize(m_DoRecords) - 1; return m_iCurRecord; } void CFWL_EditImp::Layout() { -- cgit v1.2.3