Skip to content

Commit

Permalink
Move more static asserts into pdfium_assert_matching_enums.cc.
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
leizleiz authored and Commit Bot committed May 28, 2020
1 parent b8bef94 commit 60bd1e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
11 changes: 11 additions & 0 deletions pdf/pdfium/pdfium_assert_matching_enums.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
14 changes: 0 additions & 14 deletions pdf/pdfium/pdfium_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60bd1e7

Please sign in to comment.