Switch to DCHECK_EQ() when appropriate.
Even though DCHECK_EQ() is a cheap imitation of the Chromium version, it
still fixes some cpplint readability/check errors.
Bug: pdfium:1636
Change-Id: Iccd1c7f95e05c416850794cfff877f80e6931e9e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/79536
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fdrm/fx_crypt_aes.cpp b/core/fdrm/fx_crypt_aes.cpp
index 8d0caac..302d8d6 100644
--- a/core/fdrm/fx_crypt_aes.cpp
+++ b/core/fdrm/fx_crypt_aes.cpp
@@ -7,6 +7,7 @@
#include "core/fdrm/fx_crypt.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#define mulby2(x) (((x & 0x7F) << 1) ^ (x & 0x80 ? 0x1B : 0))
#define GET_32BIT_MSB_FIRST(cp) \
@@ -583,7 +584,7 @@
CRYPT_aes_context* ctx) {
unsigned int iv[4], x[4], ct[4];
int i;
- DCHECK((len & 15) == 0);
+ DCHECK_EQ((len & 15), 0);
memcpy(iv, ctx->iv, sizeof(iv));
while (len > 0) {
for (i = 0; i < 4; i++) {
@@ -611,7 +612,7 @@
CRYPT_aes_context* ctx) {
unsigned int iv[4];
int i;
- DCHECK((len & 15) == 0);
+ DCHECK_EQ((len & 15), 0);
memcpy(iv, ctx->iv, sizeof(iv));
while (len > 0) {
for (i = 0; i < 4; i++) {
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp
index dbb5f2f..8271890 100644
--- a/core/fpdfapi/font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/font/cpdf_cidfont.cpp
@@ -25,6 +25,7 @@
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxge/fx_font.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/span.h"
#include "third_party/base/stl_util.h"
@@ -707,7 +708,7 @@
if (iBaseEncoding == PDFFONT_ENCODING_WINANSI) {
index = FT_Get_Char_Index(face, name_unicode);
} else {
- DCHECK(iBaseEncoding == PDFFONT_ENCODING_MACROMAN);
+ DCHECK_EQ(iBaseEncoding, PDFFONT_ENCODING_MACROMAN);
uint32_t maccode =
FT_CharCodeFromUnicode(FT_ENCODING_APPLE_ROMAN, name_unicode);
index = maccode ? FT_Get_Char_Index(face, maccode)
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index 79f92d0..8da89a6 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -34,6 +34,7 @@
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/maybe_owned.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/notreached.h"
#include "third_party/base/stl_util.h"
@@ -1208,7 +1209,7 @@
m_pCompMinMax[i * 2] +
m_pCompMinMax[i * 2 + 1] * pTable[index * m_nBaseComponents + i] / 255;
}
- DCHECK(m_nBaseComponents == m_pBaseCS->CountComponents());
+ DCHECK_EQ(m_nBaseComponents, m_pBaseCS->CountComponents());
return m_pBaseCS->GetRGB(comps, R, G, B);
}
diff --git a/core/fpdfapi/page/cpdf_contentparser.cpp b/core/fpdfapi/page/cpdf_contentparser.cpp
index ff86567..27cbdfc 100644
--- a/core/fpdfapi/page/cpdf_contentparser.cpp
+++ b/core/fpdfapi/page/cpdf_contentparser.cpp
@@ -21,6 +21,7 @@
#include "core/fxcrt/pauseindicator_iface.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
CPDF_ContentParser::CPDF_ContentParser(CPDF_Page* pPage)
: m_CurrentStage(Stage::kGetContent), m_pObjectHolder(pPage) {
@@ -127,12 +128,12 @@
if (m_CurrentStage == Stage::kCheckClip)
m_CurrentStage = CheckClip();
- DCHECK(m_CurrentStage == Stage::kComplete);
+ DCHECK_EQ(m_CurrentStage, Stage::kComplete);
return false;
}
CPDF_ContentParser::Stage CPDF_ContentParser::GetContent() {
- DCHECK(m_CurrentStage == Stage::kGetContent);
+ DCHECK_EQ(m_CurrentStage, Stage::kGetContent);
DCHECK(m_pObjectHolder->IsPage());
CPDF_Array* pContent =
m_pObjectHolder->GetDict()->GetArrayFor(pdfium::page_object::kContents);
diff --git a/core/fpdfapi/page/cpdf_dib.cpp b/core/fpdfapi/page/cpdf_dib.cpp
index 1dbce42..1c2f9ae 100644
--- a/core/fpdfapi/page/cpdf_dib.cpp
+++ b/core/fpdfapi/page/cpdf_dib.cpp
@@ -46,7 +46,7 @@
unsigned int GetBits8(const uint8_t* pData, uint64_t bitpos, size_t nbits) {
DCHECK(nbits == 1 || nbits == 2 || nbits == 4 || nbits == 8 || nbits == 16);
- DCHECK((bitpos & (nbits - 1)) == 0);
+ DCHECK_EQ((bitpos & (nbits - 1)), 0);
unsigned int byte = pData[bitpos / 8];
if (nbits == 8)
return byte;
@@ -302,8 +302,8 @@
return LoadState::kContinue;
}
- DCHECK(iCreatedDecoder == LoadState::kSuccess);
- DCHECK(iLoadedMask == LoadState::kSuccess);
+ DCHECK_EQ(iCreatedDecoder, LoadState::kSuccess);
+ DCHECK_EQ(iLoadedMask, LoadState::kSuccess);
if (m_pColorSpace && m_bStdCS)
m_pColorSpace->EnableStdConversion(false);
return LoadState::kSuccess;
diff --git a/core/fpdfapi/page/cpdf_form.cpp b/core/fpdfapi/page/cpdf_form.cpp
index d15c7e4..cbb8918 100644
--- a/core/fpdfapi/page/cpdf_form.cpp
+++ b/core/fpdfapi/page/cpdf_form.cpp
@@ -15,7 +15,7 @@
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fxge/dib/cfx_dibitmap.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
// static
CPDF_Dictionary* CPDF_Form::ChooseResourcesDict(
@@ -75,7 +75,7 @@
this, pGraphicStates, pParentMatrix, pType3Char,
pParsedSet ? pParsedSet : &m_ParsedSet));
}
- DCHECK(GetParseState() == ParseState::kParsing);
+ DCHECK_EQ(GetParseState(), ParseState::kParsing);
ContinueParse(nullptr);
}
diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp
index 289181b..89c9cb3 100644
--- a/core/fpdfapi/page/cpdf_page.cpp
+++ b/core/fpdfapi/page/cpdf_page.cpp
@@ -16,6 +16,7 @@
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_object.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
CPDF_Page::CPDF_Page(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict)
@@ -69,7 +70,7 @@
if (GetParseState() == ParseState::kNotParsed)
StartParse(std::make_unique<CPDF_ContentParser>(this));
- DCHECK(GetParseState() == ParseState::kParsing);
+ DCHECK_EQ(GetParseState(), ParseState::kParsing);
ContinueParse(nullptr);
}
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.cpp b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
index e993bcd..eb6107c 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.cpp
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
@@ -17,6 +17,7 @@
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fxcrt/fx_extension.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
bool GraphicsData::operator<(const GraphicsData& other) const {
@@ -52,7 +53,7 @@
void CPDF_PageObjectHolder::StartParse(
std::unique_ptr<CPDF_ContentParser> pParser) {
- DCHECK(m_ParseState == ParseState::kNotParsed);
+ DCHECK_EQ(m_ParseState, ParseState::kNotParsed);
m_pParser = std::move(pParser);
m_ParseState = ParseState::kParsing;
}
@@ -61,7 +62,7 @@
if (m_ParseState == ParseState::kParsed)
return;
- DCHECK(m_ParseState == ParseState::kParsing);
+ DCHECK_EQ(m_ParseState, ParseState::kParsing);
if (m_pParser->Continue(pPause))
return;
diff --git a/core/fpdfapi/page/cpdf_transferfunc.cpp b/core/fpdfapi/page/cpdf_transferfunc.cpp
index a274d1a..86184a9 100644
--- a/core/fpdfapi/page/cpdf_transferfunc.cpp
+++ b/core/fpdfapi/page/cpdf_transferfunc.cpp
@@ -11,7 +11,7 @@
#include "core/fpdfapi/page/cpdf_transferfuncdib.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fxge/dib/cfx_dibbase.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
CPDF_TransferFunc::CPDF_TransferFunc(
CPDF_Document* pDoc,
@@ -24,9 +24,9 @@
m_SamplesR(std::move(samples_r)),
m_SamplesG(std::move(samples_g)),
m_SamplesB(std::move(samples_b)) {
- DCHECK(m_SamplesR.size() == kChannelSampleSize);
- DCHECK(m_SamplesG.size() == kChannelSampleSize);
- DCHECK(m_SamplesB.size() == kChannelSampleSize);
+ DCHECK_EQ(m_SamplesR.size(), kChannelSampleSize);
+ DCHECK_EQ(m_SamplesG.size(), kChannelSampleSize);
+ DCHECK_EQ(m_SamplesB.size(), kChannelSampleSize);
}
CPDF_TransferFunc::~CPDF_TransferFunc() = default;
diff --git a/core/fpdfapi/parser/cpdf_crypto_handler.cpp b/core/fpdfapi/parser/cpdf_crypto_handler.cpp
index 120d013..2c32805 100644
--- a/core/fpdfapi/parser/cpdf_crypto_handler.cpp
+++ b/core/fpdfapi/parser/cpdf_crypto_handler.cpp
@@ -24,6 +24,7 @@
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
namespace {
@@ -94,7 +95,7 @@
dest_size -= dest_buf[dest_size - 1];
}
} else {
- DCHECK(dest_size == source.size());
+ DCHECK_EQ(dest_size, source.size());
if (dest_buf != source.data())
memcpy(dest_buf, source.data(), source.size());
CRYPT_ArcFourCryptBlock({dest_buf, dest_size}, {realkey, realkeylen});
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index 193ae30..b269776 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -29,6 +29,7 @@
#include "core/fxcrt/fx_memory_wrappers.h"
#include "core/fxcrt/fx_safe_types.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/notreached.h"
#include "third_party/base/stl_util.h"
@@ -782,7 +783,7 @@
continue;
}
- DCHECK(type == ObjectType::kCompressed);
+ DCHECK_EQ(type, ObjectType::kCompressed);
const uint32_t archive_obj_num = entry_value;
if (!IsValidObjectNumber(archive_obj_num))
return false;
diff --git a/core/fpdfapi/parser/cpdf_reference.cpp b/core/fpdfapi/parser/cpdf_reference.cpp
index 9266351..03991e9 100644
--- a/core/fpdfapi/parser/cpdf_reference.cpp
+++ b/core/fpdfapi/parser/cpdf_reference.cpp
@@ -8,7 +8,7 @@
#include "core/fpdfapi/parser/cpdf_indirect_object_holder.h"
#include "core/fxcrt/fx_stream.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
CPDF_Reference::CPDF_Reference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum)
@@ -107,7 +107,7 @@
RetainPtr<CPDF_Object> CPDF_Reference::MakeReference(
CPDF_IndirectObjectHolder* holder) const {
- DCHECK(holder == m_pObjList);
+ DCHECK_EQ(holder, m_pObjList);
// Do not allow reference to reference, just create other reference for same
// object.
return pdfium::MakeRetain<CPDF_Reference>(holder, GetRefObjNum());
diff --git a/core/fpdfapi/render/cpdf_rendershading.cpp b/core/fpdfapi/render/cpdf_rendershading.cpp
index a0f1b6a..a8b541b 100644
--- a/core/fpdfapi/render/cpdf_rendershading.cpp
+++ b/core/fpdfapi/render/cpdf_rendershading.cpp
@@ -31,6 +31,7 @@
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/fx_dib.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/span.h"
namespace {
@@ -92,7 +93,7 @@
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const RetainPtr<CPDF_ColorSpace>& pCS,
int alpha) {
- DCHECK(pBitmap->GetFormat() == FXDIB_Format::kArgb);
+ DCHECK_EQ(pBitmap->GetFormat(), FXDIB_Format::kArgb);
const uint32_t total_results = GetValidatedOutputsCount(funcs, pCS);
if (total_results == 0)
@@ -160,7 +161,7 @@
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const RetainPtr<CPDF_ColorSpace>& pCS,
int alpha) {
- DCHECK(pBitmap->GetFormat() == FXDIB_Format::kArgb);
+ DCHECK_EQ(pBitmap->GetFormat(), FXDIB_Format::kArgb);
const uint32_t total_results = GetValidatedOutputsCount(funcs, pCS);
if (total_results == 0)
@@ -259,7 +260,7 @@
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const RetainPtr<CPDF_ColorSpace>& pCS,
int alpha) {
- DCHECK(pBitmap->GetFormat() == FXDIB_Format::kArgb);
+ DCHECK_EQ(pBitmap->GetFormat(), FXDIB_Format::kArgb);
const uint32_t total_results = GetValidatedOutputsCount(funcs, pCS);
if (total_results == 0)
@@ -420,7 +421,7 @@
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const RetainPtr<CPDF_ColorSpace>& pCS,
int alpha) {
- DCHECK(pBitmap->GetFormat() == FXDIB_Format::kArgb);
+ DCHECK_EQ(pBitmap->GetFormat(), FXDIB_Format::kArgb);
CPDF_MeshStream stream(kFreeFormGouraudTriangleMeshShading, funcs,
pShadingStream, pCS);
@@ -459,7 +460,7 @@
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const RetainPtr<CPDF_ColorSpace>& pCS,
int alpha) {
- DCHECK(pBitmap->GetFormat() == FXDIB_Format::kArgb);
+ DCHECK_EQ(pBitmap->GetFormat(), FXDIB_Format::kArgb);
int row_verts = pShadingStream->GetDict()->GetIntegerFor("VerticesPerRow");
if (row_verts < 2)
@@ -772,7 +773,7 @@
const RetainPtr<CPDF_ColorSpace>& pCS,
bool bNoPathSmooth,
int alpha) {
- DCHECK(pBitmap->GetFormat() == FXDIB_Format::kArgb);
+ DCHECK_EQ(pBitmap->GetFormat(), FXDIB_Format::kArgb);
DCHECK(type == kCoonsPatchMeshShading ||
type == kTensorProductPatchMeshShading);
diff --git a/core/fxcodec/fax/faxmodule.cpp b/core/fxcodec/fax/faxmodule.cpp
index 68994de..0e652b8 100644
--- a/core/fxcodec/fax/faxmodule.cpp
+++ b/core/fxcodec/fax/faxmodule.cpp
@@ -17,6 +17,7 @@
#include "core/fxcrt/cfx_binarybuf.h"
#include "core/fxcrt/fx_memory_wrappers.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
namespace fxcodec {
@@ -562,8 +563,8 @@
}
void FaxDecoder::InvertBuffer() {
- DCHECK(m_Pitch == m_ScanlineBuf.size());
- DCHECK(m_Pitch % 4 == 0);
+ DCHECK_EQ(m_Pitch, m_ScanlineBuf.size());
+ DCHECK_EQ(m_Pitch % 4, 0);
uint32_t* data = reinterpret_cast<uint32_t*>(m_ScanlineBuf.data());
for (size_t i = 0; i < m_ScanlineBuf.size() / 4; ++i)
data[i] = ~data[i];
diff --git a/core/fxcrt/bytestring.cpp b/core/fxcrt/bytestring.cpp
index 5261934..3f81852 100644
--- a/core/fxcrt/bytestring.cpp
+++ b/core/fxcrt/bytestring.cpp
@@ -19,6 +19,7 @@
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/string_pool_template.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/numerics/safe_math.h"
#include "third_party/base/span.h"
#include "third_party/base/stl_util.h"
@@ -382,7 +383,7 @@
return;
}
- DCHECK(m_pData->m_nRefs == 1);
+ DCHECK_EQ(m_pData->m_nRefs, 1);
m_pData->m_nDataLength = nNewLength;
m_pData->m_String[nNewLength] = 0;
if (m_pData->m_nAllocLength - nNewLength >= 32) {
diff --git a/core/fxcrt/widestring.cpp b/core/fxcrt/widestring.cpp
index fdbb0b1..ef8184e 100644
--- a/core/fxcrt/widestring.cpp
+++ b/core/fxcrt/widestring.cpp
@@ -17,6 +17,7 @@
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/string_pool_template.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/numerics/safe_math.h"
#include "third_party/base/stl_util.h"
@@ -549,7 +550,7 @@
return;
}
- DCHECK(m_pData->m_nRefs == 1);
+ DCHECK_EQ(m_pData->m_nRefs, 1);
m_pData->m_nDataLength = nNewLength;
m_pData->m_String[nNewLength] = 0;
if (m_pData->m_nAllocLength - nNewLength >= 32) {
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 99606b5..7335541 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -18,6 +18,7 @@
#include "core/fxge/dib/cfx_imagerenderer.h"
#include "core/fxge/dib/cfx_imagestretcher.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/notreached.h"
#include "third_party/base/span.h"
#include "third_party/base/stl_util.h"
@@ -170,7 +171,7 @@
uint8_t* dest_buf = buffer + dest_top * pitch + dest_left * Bpp;
if (dest_format == FXDIB_Format::kRgb) {
- DCHECK(src_format == FXDIB_Format::kRgb32);
+ DCHECK_EQ(src_format, FXDIB_Format::kRgb32);
for (int row = 0; row < height; row++) {
uint8_t* dest_scan = dest_buf + row * pitch;
const uint8_t* src_scan =
@@ -203,7 +204,7 @@
}
if (src_format != FXDIB_Format::kRgb32)
return;
- DCHECK(dest_format == FXDIB_Format::kArgb);
+ DCHECK_EQ(dest_format, FXDIB_Format::kArgb);
for (int row = 0; row < height; row++) {
uint8_t* dest_scan = dest_buf + row * pitch;
const uint8_t* src_scan =
diff --git a/core/fxge/cfx_cliprgn.cpp b/core/fxge/cfx_cliprgn.cpp
index dccfecf..f87ce2f 100644
--- a/core/fxge/cfx_cliprgn.cpp
+++ b/core/fxge/cfx_cliprgn.cpp
@@ -9,7 +9,7 @@
#include <utility>
#include "core/fxge/dib/cfx_dibitmap.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/notreached.h"
CFX_ClipRgn::CFX_ClipRgn(int width, int height)
@@ -60,7 +60,7 @@
void CFX_ClipRgn::IntersectMaskF(int left,
int top,
const RetainPtr<CFX_DIBitmap>& pMask) {
- DCHECK(pMask->GetFormat() == FXDIB_Format::k8bppMask);
+ DCHECK_EQ(pMask->GetFormat(), FXDIB_Format::k8bppMask);
FX_RECT mask_box(left, top, left + pMask->GetWidth(),
top + pMask->GetHeight());
if (m_Type == RectI) {
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 794d1cd..87c64aa 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -438,7 +438,7 @@
continue;
}
- DCHECK(point_type == FXPT_TYPE::LineTo);
+ DCHECK_EQ(point_type, FXPT_TYPE::LineTo);
int next_index = (i + 1) % (points.size());
const FX_PATHPOINT& next = points[next_index];
if (next.m_Type == FXPT_TYPE::BezierTo || next.m_Type == FXPT_TYPE::MoveTo)
@@ -717,7 +717,7 @@
continue;
}
- DCHECK(point_type == FXPT_TYPE::LineTo);
+ DCHECK_EQ(point_type, FXPT_TYPE::LineTo);
sub_path.push_back(points[i]);
continue;
}
diff --git a/core/fxge/cfx_windowsrenderdevice.cpp b/core/fxge/cfx_windowsrenderdevice.cpp
index b17016b..e12958f 100644
--- a/core/fxge/cfx_windowsrenderdevice.cpp
+++ b/core/fxge/cfx_windowsrenderdevice.cpp
@@ -13,7 +13,7 @@
#include "core/fxge/win32/cgdi_printer_driver.h"
#include "core/fxge/win32/cps_printer_driver.h"
#include "core/fxge/win32/ctext_only_printer_driver.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
namespace {
@@ -55,6 +55,6 @@
#if defined(_SKIA_SUPPORT_)
void CFX_WindowsRenderDevice::DebugVerifyBitmapIsPreMultiplied() const {
- DCHECK(GetDeviceCaps(FXDC_BITS_PIXEL) == 32);
+ DCHECK_EQ(GetDeviceCaps(FXDC_BITS_PIXEL), 32);
}
#endif
diff --git a/core/fxge/dib/cfx_cmyk_to_srgb.cpp b/core/fxge/dib/cfx_cmyk_to_srgb.cpp
index df9a451..d4c7b2c 100644
--- a/core/fxge/dib/cfx_cmyk_to_srgb.cpp
+++ b/core/fxge/dib/cfx_cmyk_to_srgb.cpp
@@ -10,7 +10,7 @@
#include <tuple>
#include "core/fxcrt/fx_system.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
namespace fxge {
@@ -1741,10 +1741,10 @@
uint8_t y1 = static_cast<int>(y * 255.f + rounding_offset);
uint8_t k1 = static_cast<int>(k * 255.f + rounding_offset);
- DCHECK(c1 == FXSYS_roundf(c * 255));
- DCHECK(m1 == FXSYS_roundf(m * 255));
- DCHECK(y1 == FXSYS_roundf(y * 255));
- DCHECK(k1 == FXSYS_roundf(k * 255));
+ DCHECK_EQ(c1, FXSYS_roundf(c * 255));
+ DCHECK_EQ(m1, FXSYS_roundf(m * 255));
+ DCHECK_EQ(y1, FXSYS_roundf(y * 255));
+ DCHECK_EQ(k1, FXSYS_roundf(k * 255));
uint8_t r;
uint8_t g;
diff --git a/core/fxge/dib/cfx_dibbase.cpp b/core/fxge/dib/cfx_dibbase.cpp
index 137556e..30248ff 100644
--- a/core/fxge/dib/cfx_dibbase.cpp
+++ b/core/fxge/dib/cfx_dibbase.cpp
@@ -19,6 +19,7 @@
#include "core/fxge/dib/cfx_imagestretcher.h"
#include "core/fxge/dib/cfx_imagetransformer.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/notreached.h"
#include "third_party/base/span.h"
#include "third_party/base/stl_util.h"
@@ -846,7 +847,7 @@
}
RetainPtr<CFX_DIBitmap> CFX_DIBBase::CloneAlphaMask() const {
- DCHECK(GetFormat() == FXDIB_Format::kArgb);
+ DCHECK_EQ(GetFormat(), FXDIB_Format::kArgb);
FX_RECT rect(0, 0, m_Width, m_Height);
auto pMask = pdfium::MakeRetain<CFX_DIBitmap>();
if (!pMask->Create(rect.Width(), rect.Height(), FXDIB_Format::k8bppMask))
@@ -932,7 +933,7 @@
src_scan += 3;
}
} else {
- DCHECK(Bpp == 4);
+ DCHECK_EQ(Bpp, 4);
for (int col = 0; col < m_Width; ++col) {
const auto* src_scan32 = reinterpret_cast<const uint32_t*>(src_scan);
uint32_t* dest_scan32 = reinterpret_cast<uint32_t*>(dest_scan);
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp
index 5012d44..d5716b8 100644
--- a/core/fxge/dib/cfx_dibitmap.cpp
+++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -776,7 +776,7 @@
RetainPtr<CFX_DIBitmap> pClipMask;
FX_RECT clip_box;
if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
- DCHECK(pClipRgn->GetType() == CFX_ClipRgn::MaskF);
+ DCHECK_EQ(pClipRgn->GetType(), CFX_ClipRgn::MaskF);
pClipMask = pClipRgn->GetMask();
clip_box = pClipRgn->GetBox();
}
@@ -859,7 +859,7 @@
RetainPtr<CFX_DIBitmap> pClipMask;
FX_RECT clip_box;
if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
- DCHECK(pClipRgn->GetType() == CFX_ClipRgn::MaskF);
+ DCHECK_EQ(pClipRgn->GetType(), CFX_ClipRgn::MaskF);
pClipMask = pClipRgn->GetMask();
clip_box = pClipRgn->GetBox();
}
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 4442a65..e7be6fd 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -34,6 +34,7 @@
#include "core/fxge/dib/cfx_imagestretcher.h"
#include "core/fxge/text_char_pos.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/notreached.h"
#include "third_party/base/ptr_util.h"
#include "third_party/base/span.h"
@@ -150,7 +151,7 @@
}
}
} else if (src_format == FXDIB_Format::kRgb32) {
- DCHECK(dest_format == FXDIB_Format::kArgb);
+ DCHECK_EQ(dest_format, FXDIB_Format::kArgb);
for (int row = 0; row < height; row++) {
uint8_t* dest_scan = dest_buf + row * pitch;
const uint8_t* src_scan =
@@ -315,7 +316,7 @@
if (text_options.aliasing_type == CFX_TextRenderOptions::kAntiAliasing)
return SkFont::Edging::kAntiAlias;
- DCHECK(text_options.aliasing_type == CFX_TextRenderOptions::kLcd);
+ DCHECK_EQ(text_options.aliasing_type, CFX_TextRenderOptions::kLcd);
return SkFont::Edging::kSubpixelAntiAlias;
}
@@ -1252,7 +1253,7 @@
if (Clip::kSave == m_commands[m_clipIndex]) {
m_pDriver->SkiaCanvas()->save();
} else {
- DCHECK(Clip::kPath == m_commands[m_clipIndex]);
+ DCHECK_EQ(Clip::kPath, m_commands[m_clipIndex]);
m_pDriver->SkiaCanvas()->clipPath(m_clips[m_clipIndex],
SkClipOp::kIntersect, true);
}
@@ -1345,7 +1346,7 @@
DCHECK(m_clipIndex <= m_commands.count());
for (int index = 0; index < m_clipIndex; ++index)
cacheSaveCount += Clip::kSave == m_commands[index];
- DCHECK(skCanvasSaveCount == cacheSaveCount);
+ DCHECK_EQ(skCanvasSaveCount, cacheSaveCount);
#endif // SHOW_SKIA_PATH
}
@@ -1506,7 +1507,7 @@
m_fontCharWidths[index] = width;
}
int Count() const {
- DCHECK(m_positions.count() == m_glyphs.count());
+ DCHECK_EQ(m_positions.count(), m_glyphs.count());
return m_glyphs.count();
}
void SetCount(int count) {
@@ -1649,7 +1650,7 @@
? kAlpha_8_SkColorType
: kGray_8_SkColorType;
} else {
- DCHECK(bpp == 32);
+ DCHECK_EQ(bpp, 32);
color_type = Get32BitSkColorType(bRgbByteOrder);
}
@@ -2285,7 +2286,7 @@
skPath.addRect(skRect);
skPath.transform(inverse);
} else {
- DCHECK(kCoonsPatchMeshShading == shadingType);
+ DCHECK_EQ(kCoonsPatchMeshShading, shadingType);
const CPDF_Stream* pStream = ToStream(pPattern->GetShadingObject());
if (!pStream)
return false;
@@ -2811,7 +2812,7 @@
void CFX_DIBBase::DebugVerifyBitmapIsPreMultiplied(void* opt) const {
#ifdef SK_DEBUG
- DCHECK(GetBPP() == 32);
+ DCHECK_EQ(GetBPP(), 32);
const uint32_t* buffer = (const uint32_t*)(opt ? opt : GetBuffer());
int width = GetWidth();
int height = GetHeight();
diff --git a/core/fxge/win32/cgdi_device_driver.cpp b/core/fxge/win32/cgdi_device_driver.cpp
index 4264449..72b0a1d 100644
--- a/core/fxge/win32/cgdi_device_driver.cpp
+++ b/core/fxge/win32/cgdi_device_driver.cpp
@@ -19,6 +19,7 @@
#include "core/fxge/render_defines.h"
#include "core/fxge/win32/cwin32_platform.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/notreached.h"
#if !defined(_SKIA_SUPPORT_)
@@ -524,7 +525,7 @@
x2 = x[0];
y2 = y[0];
} else {
- DCHECK(np == 2);
+ DCHECK_EQ(np, 2);
x1 = x[0];
y1 = y[0];
x2 = x[1];
diff --git a/core/fxge/win32/cgdi_display_driver.cpp b/core/fxge/win32/cgdi_display_driver.cpp
index 9d80b40..d51ad63 100644
--- a/core/fxge/win32/cgdi_display_driver.cpp
+++ b/core/fxge/win32/cgdi_display_driver.cpp
@@ -13,6 +13,7 @@
#include "core/fxge/render_defines.h"
#include "core/fxge/win32/cwin32_platform.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
CGdiDisplayDriver::CGdiDisplayDriver(HDC hDC)
: CGdiDeviceDriver(hDC, DeviceType::kDisplay) {
@@ -77,7 +78,7 @@
int left,
int top,
BlendMode blend_type) {
- DCHECK(blend_type == BlendMode::kNormal);
+ DCHECK_EQ(blend_type, BlendMode::kNormal);
if (pSource->IsMask()) {
int width = pSource->GetWidth(), height = pSource->GetHeight();
int alpha = FXARGB_A(color);
diff --git a/core/fxge/win32/cgdi_printer_driver.cpp b/core/fxge/win32/cgdi_printer_driver.cpp
index 4fd73d0..ea75455 100644
--- a/core/fxge/win32/cgdi_printer_driver.cpp
+++ b/core/fxge/win32/cgdi_printer_driver.cpp
@@ -21,6 +21,7 @@
#include "core/fxge/render_defines.h"
#include "core/fxge/text_char_pos.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#if defined(PDFIUM_PRINT_TEXT_WITH_GDI)
namespace {
@@ -86,7 +87,7 @@
}
DCHECK(pSource);
DCHECK(!pSource->IsMask());
- DCHECK(blend_type == BlendMode::kNormal);
+ DCHECK_EQ(blend_type, BlendMode::kNormal);
if (pSource->HasAlpha())
return false;
@@ -297,11 +298,11 @@
// Only works with PDFs from Skia's PDF generator. Cannot handle arbitrary
// values from PDFs.
const TextCharPos& charpos = pCharPos[i];
- DCHECK(charpos.m_AdjustMatrix[0] == 0);
- DCHECK(charpos.m_AdjustMatrix[1] == 0);
- DCHECK(charpos.m_AdjustMatrix[2] == 0);
- DCHECK(charpos.m_AdjustMatrix[3] == 0);
- DCHECK(charpos.m_Origin.y == 0);
+ DCHECK_EQ(charpos.m_AdjustMatrix[0], 0);
+ DCHECK_EQ(charpos.m_AdjustMatrix[1], 0);
+ DCHECK_EQ(charpos.m_AdjustMatrix[2], 0);
+ DCHECK_EQ(charpos.m_AdjustMatrix[3], 0);
+ DCHECK_EQ(charpos.m_Origin.y, 0);
// Round the spacing to the nearest integer, but keep track of the rounding
// error for calculating the next spacing value.
diff --git a/core/fxge/win32/ctext_only_printer_driver.cpp b/core/fxge/win32/ctext_only_printer_driver.cpp
index fed5d5e..b9746c5 100644
--- a/core/fxge/win32/ctext_only_printer_driver.cpp
+++ b/core/fxge/win32/ctext_only_printer_driver.cpp
@@ -15,7 +15,7 @@
#include "core/fxcrt/fx_system.h"
#include "core/fxge/cfx_font.h"
#include "core/fxge/text_char_pos.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/notreached.h"
CTextOnlyPrinterDriver::CTextOnlyPrinterDriver(HDC hDC)
@@ -157,11 +157,11 @@
// Only works with PDFs from Skia's PDF generator. Cannot handle arbitrary
// values from PDFs.
const TextCharPos& charpos = pCharPos[i];
- DCHECK(charpos.m_AdjustMatrix[0] == 0);
- DCHECK(charpos.m_AdjustMatrix[1] == 0);
- DCHECK(charpos.m_AdjustMatrix[2] == 0);
- DCHECK(charpos.m_AdjustMatrix[3] == 0);
- DCHECK(charpos.m_Origin.y == 0);
+ DCHECK_EQ(charpos.m_AdjustMatrix[0], 0);
+ DCHECK_EQ(charpos.m_AdjustMatrix[1], 0);
+ DCHECK_EQ(charpos.m_AdjustMatrix[2], 0);
+ DCHECK_EQ(charpos.m_AdjustMatrix[3], 0);
+ DCHECK_EQ(charpos.m_Origin.y, 0);
wsText += charpos.m_Unicode;
}
diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp
index a9cd4da..0f977ce 100644
--- a/fpdfsdk/cpdfsdk_widgethandler.cpp
+++ b/fpdfsdk/cpdfsdk_widgethandler.cpp
@@ -20,6 +20,7 @@
#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
CPDFSDK_WidgetHandler::CPDFSDK_WidgetHandler() = default;
@@ -307,7 +308,7 @@
bool CPDFSDK_WidgetHandler::IsFocusableAnnot(
const CPDF_Annot::Subtype& annot_type) const {
- DCHECK(annot_type == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(annot_type, CPDF_Annot::Subtype::WIDGET);
return pdfium::Contains(m_pFormFillEnv->GetFocusableAnnotSubtypes(),
annot_type);
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 0794055..7e799f9 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -25,6 +25,7 @@
#include "fpdfsdk/formfiller/cffl_textfield.h"
#include "public/fpdf_fwlevent.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
CFFL_InteractiveFormFiller::CFFL_InteractiveFormFiller(
@@ -98,7 +99,8 @@
CPDFSDK_PageView* pPageView,
ObservedPtr<CPDFSDK_Annot>* pAnnot,
uint32_t nFlag) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::kCursorEnter).GetDict()) {
@@ -131,7 +133,8 @@
void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
ObservedPtr<CPDFSDK_Annot>* pAnnot,
uint32_t nFlag) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::kCursorExit).GetDict()) {
@@ -166,7 +169,8 @@
ObservedPtr<CPDFSDK_Annot>* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get());
if (Annot_HitTest(pPageView, pAnnot->Get(), point) &&
@@ -205,7 +209,8 @@
ObservedPtr<CPDFSDK_Annot>* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get());
bool bSetFocus;
@@ -275,7 +280,8 @@
ObservedPtr<CPDFSDK_Annot>* pAnnot,
int index,
bool selected) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get());
return pFormFiller && pFormFiller->SetIndexSelected(index, selected);
@@ -284,7 +290,8 @@
bool CFFL_InteractiveFormFiller::IsIndexSelected(
ObservedPtr<CPDFSDK_Annot>* pAnnot,
int index) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get());
return pFormFiller && pFormFiller->IsIndexSelected(index);
@@ -295,7 +302,8 @@
ObservedPtr<CPDFSDK_Annot>* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get());
return pFormFiller && pFormFiller->OnLButtonDblClk(pPageView, nFlags, point);
}
@@ -304,7 +312,8 @@
ObservedPtr<CPDFSDK_Annot>* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetOrCreateFormFiller(pAnnot->Get());
return pFormFiller && pFormFiller->OnMouseMove(pPageView, nFlags, point);
}
@@ -315,7 +324,8 @@
uint32_t nFlags,
const CFX_PointF& point,
const CFX_Vector& delta) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get());
return pFormFiller &&
pFormFiller->OnMouseWheel(pPageView, nFlags, point, delta);
@@ -326,7 +336,8 @@
ObservedPtr<CPDFSDK_Annot>* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get());
return pFormFiller && pFormFiller->OnRButtonDown(pPageView, nFlags, point);
}
@@ -335,7 +346,8 @@
ObservedPtr<CPDFSDK_Annot>* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get());
return pFormFiller && pFormFiller->OnRButtonUp(pPageView, nFlags, point);
}
@@ -343,7 +355,7 @@
bool CFFL_InteractiveFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
uint32_t nKeyCode,
uint32_t nFlags) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot);
return pFormFiller && pFormFiller->OnKeyDown(nKeyCode, nFlags);
@@ -352,7 +364,7 @@
bool CFFL_InteractiveFormFiller::OnChar(CPDFSDK_Annot* pAnnot,
uint32_t nChar,
uint32_t nFlags) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
if (nChar == FWL_VKEY_Tab)
return true;
@@ -365,7 +377,8 @@
if (!pAnnot->HasObservable())
return false;
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::kGetFocus).GetDict()) {
@@ -410,7 +423,8 @@
if (!pAnnot->HasObservable())
return false;
- DCHECK((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(),
+ CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get());
if (!pFormFiller)
return true;
@@ -511,20 +525,20 @@
}
WideString CFFL_InteractiveFormFiller::GetText(CPDFSDK_Annot* pAnnot) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot);
return pFormFiller ? pFormFiller->GetText() : WideString();
}
WideString CFFL_InteractiveFormFiller::GetSelectedText(CPDFSDK_Annot* pAnnot) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot);
return pFormFiller ? pFormFiller->GetSelectedText() : WideString();
}
void CFFL_InteractiveFormFiller::ReplaceSelection(CPDFSDK_Annot* pAnnot,
const WideString& text) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot);
if (!pFormFiller)
return;
@@ -533,31 +547,31 @@
}
bool CFFL_InteractiveFormFiller::SelectAllText(CPDFSDK_Annot* pAnnot) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot);
return pAnnot && pFormFiller->SelectAllText();
}
bool CFFL_InteractiveFormFiller::CanUndo(CPDFSDK_Annot* pAnnot) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot);
return pFormFiller && pFormFiller->CanUndo();
}
bool CFFL_InteractiveFormFiller::CanRedo(CPDFSDK_Annot* pAnnot) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot);
return pFormFiller && pFormFiller->CanRedo();
}
bool CFFL_InteractiveFormFiller::Undo(CPDFSDK_Annot* pAnnot) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot);
return pFormFiller && pFormFiller->Undo();
}
bool CFFL_InteractiveFormFiller::Redo(CPDFSDK_Annot* pAnnot) {
- DCHECK(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot);
return pFormFiller && pFormFiller->Redo();
}
diff --git a/fpdfsdk/fpdf_edittext.cpp b/fpdfsdk/fpdf_edittext.cpp
index 5fbec35..1eabc28 100644
--- a/fpdfsdk/fpdf_edittext.cpp
+++ b/fpdfsdk/fpdf_edittext.cpp
@@ -27,6 +27,7 @@
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "public/fpdf_edit.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
// These checks are here because core/ and public/ cannot depend on each other.
@@ -204,7 +205,7 @@
unicodes.push_back(iter->second);
next_it = std::next(iter);
}
- DCHECK(iter->first - firstCharcode + 1 == unicodes.size());
+ DCHECK_EQ(iter->first - firstCharcode + 1, unicodes.size());
map_range_vector[std::make_pair(firstCharcode, iter->first)] = unicodes;
continue;
}
diff --git a/fpdfsdk/fpdf_formfill_embeddertest.cpp b/fpdfsdk/fpdf_formfill_embeddertest.cpp
index 633ff9e..56e1165 100644
--- a/fpdfsdk/fpdf_formfill_embeddertest.cpp
+++ b/fpdfsdk/fpdf_formfill_embeddertest.cpp
@@ -111,7 +111,7 @@
// Uses the mouse to navigate to text field and select text.
void SelectTextWithMouse(const CFX_PointF& start, const CFX_PointF& end) {
- DCHECK(start.y == end.y);
+ DCHECK_EQ(start.y, end.y);
// Navigate to starting position and click mouse.
FORM_OnMouseMove(form_handle(), page_, 0, start.x, start.y);
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index 7dbed9c..54cd32f 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -26,6 +26,7 @@
#include "fpdfsdk/pwl/cpwl_scroll_bar.h"
#include "fpdfsdk/pwl/ipwl_systemhandler.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/compiler_specific.h"
namespace {
@@ -178,7 +179,7 @@
m_nCurUndoPos--;
nUndoRemain--;
}
- DCHECK(nUndoRemain == 0);
+ DCHECK_EQ(nUndoRemain, 0);
DCHECK(m_bWorking);
m_bWorking = false;
}
@@ -196,7 +197,7 @@
m_nCurUndoPos++;
nRedoRemain--;
}
- DCHECK(nRedoRemain == 0);
+ DCHECK_EQ(nRedoRemain, 0);
DCHECK(m_bWorking);
m_bWorking = false;
}
diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp
index 2d361f0..51b5988 100644
--- a/fpdfsdk/pwl/cpwl_wnd.cpp
+++ b/fpdfsdk/pwl/cpwl_wnd.cpp
@@ -14,6 +14,7 @@
#include "fpdfsdk/pwl/cpwl_scroll_bar.h"
#include "public/fpdf_fwlevent.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
namespace {
@@ -378,7 +379,7 @@
}
void CPWL_Wnd::RemoveChild(CPWL_Wnd* pWnd) {
- DCHECK(pWnd->m_pParent == this);
+ DCHECK_EQ(pWnd->m_pParent, this);
auto it = std::find(m_Children.begin(), m_Children.end(),
pdfium::FakeUniquePtr<CPWL_Wnd>(pWnd));
if (it == m_Children.end())
diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
index 95faf0b..d837bff 100644
--- a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
@@ -39,6 +39,7 @@
#include "fxbarcode/qrcode/BC_QRCoderMode.h"
#include "fxbarcode/qrcode/BC_QRCoderVersion.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/optional.h"
#include "third_party/base/stl_util.h"
@@ -239,7 +240,7 @@
if (encoder.Encode(&toEncode, numEcBytesInBlock)) {
ecBytes = std::vector<uint8_t, FxAllocAllocator<uint8_t>>(
toEncode.begin() + dataBytes.size(), toEncode.end());
- DCHECK(ecBytes.size() == static_cast<size_t>(numEcBytesInBlock));
+ DCHECK_EQ(ecBytes.size(), static_cast<size_t>(numEcBytesInBlock));
}
return ecBytes;
}
diff --git a/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp b/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp
index 4e1d2d3..356e7f5 100644
--- a/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp
@@ -28,6 +28,7 @@
#include "fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h"
#include "fxbarcode/qrcode/BC_QRCoderMaskUtil.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
namespace {
@@ -160,7 +161,7 @@
if (!bits->XOR(&maskBits))
return false;
- DCHECK(bits->Size() == 15);
+ DCHECK_EQ(bits->Size(), 15);
return true;
}
@@ -168,7 +169,7 @@
bits->AppendBits(version, 6);
int32_t bchCode = CalculateBCHCode(version, VERSION_INFO_POLY);
bits->AppendBits(bchCode, 12);
- DCHECK(bits->Size() == 18);
+ DCHECK_EQ(bits->Size(), 18);
}
bool EmbedTypeInfo(const CBC_QRCoderErrorCorrectionLevel* ecLevel,
diff --git a/fxjs/cfxjs_engine.cpp b/fxjs/cfxjs_engine.cpp
index 2905481..adb9a45 100644
--- a/fxjs/cfxjs_engine.cpp
+++ b/fxjs/cfxjs_engine.cpp
@@ -14,6 +14,7 @@
#include "fxjs/fxv8.h"
#include "fxjs/xfa/cfxjse_runtimedata.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
#include "v8/include/v8-util.h"
@@ -169,7 +170,7 @@
return;
}
v8::Local<v8::Object> holder = info.Holder();
- DCHECK(holder->InternalFieldCount() == 2);
+ DCHECK_EQ(holder->InternalFieldCount(), 2);
holder->SetAlignedPointerInInternalField(0, nullptr);
holder->SetAlignedPointerInInternalField(1, nullptr);
}
@@ -276,8 +277,8 @@
void FXJS_Initialize(unsigned int embedderDataSlot, v8::Isolate* pIsolate) {
if (g_isolate) {
- DCHECK(g_embedderDataSlot == embedderDataSlot);
- DCHECK(g_isolate == pIsolate);
+ DCHECK_EQ(g_embedderDataSlot, embedderDataSlot);
+ DCHECK_EQ(g_isolate, pIsolate);
return;
}
g_embedderDataSlot = embedderDataSlot;
diff --git a/fxjs/cjs_runtime.cpp b/fxjs/cjs_runtime.cpp
index b39f698..530b0e7 100644
--- a/fxjs/cjs_runtime.cpp
+++ b/fxjs/cjs_runtime.cpp
@@ -38,7 +38,7 @@
#include "fxjs/cjs_zoomtype.h"
#include "fxjs/fxv8.h"
#include "fxjs/js_define.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
CJS_Runtime::CJS_Runtime(CPDFSDK_FormFillEnvironment* pFormFillEnv)
: m_pFormFillEnv(pFormFillEnv) {
@@ -128,7 +128,7 @@
}
void CJS_Runtime::ReleaseEventContext(IJS_EventContext* pContext) {
- DCHECK(pContext == m_EventContextArray.back().get());
+ DCHECK_EQ(pContext, m_EventContextArray.back().get());
m_EventContextArray.pop_back();
}
diff --git a/fxjs/xfa/cfxjse_class.cpp b/fxjs/xfa/cfxjse_class.cpp
index 376f2f9..cc664cd 100644
--- a/fxjs/xfa/cfxjse_class.cpp
+++ b/fxjs/xfa/cfxjse_class.cpp
@@ -17,6 +17,7 @@
#include "fxjs/xfa/cfxjse_isolatetracker.h"
#include "fxjs/xfa/cfxjse_value.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
using pdfium::fxjse::kClassTag;
using pdfium::fxjse::kFuncTag;
@@ -53,7 +54,7 @@
if (!lpClassDefinition)
return;
- DCHECK(info.Holder()->InternalFieldCount() == 2);
+ DCHECK_EQ(info.Holder()->InternalFieldCount(), 2);
info.Holder()->SetAlignedPointerInInternalField(0, nullptr);
info.Holder()->SetAlignedPointerInInternalField(1, nullptr);
}
diff --git a/fxjs/xfa/cfxjse_context.cpp b/fxjs/xfa/cfxjse_context.cpp
index d45581a..6ffab60 100644
--- a/fxjs/xfa/cfxjse_context.cpp
+++ b/fxjs/xfa/cfxjse_context.cpp
@@ -16,6 +16,7 @@
#include "fxjs/xfa/cfxjse_value.h"
#include "fxjs/xfa/cjx_object.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/ptr_util.h"
#include "xfa/fxfa/parser/cxfa_thisproxy.h"
@@ -110,7 +111,7 @@
void FXJSE_UpdateProxyBinding(v8::Local<v8::Object> hObject) {
DCHECK(!hObject.IsEmpty());
- DCHECK(hObject->InternalFieldCount() == 2);
+ DCHECK_EQ(hObject->InternalFieldCount(), 2);
hObject->SetAlignedPointerInInternalField(
0, const_cast<char*>(kFXJSEProxyObjectTag));
hObject->SetAlignedPointerInInternalField(1, nullptr);
@@ -121,7 +122,7 @@
void FXJSE_UpdateObjectBinding(v8::Local<v8::Object> hObject,
CFXJSE_HostObject* lpNewBinding) {
DCHECK(!hObject.IsEmpty());
- DCHECK(hObject->InternalFieldCount() == 2);
+ DCHECK_EQ(hObject->InternalFieldCount(), 2);
hObject->SetAlignedPointerInInternalField(
0, const_cast<char*>(kFXJSEHostObjectTag));
hObject->SetAlignedPointerInInternalField(1, lpNewBinding);
@@ -129,7 +130,7 @@
void FXJSE_ClearObjectBinding(v8::Local<v8::Object> hObject) {
DCHECK(!hObject.IsEmpty());
- DCHECK(hObject->InternalFieldCount() == 2);
+ DCHECK_EQ(hObject->InternalFieldCount(), 2);
hObject->SetAlignedPointerInInternalField(0, nullptr);
hObject->SetAlignedPointerInInternalField(1, nullptr);
}
diff --git a/fxjs/xfa/cfxjse_resolveprocessor.cpp b/fxjs/xfa/cfxjse_resolveprocessor.cpp
index 34f294b..a045eb6 100644
--- a/fxjs/xfa/cfxjse_resolveprocessor.cpp
+++ b/fxjs/xfa/cfxjse_resolveprocessor.cpp
@@ -16,6 +16,7 @@
#include "fxjs/xfa/cfxjse_value.h"
#include "fxjs/xfa/cjx_object.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
#include "xfa/fxfa/parser/cxfa_document.h"
#include "xfa/fxfa/parser/cxfa_localemgr.h"
@@ -30,7 +31,7 @@
WideString wsCondition,
size_t iFoundCount,
CFXJSE_ResolveNodeData* pRnd) {
- DCHECK(iFoundCount == pRnd->m_Result.objects.size());
+ DCHECK_EQ(iFoundCount, pRnd->m_Result.objects.size());
WideString wsExpression;
CXFA_Script::Type eLangType = CXFA_Script::Type::Unknown;
if (wsCondition.First(2).EqualsASCII(".[") && wsCondition.Back() == L']')
diff --git a/fxjs/xfa/cfxjse_runtimedata.cpp b/fxjs/xfa/cfxjse_runtimedata.cpp
index 561c08d..18b883c 100644
--- a/fxjs/xfa/cfxjse_runtimedata.cpp
+++ b/fxjs/xfa/cfxjse_runtimedata.cpp
@@ -11,7 +11,7 @@
#include "fxjs/cfxjs_engine.h"
#include "fxjs/fxv8.h"
#include "fxjs/xfa/cfxjse_isolatetracker.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
CFXJSE_RuntimeData::CFXJSE_RuntimeData() = default;
@@ -32,11 +32,10 @@
v8::Local<v8::Context> hContext =
v8::Context::New(pIsolate, 0, hGlobalTemplate);
- DCHECK(hContext->Global()->InternalFieldCount() == 0);
- DCHECK(hContext->Global()
- ->GetPrototype()
- .As<v8::Object>()
- ->InternalFieldCount() == 0);
+ DCHECK_EQ(hContext->Global()->InternalFieldCount(), 0);
+ DCHECK_EQ(
+ hContext->Global()->GetPrototype().As<v8::Object>()->InternalFieldCount(),
+ 0);
hContext->SetSecurityToken(v8::External::New(pIsolate, pIsolate));
pRuntimeData->m_hRootContextGlobalTemplate.Reset(pIsolate, hFuncTemplate);
diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp
index c91e90c..c82bddb 100644
--- a/fxjs/xfa/cjx_object.cpp
+++ b/fxjs/xfa/cjx_object.cpp
@@ -23,6 +23,7 @@
#include "fxjs/xfa/cjx_field.h"
#include "fxjs/xfa/cjx_instancemanager.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/compiler_specific.h"
#include "third_party/base/stl_util.h"
#include "xfa/fgas/crt/cfgas_decimal.h"
@@ -563,7 +564,7 @@
}
valueNodes = pBind->GetNodeListForType(XFA_Element::DataValue);
}
- DCHECK(valueNodes.size() == wsSaveTextArray.size());
+ DCHECK_EQ(valueNodes.size(), wsSaveTextArray.size());
size_t i = 0;
for (CXFA_Node* pValueNode : valueNodes) {
pValueNode->JSObject()->SetAttributeValue(wsSaveTextArray[i],
diff --git a/testing/fx_string_testhelpers.cpp b/testing/fx_string_testhelpers.cpp
index 1c057e6..23a8e98 100644
--- a/testing/fx_string_testhelpers.cpp
+++ b/testing/fx_string_testhelpers.cpp
@@ -9,7 +9,7 @@
#include "core/fxcrt/cfx_datetime.h"
#include "core/fxcrt/fx_string.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/span.h"
std::ostream& operator<<(std::ostream& os, const CFX_DateTime& dt) {
@@ -74,6 +74,6 @@
}
std::vector<FPDF_WCHAR> GetFPDFWideStringBuffer(size_t length_bytes) {
- DCHECK(length_bytes % sizeof(FPDF_WCHAR) == 0);
+ DCHECK_EQ(length_bytes % sizeof(FPDF_WCHAR), 0);
return std::vector<FPDF_WCHAR>(length_bytes / sizeof(FPDF_WCHAR));
}
diff --git a/testing/string_write_stream.cpp b/testing/string_write_stream.cpp
index 2a5dbb7..98cf4f7 100644
--- a/testing/string_write_stream.cpp
+++ b/testing/string_write_stream.cpp
@@ -6,7 +6,7 @@
#include "core/fxcrt/bytestring.h"
#include "core/fxcrt/widestring.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
StringWriteStream::StringWriteStream() = default;
@@ -23,7 +23,7 @@
bool StringWriteStream::WriteBlockAtOffset(const void* pData,
FX_FILESIZE offset,
size_t size) {
- DCHECK(offset == 0);
+ DCHECK_EQ(offset, 0);
stream_.write(static_cast<const char*>(pData), size);
return true;
}
diff --git a/testing/xfa_js_embedder_test.cpp b/testing/xfa_js_embedder_test.cpp
index 190ca06..1889756 100644
--- a/testing/xfa_js_embedder_test.cpp
+++ b/testing/xfa_js_embedder_test.cpp
@@ -13,7 +13,7 @@
#include "fxjs/xfa/cfxjse_isolatetracker.h"
#include "fxjs/xfa/cfxjse_value.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
XFAJSEmbedderTest::XFAJSEmbedderTest() = default;
@@ -52,7 +52,7 @@
LinearizeOption linearize_option,
JavaScriptOption javascript_option) {
// JS required for XFA.
- DCHECK(javascript_option == JavaScriptOption::kEnableJavaScript);
+ DCHECK_EQ(javascript_option, JavaScriptOption::kEnableJavaScript);
if (!EmbedderTest::OpenDocumentWithOptions(
filename, password, linearize_option, javascript_option)) {
return false;
diff --git a/xfa/fgas/graphics/cfgas_gecolor.h b/xfa/fgas/graphics/cfgas_gecolor.h
index 8cf2914..76bcbf7 100644
--- a/xfa/fgas/graphics/cfgas_gecolor.h
+++ b/xfa/fgas/graphics/cfgas_gecolor.h
@@ -10,6 +10,7 @@
#include "core/fxcrt/unowned_ptr.h"
#include "core/fxge/dib/fx_dib.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
class CFGAS_GEPattern;
class CFGAS_GEShading;
@@ -30,11 +31,11 @@
return m_argb;
}
CFGAS_GEPattern* GetPattern() const {
- DCHECK(m_type == Pattern);
+ DCHECK_EQ(m_type, Pattern);
return m_pPattern.Get();
}
CFGAS_GEShading* GetShading() const {
- DCHECK(m_type == Shading);
+ DCHECK_EQ(m_type, Shading);
return m_pShading.Get();
}
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp
index ec40e2b..cd68494 100644
--- a/xfa/fxfa/cxfa_ffdocview.cpp
+++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -13,7 +13,7 @@
#include "fxjs/gc/container_trace.h"
#include "fxjs/xfa/cfxjse_engine.h"
#include "fxjs/xfa/cjx_object.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/stl_util.h"
#include "xfa/fxfa/cxfa_ffapp.h"
#include "xfa/fxfa/cxfa_ffbarcode.h"
@@ -506,7 +506,7 @@
}
void CXFA_FFDocView::AddIndexChangedSubform(CXFA_Node* pNode) {
- DCHECK(pNode->GetElementType() == XFA_Element::Subform);
+ DCHECK_EQ(pNode->GetElementType(), XFA_Element::Subform);
if (!pdfium::Contains(m_IndexChangedSubforms, pNode))
m_IndexChangedSubforms.push_back(pNode);
}
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp
index 3d4b219..8f7f144 100644
--- a/xfa/fxfa/parser/cxfa_document.cpp
+++ b/xfa/fxfa/parser/cxfa_document.cpp
@@ -16,6 +16,7 @@
#include "fxjs/xfa/cfxjse_engine.h"
#include "fxjs/xfa/cjx_object.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/compiler_specific.h"
#include "third_party/base/notreached.h"
#include "third_party/base/stl_util.h"
@@ -94,7 +95,7 @@
if (!pValueNode)
return;
- DCHECK(pValueNode->GetPacketType() == XFA_PacketType::Form);
+ DCHECK_EQ(pValueNode->GetPacketType(), XFA_PacketType::Form);
CXFA_Node* pChildNode = FormValueNode_CreateChild(pValueNode, iType);
if (!pChildNode)
return;
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index d3147a2..4cf2090 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -28,6 +28,7 @@
#include "fxjs/xfa/cfxjse_value.h"
#include "fxjs/xfa/cjx_node.h"
#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
#include "third_party/base/compiler_specific.h"
#include "third_party/base/notreached.h"
#include "third_party/base/span.h"
@@ -1253,7 +1254,7 @@
}
CXFA_Node* CXFA_Node::CloneTemplateToForm(bool bRecursive) {
- DCHECK(m_ePacket == XFA_PacketType::Template);
+ DCHECK_EQ(m_ePacket, XFA_PacketType::Template);
CXFA_Node* pClone =
m_pDocument->CreateNode(XFA_PacketType::Form, m_elementType);
if (!pClone)
@@ -1282,7 +1283,7 @@
}
CXFA_Node* CXFA_Node::GetBindData() {
- DCHECK(GetPacketType() == XFA_PacketType::Form);
+ DCHECK_EQ(GetPacketType(), XFA_PacketType::Form);
return GetBindingNode();
}
@@ -1513,7 +1514,7 @@
}
void CXFA_Node::SetDataDescriptionNode(CXFA_Node* pDataDescriptionNode) {
- DCHECK(m_ePacket == XFA_PacketType::Datasets);
+ DCHECK_EQ(m_ePacket, XFA_PacketType::Datasets);
m_pAuxNode = pDataDescriptionNode;
}
@@ -1612,7 +1613,7 @@
return;
}
- DCHECK(pNode->xml_node_ == xml_node_);
+ DCHECK_EQ(pNode->xml_node_, xml_node_);
CFX_XMLElement* pXMLElement = ToXMLElement(pNode->xml_node_.Get());
if (pXMLElement) {
WideString wsAttributeName =
@@ -1778,7 +1779,7 @@
}
void CXFA_Node::SetFlagAndNotify(uint32_t dwFlag) {
- DCHECK(dwFlag == XFA_NodeFlag_Initialized);
+ DCHECK_EQ(dwFlag, XFA_NodeFlag_Initialized);
if (!IsInitialized()) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();