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

Unified Diff: xfa/fwl/basewidget/fwl_editimp.cpp

Issue 1989203007: Work around sign compare error from commit be9b894. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/basewidget/fwl_editimp.cpp
diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp
index b734ec6e77bc302beb8fdd4e4c3100083ec63b3b..423d0b5c28d083e938f9246ef0c097dd9c59ffed 100644
--- a/xfa/fwl/basewidget/fwl_editimp.cpp
+++ b/xfa/fwl/basewidget/fwl_editimp.cpp
@@ -10,6 +10,7 @@
#include <memory>
#include <vector>
+#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<int32_t>(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<int32_t>(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<IFDE_TxtEdtDoRecord>(pRecord));
- m_iCurRecord = m_DoRecords.size() - 1;
+ m_iCurRecord = pdfium::CollectionSize<int32_t>(m_DoRecords) - 1;
return m_iCurRecord;
}
void CFWL_EditImp::Layout() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698