From d539de991cacf02811880c434d4393c8275163d2 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 4 Aug 2015 13:56:45 -0700 Subject: Remove stringify macro (#) from JS_STATIC_CONST_ENTRY_*. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1256283005 . --- fpdfsdk/include/javascript/JS_Define.h | 4 +- fpdfsdk/src/javascript/Consts.cpp | 106 ++++++++++++++++----------------- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h index 0c020b6734..7c3afd7359 100644 --- a/fpdfsdk/include/javascript/JS_Define.h +++ b/fpdfsdk/include/javascript/JS_Define.h @@ -37,10 +37,10 @@ struct JSMethodSpec { #define BEGIN_JS_STATIC_CONST(js_class_name) \ JSConstSpec js_class_name::JS_Class_Consts[] = { #define JS_STATIC_CONST_ENTRY_NUMBER(const_name, pValue) \ - { JS_WIDESTRING(const_name), pValue, L"", 0 } \ + { const_name, pValue, L"", 0 } \ , #define JS_STATIC_CONST_ENTRY_STRING(const_name, pValue) \ - { JS_WIDESTRING(const_name), 0, JS_WIDESTRING(pValue), 1 } \ + { const_name, 0, pValue, 1 } \ , #define END_JS_STATIC_CONST() \ { 0, 0, 0, 0 } \ diff --git a/fpdfsdk/src/javascript/Consts.cpp b/fpdfsdk/src/javascript/Consts.cpp index ca8d787ec0..4529f013fe 100644 --- a/fpdfsdk/src/javascript/Consts.cpp +++ b/fpdfsdk/src/javascript/Consts.cpp @@ -14,11 +14,11 @@ /* ------------------------------ border ------------------------------ */ BEGIN_JS_STATIC_CONST(CJS_Border) -JS_STATIC_CONST_ENTRY_STRING(s, solid) -JS_STATIC_CONST_ENTRY_STRING(b, beveled) -JS_STATIC_CONST_ENTRY_STRING(d, dashed) -JS_STATIC_CONST_ENTRY_STRING(i, inset) -JS_STATIC_CONST_ENTRY_STRING(u, underline) +JS_STATIC_CONST_ENTRY_STRING(L"s", L"solid") +JS_STATIC_CONST_ENTRY_STRING(L"b", L"beveled") +JS_STATIC_CONST_ENTRY_STRING(L"d", L"dashed") +JS_STATIC_CONST_ENTRY_STRING(L"i", L"inset") +JS_STATIC_CONST_ENTRY_STRING(L"u", L"underline") END_JS_STATIC_CONST() IMPLEMENT_JS_CLASS_CONST(CJS_Border, border) @@ -26,10 +26,10 @@ IMPLEMENT_JS_CLASS_CONST(CJS_Border, border) /* ------------------------------ display ------------------------------ */ BEGIN_JS_STATIC_CONST(CJS_Display) -JS_STATIC_CONST_ENTRY_NUMBER(visible, 0) -JS_STATIC_CONST_ENTRY_NUMBER(hidden, 1) -JS_STATIC_CONST_ENTRY_NUMBER(noPrint, 2) -JS_STATIC_CONST_ENTRY_NUMBER(noView, 3) +JS_STATIC_CONST_ENTRY_NUMBER(L"visible", 0) +JS_STATIC_CONST_ENTRY_NUMBER(L"hidden", 1) +JS_STATIC_CONST_ENTRY_NUMBER(L"noPrint", 2) +JS_STATIC_CONST_ENTRY_NUMBER(L"noView", 3) END_JS_STATIC_CONST() IMPLEMENT_JS_CLASS_CONST(CJS_Display, display) @@ -37,20 +37,20 @@ IMPLEMENT_JS_CLASS_CONST(CJS_Display, display) /* ------------------------------ font ------------------------------ */ BEGIN_JS_STATIC_CONST(CJS_Font) -JS_STATIC_CONST_ENTRY_STRING(Times, Times-Roman) -JS_STATIC_CONST_ENTRY_STRING(TimesB, Times-Bold) -JS_STATIC_CONST_ENTRY_STRING(TimesI, Times-Italic) -JS_STATIC_CONST_ENTRY_STRING(TimesBI, Times-BoldItalic) -JS_STATIC_CONST_ENTRY_STRING(Helv, Helvetica) -JS_STATIC_CONST_ENTRY_STRING(HelvB, Helvetica-Bold) -JS_STATIC_CONST_ENTRY_STRING(HelvI, Helvetica-Oblique) -JS_STATIC_CONST_ENTRY_STRING(HelvBI, Helvetica-BoldOblique) -JS_STATIC_CONST_ENTRY_STRING(Cour, Courier) -JS_STATIC_CONST_ENTRY_STRING(CourB, Courier-Bold) -JS_STATIC_CONST_ENTRY_STRING(CourI, Courier-Oblique) -JS_STATIC_CONST_ENTRY_STRING(CourBI, Courier-BoldOblique) -JS_STATIC_CONST_ENTRY_STRING(Symbol, Symbol) -JS_STATIC_CONST_ENTRY_STRING(ZapfD, ZapfDingbats) +JS_STATIC_CONST_ENTRY_STRING(L"Times", L"Times-Roman") +JS_STATIC_CONST_ENTRY_STRING(L"TimesB", L"Times-Bold") +JS_STATIC_CONST_ENTRY_STRING(L"TimesI", L"Times-Italic") +JS_STATIC_CONST_ENTRY_STRING(L"TimesBI", L"Times-BoldItalic") +JS_STATIC_CONST_ENTRY_STRING(L"Helv", L"Helvetica") +JS_STATIC_CONST_ENTRY_STRING(L"HelvB", L"Helvetica-Bold") +JS_STATIC_CONST_ENTRY_STRING(L"HelvI", L"Helvetica-Oblique") +JS_STATIC_CONST_ENTRY_STRING(L"HelvBI", L"Helvetica-BoldOblique") +JS_STATIC_CONST_ENTRY_STRING(L"Cour", L"Courier") +JS_STATIC_CONST_ENTRY_STRING(L"CourB", L"Courier-Bold") +JS_STATIC_CONST_ENTRY_STRING(L"CourI", L"Courier-Oblique") +JS_STATIC_CONST_ENTRY_STRING(L"CourBI", L"Courier-BoldOblique") +JS_STATIC_CONST_ENTRY_STRING(L"Symbol", L"Symbol") +JS_STATIC_CONST_ENTRY_STRING(L"ZapfD", L"ZapfDingbats") END_JS_STATIC_CONST() IMPLEMENT_JS_CLASS_CONST(CJS_Font, font) @@ -58,10 +58,10 @@ IMPLEMENT_JS_CLASS_CONST(CJS_Font, font) /* ------------------------------ highlight ------------------------------ */ BEGIN_JS_STATIC_CONST(CJS_Highlight) -JS_STATIC_CONST_ENTRY_STRING(n, none) -JS_STATIC_CONST_ENTRY_STRING(i, invert) -JS_STATIC_CONST_ENTRY_STRING(p, push) -JS_STATIC_CONST_ENTRY_STRING(o, outline) +JS_STATIC_CONST_ENTRY_STRING(L"n", L"none") +JS_STATIC_CONST_ENTRY_STRING(L"i", L"invert") +JS_STATIC_CONST_ENTRY_STRING(L"p", L"push") +JS_STATIC_CONST_ENTRY_STRING(L"o", L"outline") END_JS_STATIC_CONST() IMPLEMENT_JS_CLASS_CONST(CJS_Highlight, highlight) @@ -69,13 +69,13 @@ IMPLEMENT_JS_CLASS_CONST(CJS_Highlight, highlight) /* ------------------------------ position ------------------------------ */ BEGIN_JS_STATIC_CONST(CJS_Position) -JS_STATIC_CONST_ENTRY_NUMBER(textOnly, 0) -JS_STATIC_CONST_ENTRY_NUMBER(iconOnly, 1) -JS_STATIC_CONST_ENTRY_NUMBER(iconTextV, 2) -JS_STATIC_CONST_ENTRY_NUMBER(textIconV, 3) -JS_STATIC_CONST_ENTRY_NUMBER(iconTextH, 4) -JS_STATIC_CONST_ENTRY_NUMBER(textIconH, 5) -JS_STATIC_CONST_ENTRY_NUMBER(overlay, 6) +JS_STATIC_CONST_ENTRY_NUMBER(L"textOnly", 0) +JS_STATIC_CONST_ENTRY_NUMBER(L"iconOnly", 1) +JS_STATIC_CONST_ENTRY_NUMBER(L"iconTextV", 2) +JS_STATIC_CONST_ENTRY_NUMBER(L"textIconV", 3) +JS_STATIC_CONST_ENTRY_NUMBER(L"iconTextH", 4) +JS_STATIC_CONST_ENTRY_NUMBER(L"textIconH", 5) +JS_STATIC_CONST_ENTRY_NUMBER(L"overlay", 6) END_JS_STATIC_CONST() IMPLEMENT_JS_CLASS_CONST(CJS_Position, position) @@ -83,8 +83,8 @@ IMPLEMENT_JS_CLASS_CONST(CJS_Position, position) /* ------------------------------ scaleHow ------------------------------ */ BEGIN_JS_STATIC_CONST(CJS_ScaleHow) -JS_STATIC_CONST_ENTRY_NUMBER(proportional, 0) -JS_STATIC_CONST_ENTRY_NUMBER(anamorphic, 1) +JS_STATIC_CONST_ENTRY_NUMBER(L"proportional", 0) +JS_STATIC_CONST_ENTRY_NUMBER(L"anamorphic", 1) END_JS_STATIC_CONST() IMPLEMENT_JS_CLASS_CONST(CJS_ScaleHow, scaleHow) @@ -92,10 +92,10 @@ IMPLEMENT_JS_CLASS_CONST(CJS_ScaleHow, scaleHow) /* ------------------------------ scaleWhen ------------------------------ */ BEGIN_JS_STATIC_CONST(CJS_ScaleWhen) -JS_STATIC_CONST_ENTRY_NUMBER(always, 0) -JS_STATIC_CONST_ENTRY_NUMBER(never, 1) -JS_STATIC_CONST_ENTRY_NUMBER(tooBig, 2) -JS_STATIC_CONST_ENTRY_NUMBER(tooSmall, 3) +JS_STATIC_CONST_ENTRY_NUMBER(L"always", 0) +JS_STATIC_CONST_ENTRY_NUMBER(L"never", 1) +JS_STATIC_CONST_ENTRY_NUMBER(L"tooBig", 2) +JS_STATIC_CONST_ENTRY_NUMBER(L"tooSmall", 3) END_JS_STATIC_CONST() IMPLEMENT_JS_CLASS_CONST(CJS_ScaleWhen, scaleWhen) @@ -103,12 +103,12 @@ IMPLEMENT_JS_CLASS_CONST(CJS_ScaleWhen, scaleWhen) /* ------------------------------ style ------------------------------ */ BEGIN_JS_STATIC_CONST(CJS_Style) -JS_STATIC_CONST_ENTRY_STRING(ch, check) -JS_STATIC_CONST_ENTRY_STRING(cr, cross) -JS_STATIC_CONST_ENTRY_STRING(di, diamond) -JS_STATIC_CONST_ENTRY_STRING(ci, circle) -JS_STATIC_CONST_ENTRY_STRING(st, star) -JS_STATIC_CONST_ENTRY_STRING(sq, square) +JS_STATIC_CONST_ENTRY_STRING(L"ch", L"check") +JS_STATIC_CONST_ENTRY_STRING(L"cr", L"cross") +JS_STATIC_CONST_ENTRY_STRING(L"di", L"diamond") +JS_STATIC_CONST_ENTRY_STRING(L"ci", L"circle") +JS_STATIC_CONST_ENTRY_STRING(L"st", L"star") +JS_STATIC_CONST_ENTRY_STRING(L"sq", L"square") END_JS_STATIC_CONST() IMPLEMENT_JS_CLASS_CONST(CJS_Style, style) @@ -116,13 +116,13 @@ IMPLEMENT_JS_CLASS_CONST(CJS_Style, style) /* ------------------------------ zoomtype ------------------------------ */ BEGIN_JS_STATIC_CONST(CJS_Zoomtype) -JS_STATIC_CONST_ENTRY_STRING(none, NoVary) -JS_STATIC_CONST_ENTRY_STRING(fitP, FitPage) -JS_STATIC_CONST_ENTRY_STRING(fitW, FitWidth) -JS_STATIC_CONST_ENTRY_STRING(fitH, FitHeight) -JS_STATIC_CONST_ENTRY_STRING(fitV, FitVisibleWidth) -JS_STATIC_CONST_ENTRY_STRING(pref, Preferred) -JS_STATIC_CONST_ENTRY_STRING(refW, ReflowWidth) +JS_STATIC_CONST_ENTRY_STRING(L"none", L"NoVary") +JS_STATIC_CONST_ENTRY_STRING(L"fitP", L"FitPage") +JS_STATIC_CONST_ENTRY_STRING(L"fitW", L"FitWidth") +JS_STATIC_CONST_ENTRY_STRING(L"fitH", L"FitHeight") +JS_STATIC_CONST_ENTRY_STRING(L"fitV", L"FitVisibleWidth") +JS_STATIC_CONST_ENTRY_STRING(L"pref", L"Preferred") +JS_STATIC_CONST_ENTRY_STRING(L"refW", L"ReflowWidth") END_JS_STATIC_CONST() IMPLEMENT_JS_CLASS_CONST(CJS_Zoomtype, zoomtype) -- cgit v1.2.3