0

Move more static asserts into pdfium_assert_matching_enums.cc.

There are a few static_assert() calls in pdfium_engine.cc. Consolidate
them into pdfium_assert_matching_enums.cc.

Change-Id: Ica2328418fd6e73d8cdc1390b53bccb8bf006386
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220332
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772938}
This commit is contained in:
Lei Zhang
2020-05-28 23:33:35 +00:00
committed by Commit Bot
parent b8bef94084
commit 60bd1e720e
2 changed files with 11 additions and 14 deletions

@ -4,10 +4,12 @@
#include "build/build_config.h"
#include "pdf/pdf.h"
#include "pdf/pdf_engine.h"
#include "ppapi/c/pp_input_event.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppp_pdf.h"
#include "third_party/pdfium/public/fpdf_edit.h"
#include "third_party/pdfium/public/fpdf_formfill.h"
#include "third_party/pdfium/public/fpdf_fwlevent.h"
#include "third_party/pdfium/public/fpdf_sysfontinfo.h"
#include "third_party/pdfium/public/fpdfview.h"
@ -229,6 +231,15 @@ STATIC_ASSERT_ENUM(PP_TEXTRENDERINGMODE_FILLSTROKECLIP,
FPDF_TEXTRENDERMODE_FILL_STROKE_CLIP);
STATIC_ASSERT_ENUM(PP_TEXTRENDERINGMODE_CLIP, FPDF_TEXTRENDERMODE_CLIP);
STATIC_ASSERT_ENUM(chrome_pdf::PDFEngine::FormType::kNone, FORMTYPE_NONE);
STATIC_ASSERT_ENUM(chrome_pdf::PDFEngine::FormType::kAcroForm,
FORMTYPE_ACRO_FORM);
STATIC_ASSERT_ENUM(chrome_pdf::PDFEngine::FormType::kXFAFull,
FORMTYPE_XFA_FULL);
STATIC_ASSERT_ENUM(chrome_pdf::PDFEngine::FormType::kXFAForeground,
FORMTYPE_XFA_FOREGROUND);
STATIC_ASSERT_ENUM(chrome_pdf::PDFEngine::FormType::kCount, FORMTYPE_COUNT);
#if defined(OS_WIN)
STATIC_ASSERT_ENUM(chrome_pdf::kEmf, FPDF_PRINTMODE_EMF);
STATIC_ASSERT_ENUM(chrome_pdf::kTextOnly, FPDF_PRINTMODE_TEXTONLY);

@ -68,20 +68,6 @@ using printing::kPixelsPerInch;
namespace chrome_pdf {
static_assert(static_cast<int>(PDFEngine::FormType::kNone) == FORMTYPE_NONE,
"None form types must match");
static_assert(static_cast<int>(PDFEngine::FormType::kAcroForm) ==
FORMTYPE_ACRO_FORM,
"AcroForm form types must match");
static_assert(static_cast<int>(PDFEngine::FormType::kXFAFull) ==
FORMTYPE_XFA_FULL,
"XFA full form types must match");
static_assert(static_cast<int>(PDFEngine::FormType::kXFAForeground) ==
FORMTYPE_XFA_FOREGROUND,
"XFA foreground form types must match");
static_assert(static_cast<int>(PDFEngine::FormType::kCount) == FORMTYPE_COUNT,
"Form type counts must match");
namespace {
constexpr int32_t kHighlightColorR = 153;