From 893fe94f069656ef5106db1aec32ec11b85f4de2 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Fri, 14 Nov 2014 17:03:50 -0800 Subject: Remove FX_LPCWSTR cast to wchar_t* literals BUG=https://code.google.com/p/pdfium/issues/detail?id=78 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/726143002 --- core/src/fpdfdoc/doc_basic.cpp | 4 +- core/src/fxcrt/fx_basic_wstring.cpp | 4 +- core/src/fxcrt/fx_xml_parser.cpp | 4 +- fpdfsdk/src/javascript/Consts.cpp | 76 +++++++++++++-------------- fpdfsdk/src/javascript/Document.cpp | 12 ++--- fpdfsdk/src/javascript/Field.cpp | 60 ++++++++++----------- fpdfsdk/src/javascript/JS_Context.cpp | 2 +- fpdfsdk/src/javascript/JS_EventHandler.cpp | 84 +++++++++++++++--------------- fpdfsdk/src/javascript/JS_Runtime.cpp | 2 +- fpdfsdk/src/javascript/PublicMethods.cpp | 62 +++++++++++----------- fpdfsdk/src/javascript/app.cpp | 6 +-- fpdfsdk/src/javascript/util.cpp | 76 +++++++++++++-------------- fpdfsdk/src/pdfwindow/PWL_Note.cpp | 2 +- 13 files changed, 197 insertions(+), 197 deletions(-) diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp index 5ccf4ceee9..459ae87a0a 100644 --- a/core/src/fpdfdoc/doc_basic.cpp +++ b/core/src/fpdfdoc/doc_basic.cpp @@ -488,7 +488,7 @@ static CFX_WideString _GetLabelNumPortion(int num, const CFX_ByteString& bsStyle return wsNumPortion; } if (bsStyle == "D") { - wsNumPortion.Format((FX_LPCWSTR)L"%d", num); + wsNumPortion.Format(L"%d", num); } else if (bsStyle == "R") { wsNumPortion = _MakeRoman(num); wsNumPortion.MakeUpper(); @@ -537,7 +537,7 @@ CFX_WideString CPDF_PageLabel::GetLabel(int nPage) const return wsLabel; } } - wsLabel.Format((FX_LPCWSTR)L"%d", nPage + 1); + wsLabel.Format(L"%d", nPage + 1); return wsLabel; } FX_INT32 CPDF_PageLabel::GetPageByLabel(FX_BSTR bsLabel) const diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp index 794630b9e5..3a13d59054 100644 --- a/core/src/fxcrt/fx_basic_wstring.cpp +++ b/core/src/fxcrt/fx_basic_wstring.cpp @@ -829,7 +829,7 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList) ; } if (nWidth < 0 || nWidth > 128 * 1024) { - lpszFormat = (FX_LPCWSTR)L"Bad width"; + lpszFormat = L"Bad width"; nMaxLen = 10; break; } @@ -846,7 +846,7 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList) } } if (nPrecision < 0 || nPrecision > 128 * 1024) { - lpszFormat = (FX_LPCWSTR)L"Bad precision"; + lpszFormat = L"Bad precision"; nMaxLen = 14; break; } diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp index 05fc7d5fbe..3608a74a93 100644 --- a/core/src/fxcrt/fx_xml_parser.cpp +++ b/core/src/fxcrt/fx_xml_parser.cpp @@ -472,7 +472,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag content << decoder.GetResult(); CFX_WideString dataStr = content.GetWideString(); if (!bCDATA && !m_bSaveSpaceChars) { - dataStr.TrimRight((FX_LPCWSTR)L" \t\r\n"); + dataStr.TrimRight(L" \t\r\n"); } InsertContentSegment(bCDATA, dataStr, pElement); content.Clear(); @@ -516,7 +516,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag content << decoder.GetResult(); CFX_WideString dataStr = content.GetWideString(); if (!m_bSaveSpaceChars) { - dataStr.TrimRight((FX_LPCWSTR)L" \t\r\n"); + dataStr.TrimRight(L" \t\r\n"); } InsertContentSegment(bCDATA, dataStr, pElement); content.Clear(); diff --git a/fpdfsdk/src/javascript/Consts.cpp b/fpdfsdk/src/javascript/Consts.cpp index 278cd7eab8..1b1c8babcb 100644 --- a/fpdfsdk/src/javascript/Consts.cpp +++ b/fpdfsdk/src/javascript/Consts.cpp @@ -151,94 +151,94 @@ int CJS_GlobalConsts::Init(IJS_Runtime* pRuntime) int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime) { { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_ENTRY_DOT_SEP"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d*\\.?\\d*"}; + FX_LPCWSTR ArrayName = L"RE_NUMBER_ENTRY_DOT_SEP"; + FX_LPCWSTR ArrayContent[] = {L"[+-]?\\d*\\.?\\d*"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_COMMIT_DOT_SEP"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d+(\\.\\d+)?", /* -1.0 or -1 */ - (FX_LPCWSTR)L"[+-]?\\.\\d+", /* -.1 */ - (FX_LPCWSTR)L"[+-]?\\d+\\." /* -1. */ - }; + FX_LPCWSTR ArrayName = L"RE_NUMBER_COMMIT_DOT_SEP"; + FX_LPCWSTR ArrayContent[] = { L"[+-]?\\d+(\\.\\d+)?", /* -1.0 or -1 */ + L"[+-]?\\.\\d+", /* -.1 */ + L"[+-]?\\d+\\." /* -1. */ + }; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_ENTRY_COMMA_SEP"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d*,?\\d*"}; + FX_LPCWSTR ArrayName = L"RE_NUMBER_ENTRY_COMMA_SEP"; + FX_LPCWSTR ArrayContent[] = {L"[+-]?\\d*,?\\d*"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_COMMIT_COMMA_SEP"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d+([.,]\\d+)?", /* -1,0 or -1 */ - (FX_LPCWSTR)L"[+-]?[.,]\\d+", /* -,1 */ - (FX_LPCWSTR)L"[+-]?\\d+[.,]" /* -1, */ - }; + FX_LPCWSTR ArrayName = L"RE_NUMBER_COMMIT_COMMA_SEP"; + FX_LPCWSTR ArrayContent[] = { L"[+-]?\\d+([.,]\\d+)?", /* -1,0 or -1 */ + L"[+-]?[.,]\\d+", /* -,1 */ + L"[+-]?\\d+[.,]" /* -1, */ + }; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP_ENTRY"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{0,5}"}; + FX_LPCWSTR ArrayName = L"RE_ZIP_ENTRY"; + FX_LPCWSTR ArrayContent[] = {L"\\d{0,5}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP_COMMIT"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{5}"}; + FX_LPCWSTR ArrayName = L"RE_ZIP_COMMIT"; + FX_LPCWSTR ArrayContent[] = {L"\\d{5}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP4_ENTRY"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{0,5}(\\.|[- ])?\\d{0,4}"}; + FX_LPCWSTR ArrayName = L"RE_ZIP4_ENTRY"; + FX_LPCWSTR ArrayContent[] = {L"\\d{0,5}(\\.|[- ])?\\d{0,4}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP4_COMMIT"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{5}(\\.|[- ])?\\d{4}"}; + FX_LPCWSTR ArrayName = L"RE_ZIP4_COMMIT"; + FX_LPCWSTR ArrayContent[] = {L"\\d{5}(\\.|[- ])?\\d{4}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_PHONE_ENTRY"; + FX_LPCWSTR ArrayName = L"RE_PHONE_ENTRY"; FX_LPCWSTR ArrayContent[] = { - (FX_LPCWSTR)L"\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 555-1234 or 408 555-1234 */ - (FX_LPCWSTR)L"\\(\\d{0,3}", /* (408 */ - (FX_LPCWSTR)L"\\(\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408) 555-1234 */ + L"\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 555-1234 or 408 555-1234 */ + L"\\(\\d{0,3}", /* (408 */ + L"\\(\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408) 555-1234 */ /* (allow the addition of parens as an afterthought) */ - (FX_LPCWSTR)L"\\(\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408 555-1234 */ - (FX_LPCWSTR)L"\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 408) 555-1234 */ - (FX_LPCWSTR)L"011(\\.|[- \\d])*" /* international */ + L"\\(\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408 555-1234 */ + L"\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 408) 555-1234 */ + L"011(\\.|[- \\d])*" /* international */ }; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_PHONE_COMMIT"; + FX_LPCWSTR ArrayName = L"RE_PHONE_COMMIT"; FX_LPCWSTR ArrayContent[] = { - (FX_LPCWSTR)L"\\d{3}(\\.|[- ])?\\d{4}", /* 555-1234 */ - (FX_LPCWSTR)L"\\d{3}(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* 408 555-1234 */ - (FX_LPCWSTR)L"\\(\\d{3}\\)(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* (408) 555-1234 */ - (FX_LPCWSTR)L"011(\\.|[- \\d])*" /* international */ + L"\\d{3}(\\.|[- ])?\\d{4}", /* 555-1234 */ + L"\\d{3}(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* 408 555-1234 */ + L"\\(\\d{3}\\)(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* (408) 555-1234 */ + L"011(\\.|[- \\d])*" /* international */ }; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_SSN_ENTRY"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"}; + FX_LPCWSTR ArrayName = L"RE_SSN_ENTRY"; + FX_LPCWSTR ArrayContent[] = {L"\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_SSN_COMMIT"; - FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"}; + FX_LPCWSTR ArrayName = L"RE_SSN_COMMIT"; + FX_LPCWSTR ArrayContent[] = {L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 229d9770a1..933ba29f68 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -336,7 +336,7 @@ FX_BOOL Document::exportAsFDF(OBJ_METHOD_PARAMS) if (!bWhole) arrayFileds.Attach(params[2]); //FX_BOOL bFlags = params.size() > 3 ? (FX_BOOL)params[3] : FALSE; - CFX_WideString swFilePath = params.size() > 4 ? (FX_LPCWSTR)params[4].operator CFX_WideString() : (FX_LPCWSTR)L""; + CFX_WideString swFilePath = params.size() > 4 ? (FX_LPCWSTR)params[4].operator CFX_WideString() : L""; if (swFilePath.IsEmpty()) { @@ -584,11 +584,11 @@ FX_BOOL Document::mailForm(OBJ_METHOD_PARAMS) int iLength = params.size(); FX_BOOL bUI = iLength > 0 ? (FX_BOOL)params[0] : TRUE; - CFX_WideString cTo = iLength > 1 ? (FX_LPCWSTR)params[1].operator CFX_WideString() : (FX_LPCWSTR)L""; - CFX_WideString cCc = iLength > 2 ? (FX_LPCWSTR)params[2].operator CFX_WideString() : (FX_LPCWSTR)L""; - CFX_WideString cBcc = iLength > 3 ? (FX_LPCWSTR)params[3].operator CFX_WideString() : (FX_LPCWSTR)L""; - CFX_WideString cSubject = iLength > 4 ? (FX_LPCWSTR)params[4].operator CFX_WideString() : (FX_LPCWSTR)L""; - CFX_WideString cMsg = iLength > 5 ? (FX_LPCWSTR)params[5].operator CFX_WideString() : (FX_LPCWSTR)L""; + CFX_WideString cTo = iLength > 1 ? (FX_LPCWSTR)params[1].operator CFX_WideString() : L""; + CFX_WideString cCc = iLength > 2 ? (FX_LPCWSTR)params[2].operator CFX_WideString() : L""; + CFX_WideString cBcc = iLength > 3 ? (FX_LPCWSTR)params[3].operator CFX_WideString() : L""; + CFX_WideString cSubject = iLength > 4 ? (FX_LPCWSTR)params[4].operator CFX_WideString() : L""; + CFX_WideString cMsg = iLength > 5 ? (FX_LPCWSTR)params[5].operator CFX_WideString() : L""; CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm(); ASSERT(pInterForm != NULL); diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index f5f9bf0539..73a4e0a959 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -188,7 +188,7 @@ FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldNam ASSERT(pInterForm != NULL); CFX_WideString swFieldNameTemp = csFieldName; - swFieldNameTemp.Replace((FX_LPCWSTR)L"..", (FX_LPCWSTR)L"."); + swFieldNameTemp.Replace(L"..", L"."); if (pInterForm->CountFields(swFieldNameTemp) <= 0) { @@ -415,16 +415,16 @@ FX_BOOL Field::alignment(OBJ_PROP_PARAMS) switch (pFormControl->GetControlAlignment()) { case 1: - vp << (FX_LPCWSTR)L"center"; + vp << L"center"; break; case 0: - vp << (FX_LPCWSTR)L"left"; + vp << L"left"; break; case 2: - vp << (FX_LPCWSTR)L"right"; + vp << L"right"; break; default: - vp << (FX_LPCWSTR)L""; + vp << L""; } } @@ -474,22 +474,22 @@ FX_BOOL Field::borderStyle(OBJ_PROP_PARAMS) switch (nBorderstyle) { case BBS_SOLID: - vp << (FX_LPCWSTR)L"solid"; + vp << L"solid"; break; case BBS_DASH: - vp << (FX_LPCWSTR)L"dashed"; + vp << L"dashed"; break; case BBS_BEVELED: - vp << (FX_LPCWSTR)L"beveled"; + vp << L"beveled"; break; case BBS_INSET: - vp << (FX_LPCWSTR)L"inset"; + vp << L"inset"; break; case BBS_UNDERLINE: - vp << (FX_LPCWSTR)L"underline"; + vp << L"underline"; break; default: - vp << (FX_LPCWSTR)L""; + vp << L""; break; } } @@ -1872,19 +1872,19 @@ FX_BOOL Field::highlight(OBJ_PROP_PARAMS) switch (eHM) { case CPDF_FormControl::None: - vp << (FX_LPCWSTR)L"none"; + vp << L"none"; break; case CPDF_FormControl::Push: - vp << (FX_LPCWSTR)L"push"; + vp << L"push"; break; case CPDF_FormControl::Invert: - vp << (FX_LPCWSTR)L"invert"; + vp << L"invert"; break; case CPDF_FormControl::Outline: - vp << (FX_LPCWSTR)L"outline"; + vp << L"outline"; break; case CPDF_FormControl::Toggle: - vp << (FX_LPCWSTR)L"toggle"; + vp << L"toggle"; break; } } @@ -3000,31 +3000,31 @@ FX_BOOL Field::type(OBJ_PROP_PARAMS) switch (pFormField->GetFieldType()) { case FIELDTYPE_UNKNOWN: - vp << (FX_LPCWSTR)L"unknown"; + vp << L"unknown"; break; case FIELDTYPE_PUSHBUTTON: - vp << (FX_LPCWSTR)L"button"; + vp << L"button"; break; case FIELDTYPE_CHECKBOX: - vp << (FX_LPCWSTR)L"checkbox"; + vp << L"checkbox"; break; case FIELDTYPE_RADIOBUTTON: - vp << (FX_LPCWSTR)L"radiobutton"; + vp << L"radiobutton"; break; case FIELDTYPE_COMBOBOX: - vp << (FX_LPCWSTR)L"combobox"; + vp << L"combobox"; break; case FIELDTYPE_LISTBOX: - vp << (FX_LPCWSTR)L"listbox"; + vp << L"listbox"; break; case FIELDTYPE_TEXTFIELD: - vp << (FX_LPCWSTR)L"text"; + vp << L"text"; break; case FIELDTYPE_SIGNATURE: - vp << (FX_LPCWSTR)L"signature"; + vp << L"signature"; break; default : - vp << (FX_LPCWSTR)L"unknown"; + vp << L"unknown"; break; } @@ -3206,7 +3206,7 @@ FX_BOOL Field::value(OBJ_PROP_PARAMS) continue; } if (!bFind) - vp << (FX_LPCWSTR)L"Off"; + vp << L"Off"; } break; default: @@ -3312,9 +3312,9 @@ FX_BOOL Field::valueAsString(OBJ_PROP_PARAMS) if(!pFormField->CountControls()) return FALSE; if (pFormField->GetControl(0)->IsChecked()) - vp << (FX_LPCWSTR)L"Yes"; + vp << L"Yes"; else - vp << (FX_LPCWSTR)L"Off"; + vp << L"Off"; } else if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON && !(pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON)) { @@ -3326,12 +3326,12 @@ FX_BOOL Field::valueAsString(OBJ_PROP_PARAMS) break; } else - vp << (FX_LPCWSTR)L"Off"; + vp << L"Off"; } } else if (pFormField->GetFieldType() == FIELDTYPE_LISTBOX && (pFormField->CountSelectedItems() > 1)) { - vp << (FX_LPCWSTR)L""; + vp << L""; } else vp << (FX_LPCWSTR)pFormField->GetValue(); diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp index a83e1e057d..bdcb1ac542 100644 --- a/fpdfsdk/src/javascript/JS_Context.cpp +++ b/fpdfsdk/src/javascript/JS_Context.cpp @@ -83,7 +83,7 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri if (nRet < 0) { CFX_WideString sLine; - sLine.Format((FX_LPCWSTR)L"[ Line: %05d { %s } ] : %s",error.linnum-1,error.srcline,error.message); + sLine.Format(L"[ Line: %05d { %s } ] : %s",error.linnum-1,error.srcline,error.message); // TRACE(L"/* -------------- JS Error -------------- */\n"); // TRACE(sLine); diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp index 76c6d37f03..cf59ed9c86 100644 --- a/fpdfsdk/src/javascript/JS_EventHandler.cpp +++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp @@ -465,65 +465,65 @@ FX_LPCWSTR CJS_EventHandler::Name() { switch (m_eEventType) { - case JET_APP_INIT: return (FX_LPCWSTR)L"Init"; - case JET_BATCH_EXEC: return (FX_LPCWSTR)L"Exec"; - case JET_BOOKMARK_MOUSEUP: return (FX_LPCWSTR)L"Mouse Up"; - case JET_CONSOLE_EXEC: return (FX_LPCWSTR)L"Exec"; - case JET_DOC_DIDPRINT: return (FX_LPCWSTR)L"DidPrint"; - case JET_DOC_DIDSAVE: return (FX_LPCWSTR)L"DidSave"; - case JET_DOC_OPEN: return (FX_LPCWSTR)L"Open"; - case JET_DOC_WILLCLOSE: return (FX_LPCWSTR)L"WillClose"; - case JET_DOC_WILLPRINT: return (FX_LPCWSTR)L"WillPrint"; - case JET_DOC_WILLSAVE: return (FX_LPCWSTR)L"WillSave"; - case JET_EXTERNAL_EXEC: return (FX_LPCWSTR)L"Exec"; + case JET_APP_INIT: return L"Init"; + case JET_BATCH_EXEC: return L"Exec"; + case JET_BOOKMARK_MOUSEUP: return L"Mouse Up"; + case JET_CONSOLE_EXEC: return L"Exec"; + case JET_DOC_DIDPRINT: return L"DidPrint"; + case JET_DOC_DIDSAVE: return L"DidSave"; + case JET_DOC_OPEN: return L"Open"; + case JET_DOC_WILLCLOSE: return L"WillClose"; + case JET_DOC_WILLPRINT: return L"WillPrint"; + case JET_DOC_WILLSAVE: return L"WillSave"; + case JET_EXTERNAL_EXEC: return L"Exec"; case JET_FIELD_FOCUS: - case JET_SCREEN_FOCUS: return (FX_LPCWSTR)L"Focus"; + case JET_SCREEN_FOCUS: return L"Focus"; case JET_FIELD_BLUR: - case JET_SCREEN_BLUR: return (FX_LPCWSTR)L"Blur"; + case JET_SCREEN_BLUR: return L"Blur"; case JET_FIELD_MOUSEDOWN: - case JET_SCREEN_MOUSEDOWN: return (FX_LPCWSTR)L"Mouse Down"; + case JET_SCREEN_MOUSEDOWN: return L"Mouse Down"; case JET_FIELD_MOUSEUP: - case JET_SCREEN_MOUSEUP: return (FX_LPCWSTR)L"Mouse Up"; + case JET_SCREEN_MOUSEUP: return L"Mouse Up"; case JET_FIELD_MOUSEENTER: - case JET_SCREEN_MOUSEENTER: return (FX_LPCWSTR)L"Mouse Enter"; + case JET_SCREEN_MOUSEENTER: return L"Mouse Enter"; case JET_FIELD_MOUSEEXIT: - case JET_SCREEN_MOUSEEXIT: return (FX_LPCWSTR)L"Mouse Exit"; - case JET_FIELD_CALCULATE: return (FX_LPCWSTR)L"Calculate"; - case JET_FIELD_FORMAT: return (FX_LPCWSTR)L"Format"; - case JET_FIELD_KEYSTROKE: return (FX_LPCWSTR)L"Keystroke"; - case JET_FIELD_VALIDATE: return (FX_LPCWSTR)L"Validate"; - case JET_LINK_MOUSEUP: return (FX_LPCWSTR)L"Mouse Up"; - case JET_MENU_EXEC: return (FX_LPCWSTR)L"Exec"; + case JET_SCREEN_MOUSEEXIT: return L"Mouse Exit"; + case JET_FIELD_CALCULATE: return L"Calculate"; + case JET_FIELD_FORMAT: return L"Format"; + case JET_FIELD_KEYSTROKE: return L"Keystroke"; + case JET_FIELD_VALIDATE: return L"Validate"; + case JET_LINK_MOUSEUP: return L"Mouse Up"; + case JET_MENU_EXEC: return L"Exec"; case JET_PAGE_OPEN: - case JET_SCREEN_OPEN: return (FX_LPCWSTR)L"Open"; + case JET_SCREEN_OPEN: return L"Open"; case JET_PAGE_CLOSE: - case JET_SCREEN_CLOSE: return (FX_LPCWSTR)L"Close"; + case JET_SCREEN_CLOSE: return L"Close"; case JET_SCREEN_INVIEW: - case JET_PAGE_INVIEW: return (FX_LPCWSTR)L"InView"; + case JET_PAGE_INVIEW: return L"InView"; case JET_PAGE_OUTVIEW: - case JET_SCREEN_OUTVIEW: return (FX_LPCWSTR)L"OutView"; + case JET_SCREEN_OUTVIEW: return L"OutView"; default: - return (FX_LPCWSTR)L""; + return L""; } - return (FX_LPCWSTR)L""; + return L""; } FX_LPCWSTR CJS_EventHandler::Type() { switch (m_eEventType) { - case JET_APP_INIT: return (FX_LPCWSTR)L"App"; - case JET_BATCH_EXEC: return (FX_LPCWSTR)L"Batch"; - case JET_BOOKMARK_MOUSEUP: return (FX_LPCWSTR)L"BookMark"; - case JET_CONSOLE_EXEC: return (FX_LPCWSTR)L"Console"; + case JET_APP_INIT: return L"App"; + case JET_BATCH_EXEC: return L"Batch"; + case JET_BOOKMARK_MOUSEUP: return L"BookMark"; + case JET_CONSOLE_EXEC: return L"Console"; case JET_DOC_DIDPRINT: case JET_DOC_DIDSAVE: case JET_DOC_OPEN: case JET_DOC_WILLCLOSE: case JET_DOC_WILLPRINT: - case JET_DOC_WILLSAVE: return (FX_LPCWSTR)L"Doc"; - case JET_EXTERNAL_EXEC: return (FX_LPCWSTR)L"External"; + case JET_DOC_WILLSAVE: return L"Doc"; + case JET_EXTERNAL_EXEC: return L"External"; case JET_FIELD_BLUR: case JET_FIELD_FOCUS: case JET_FIELD_MOUSEDOWN: @@ -533,7 +533,7 @@ FX_LPCWSTR CJS_EventHandler::Type() case JET_FIELD_CALCULATE: case JET_FIELD_FORMAT: case JET_FIELD_KEYSTROKE: - case JET_FIELD_VALIDATE: return (FX_LPCWSTR)L"Field"; + case JET_FIELD_VALIDATE: return L"Field"; case JET_SCREEN_FOCUS: case JET_SCREEN_BLUR: case JET_SCREEN_OPEN: @@ -543,18 +543,18 @@ FX_LPCWSTR CJS_EventHandler::Type() case JET_SCREEN_MOUSEENTER: case JET_SCREEN_MOUSEEXIT: case JET_SCREEN_INVIEW: - case JET_SCREEN_OUTVIEW: return (FX_LPCWSTR)L"Screen"; - case JET_LINK_MOUSEUP: return (FX_LPCWSTR)L"Link"; - case JET_MENU_EXEC: return (FX_LPCWSTR)L"Menu"; + case JET_SCREEN_OUTVIEW: return L"Screen"; + case JET_LINK_MOUSEUP: return L"Link"; + case JET_MENU_EXEC: return L"Menu"; case JET_PAGE_OPEN: case JET_PAGE_CLOSE: case JET_PAGE_INVIEW: - case JET_PAGE_OUTVIEW:return (FX_LPCWSTR)L"Page"; + case JET_PAGE_OUTVIEW:return L"Page"; default: - return (FX_LPCWSTR)L""; + return L""; } - return (FX_LPCWSTR)L""; + return L""; } FX_BOOL& CJS_EventHandler::Rc() diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index b0af094bb1..52e3ae813a 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -330,7 +330,7 @@ v8::Handle CJS_Runtime::NewJSContext() CFX_WideString ChangeObjName(const CFX_WideString& str) { CFX_WideString sRet = str; - sRet.Replace((FX_LPCWSTR)L"_", (FX_LPCWSTR)L"."); + sRet.Replace(L"_", L"."); return sRet; } diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index 1bd980af14..4c51c9ae25 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -93,12 +93,12 @@ static const stru_TbConvert fcTable[] = { static FX_LPCWSTR months[] = { - (FX_LPCWSTR)L"Jan", (FX_LPCWSTR)L"Feb", (FX_LPCWSTR)L"Mar", (FX_LPCWSTR)L"Apr", (FX_LPCWSTR)L"May", (FX_LPCWSTR)L"Jun", (FX_LPCWSTR)L"Jul", (FX_LPCWSTR)L"Aug", (FX_LPCWSTR)L"Sep", (FX_LPCWSTR)L"Oct", (FX_LPCWSTR)L"Nov", (FX_LPCWSTR)L"Dec" + L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec" }; static FX_LPCWSTR fullmonths[] = { - (FX_LPCWSTR)L"January", (FX_LPCWSTR)L"February", (FX_LPCWSTR)L"March", (FX_LPCWSTR)L"April", (FX_LPCWSTR)L"May", (FX_LPCWSTR)L"June", (FX_LPCWSTR)L"July", (FX_LPCWSTR)L"August", (FX_LPCWSTR)L"September", (FX_LPCWSTR)L"October", (FX_LPCWSTR)L"November", (FX_LPCWSTR)L"December" + L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", L"September", L"October", L"November", L"December" }; FX_BOOL CJS_PublicMethods::IsNumber(FX_LPCWSTR string) @@ -193,19 +193,19 @@ FX_BOOL CJS_PublicMethods::isReservedMaskChar(wchar_t ch) double CJS_PublicMethods::AF_Simple(FX_LPCWSTR sFuction, double dValue1, double dValue2) { - if (FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"AVG") == 0 || FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"SUM") == 0) + if (FXSYS_wcsicmp(sFuction,L"AVG") == 0 || FXSYS_wcsicmp(sFuction,L"SUM") == 0) { return dValue1 + dValue2; } - else if (FXSYS_wcsicmp(sFuction, (FX_LPCWSTR)L"PRD") == 0) + else if (FXSYS_wcsicmp(sFuction, L"PRD") == 0) { return dValue1 * dValue2; } - else if (FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"MIN") == 0) + else if (FXSYS_wcsicmp(sFuction,L"MIN") == 0) { return FX_MIN(dValue1, dValue2); } - else if (FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"MAX") == 0) + else if (FXSYS_wcsicmp(sFuction,L"MAX") == 0) { return FX_MAX(dValue1, dValue2); } @@ -590,7 +590,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& } CFX_WideString swTemp; - swTemp.Format((FX_LPCWSTR)L"%d/%d/%d %d:%d:%d",nMonth,nDay,nYear,nHour,nMin,nSec); + swTemp.Format(L"%d/%d/%d %d:%d:%d",nMonth,nDay,nYear,nHour,nMin,nSec); return JS_DateParse(swTemp); } @@ -936,22 +936,22 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, const CFX_WideStr sPart += c; break; case 'm': - sPart.Format((FX_LPCWSTR)L"%d",nMonth); + sPart.Format(L"%d",nMonth); break; case 'd': - sPart.Format((FX_LPCWSTR)L"%d",nDay); + sPart.Format(L"%d",nDay); break; case 'H': - sPart.Format((FX_LPCWSTR)L"%d",nHour); + sPart.Format(L"%d",nHour); break; case 'h': - sPart.Format((FX_LPCWSTR)L"%d",nHour>12?nHour - 12:nHour); + sPart.Format(L"%d",nHour>12?nHour - 12:nHour); break; case 'M': - sPart.Format((FX_LPCWSTR)L"%d",nMin); + sPart.Format(L"%d",nMin); break; case 's': - sPart.Format((FX_LPCWSTR)L"%d",nSec); + sPart.Format(L"%d",nSec); break; case 't': sPart += nHour>12?'p':'a'; @@ -964,28 +964,28 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, const CFX_WideStr switch (c) { case 'y': - sPart.Format((FX_LPCWSTR)L"%02d",nYear - (nYear / 100) * 100); + sPart.Format(L"%02d",nYear - (nYear / 100) * 100); break; case 'm': - sPart.Format((FX_LPCWSTR)L"%02d",nMonth); + sPart.Format(L"%02d",nMonth); break; case 'd': - sPart.Format((FX_LPCWSTR)L"%02d",nDay); + sPart.Format(L"%02d",nDay); break; case 'H': - sPart.Format((FX_LPCWSTR)L"%02d",nHour); + sPart.Format(L"%02d",nHour); break; case 'h': - sPart.Format((FX_LPCWSTR)L"%02d",nHour>12?nHour - 12:nHour); + sPart.Format(L"%02d",nHour>12?nHour - 12:nHour); break; case 'M': - sPart.Format((FX_LPCWSTR)L"%02d",nMin); + sPart.Format(L"%02d",nMin); break; case 's': - sPart.Format((FX_LPCWSTR)L"%02d",nSec); + sPart.Format(L"%02d",nSec); break; case 't': - sPart = nHour>12? (FX_LPCWSTR)L"pm": (FX_LPCWSTR)L"am"; + sPart = nHour>12? L"pm": L"am"; break; } i+=2; @@ -1012,7 +1012,7 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, const CFX_WideStr switch (c) { case 'y': - sPart.Format((FX_LPCWSTR)L"%04d",nYear); + sPart.Format(L"%04d",nYear); i += 4; break; case 'm': @@ -1286,7 +1286,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(OBJ_METHOD_PARAMS) return TRUE; CFX_WideString swTemp = wstrValue; - swTemp.Replace((FX_LPCWSTR)L",", (FX_LPCWSTR)L"."); + swTemp.Replace(L",", L"."); if (!IsNumber(swTemp)) //!(IsNumber(wstrChange) && { pEvent->Rc() = FALSE; @@ -1675,9 +1675,9 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(OBJ_METHOD_PARAMS) } int iIndex = params[0]; - FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"m/d", (FX_LPCWSTR)L"m/d/yy", (FX_LPCWSTR)L"mm/dd/yy", (FX_LPCWSTR)L"mm/yy", (FX_LPCWSTR)L"d-mmm", (FX_LPCWSTR)L"d-mmm-yy", (FX_LPCWSTR)L"dd-mmm-yy", - (FX_LPCWSTR)L"yy-mm-dd", (FX_LPCWSTR)L"mmm-yy", (FX_LPCWSTR)L"mmmm-yy", (FX_LPCWSTR)L"mmm d, yyyy", (FX_LPCWSTR)L"mmmm d, yyyy", - (FX_LPCWSTR)L"m/d/yy h:MM tt", (FX_LPCWSTR)L"m/d/yy HH:MM" }; + FX_LPCWSTR cFormats[] = {L"m/d", L"m/d/yy", L"mm/dd/yy", L"mm/yy", L"d-mmm", L"d-mmm-yy", L"dd-mmm-yy", + L"yy-mm-dd", L"mmm-yy", L"mmmm-yy", L"mmm d, yyyy", L"mmmm d, yyyy", + L"m/d/yy h:MM tt", L"m/d/yy HH:MM" }; ASSERT(iIndex < sizeof(cFormats)/sizeof(FX_LPCWSTR)); @@ -1706,9 +1706,9 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(OBJ_METHOD_PARAMS) } int iIndex = params[0]; - FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"m/d", (FX_LPCWSTR)L"m/d/yy", (FX_LPCWSTR)L"mm/dd/yy", (FX_LPCWSTR)L"mm/yy", (FX_LPCWSTR)L"d-mmm", (FX_LPCWSTR)L"d-mmm-yy", (FX_LPCWSTR)L"dd-mmm-yy", - (FX_LPCWSTR)L"yy-mm-dd", (FX_LPCWSTR)L"mmm-yy", (FX_LPCWSTR)L"mmmm-yy", (FX_LPCWSTR)L"mmm d, yyyy", (FX_LPCWSTR)L"mmmm d, yyyy", - (FX_LPCWSTR)L"m/d/yy h:MM tt", (FX_LPCWSTR)L"m/d/yy HH:MM" }; + FX_LPCWSTR cFormats[] = {L"m/d", L"m/d/yy", L"mm/dd/yy", L"mm/yy", L"d-mmm", L"d-mmm-yy", L"dd-mmm-yy", + L"yy-mm-dd", L"mmm-yy", L"mmmm-yy", L"mmm d, yyyy", L"mmmm d, yyyy", + L"m/d/yy h:MM tt", L"m/d/yy HH:MM" }; ASSERT(iIndexGetJSRuntime(); ASSERT(pRuntime != NULL); - CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].operator CFX_WideString()) : (FX_LPCWSTR)L""; + CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].operator CFX_WideString()) : L""; if (script.IsEmpty()) { sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE); @@ -561,7 +561,7 @@ FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS) CJS_Runtime* pRuntime = pContext->GetJSRuntime(); ASSERT(pRuntime != NULL); - CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].operator CFX_WideString()) : (FX_LPCWSTR)L""; + CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].operator CFX_WideString()) : L""; if (script.IsEmpty()) { sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE); @@ -989,7 +989,7 @@ CFX_WideString app::PDFPathToSysPath(const CFX_WideString& sOldPath) wchar_t c_Drive = strOPath.GetAt(1); if ((c_Drive >= L'a' && c_Drive <= L'z' )||( c_Drive >= L'A' && c_Drive <= L'Z')) { - strOPath.Replace((FX_LPCWSTR)L"/",(FX_LPCWSTR)L"\\"); + strOPath.Replace(L"/",L"\\"); //strOPath.SetAt(0,''); strOPath.Insert(2,':'); strOPath.Delete(0); diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index a6f51deb41..1e5c75188a 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -63,32 +63,32 @@ struct stru_TbConvert }; const stru_TbConvert fcTable[] = { - { (FX_LPCWSTR)L"mmmm", (FX_LPCWSTR)L"%B" }, - { (FX_LPCWSTR)L"mmm", (FX_LPCWSTR)L"%b" }, - { (FX_LPCWSTR)L"mm", (FX_LPCWSTR)L"%m" }, + { L"mmmm", L"%B" }, + { L"mmm", L"%b" }, + { L"mm", L"%m" }, //"m" - { (FX_LPCWSTR)L"dddd", (FX_LPCWSTR)L"%A" }, - { (FX_LPCWSTR)L"ddd", (FX_LPCWSTR)L"%a" }, - { (FX_LPCWSTR)L"dd", (FX_LPCWSTR)L"%d" }, + { L"dddd", L"%A" }, + { L"ddd", L"%a" }, + { L"dd", L"%d" }, //"d", "%w", - { (FX_LPCWSTR)L"yyyy", (FX_LPCWSTR)L"%Y" }, - { (FX_LPCWSTR)L"yy", (FX_LPCWSTR)L"%y" }, - { (FX_LPCWSTR)L"HH", (FX_LPCWSTR)L"%H" }, + { L"yyyy", L"%Y" }, + { L"yy", L"%y" }, + { L"HH", L"%H" }, //"H" - { (FX_LPCWSTR)L"hh", (FX_LPCWSTR)L"%I" }, + { L"hh", L"%I" }, //"h" - { (FX_LPCWSTR)L"MM", (FX_LPCWSTR)L"%M" }, + { L"MM", L"%M" }, //"M" - { (FX_LPCWSTR)L"ss", (FX_LPCWSTR)L"%S" }, + { L"ss", L"%S" }, //"s - { (FX_LPCWSTR)L"TT", (FX_LPCWSTR)L"%p" }, + { L"TT", L"%p" }, //"t" #if defined(_WIN32) - { (FX_LPCWSTR)L"tt", (FX_LPCWSTR)L"%p" }, - { (FX_LPCWSTR)L"h", (FX_LPCWSTR)L"%#I" }, + { L"tt", L"%p" }, + { L"h", L"%#I" }, #else - { (FX_LPCWSTR)L"tt", (FX_LPCWSTR)L"%P" }, - { (FX_LPCWSTR)L"h", (FX_LPCWSTR)L"%l" }, + { L"tt", L"%P" }, + { L"h", L"%l" }, #endif }; @@ -191,7 +191,7 @@ FX_BOOL util::printf(OBJ_METHOD_PARAMS) strSegment.Format((FX_LPCWSTR)c_strFormat.c_str(),(FX_LPCWSTR)params[iIndex].operator CFX_WideString()); break; default: - strSegment.Format((FX_LPCWSTR)L"%S", (FX_LPCWSTR)c_strFormat.c_str()); + strSegment.Format(L"%S", (FX_LPCWSTR)c_strFormat.c_str()); break; } c_strResult += (wchar_t*)strSegment.GetBuffer(strSegment.GetLength()+1); @@ -236,7 +236,7 @@ FX_BOOL util::printd(OBJ_METHOD_PARAMS) switch (nFormat) { case 0: - swResult.Format((FX_LPCWSTR)L"D:%04d%02d%02d%02d%02d%02d", + swResult.Format(L"D:%04d%02d%02d%02d%02d%02d", jsDate.GetYear(), jsDate.GetMonth() + 1, jsDate.GetDay(), @@ -245,7 +245,7 @@ FX_BOOL util::printd(OBJ_METHOD_PARAMS) jsDate.GetSeconds()); break; case 1: - swResult.Format((FX_LPCWSTR)L"%04d.%02d.%02d %02d:%02d:%02d", + swResult.Format(L"%04d.%02d.%02d %02d:%02d:%02d", jsDate.GetYear(), jsDate.GetMonth() + 1, jsDate.GetDay(), @@ -254,7 +254,7 @@ FX_BOOL util::printd(OBJ_METHOD_PARAMS) jsDate.GetSeconds()); break; case 2: - swResult.Format((FX_LPCWSTR)L"%04d/%02d/%02d %02d:%02d:%02d", + swResult.Format(L"%04d/%02d/%02d %02d:%02d:%02d", jsDate.GetYear(), jsDate.GetMonth() + 1, jsDate.GetDay(), @@ -322,12 +322,12 @@ FX_BOOL util::printd(OBJ_METHOD_PARAMS) }; stru_TbConvertAd cTableAd[] ={ - { (FX_LPCWSTR)L"m", iMonth+1 }, - { (FX_LPCWSTR)L"d", iDay }, - { (FX_LPCWSTR)L"H", iHour }, - { (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour }, - { (FX_LPCWSTR)L"M", iMin }, - { (FX_LPCWSTR)L"s", iSec }, + { L"m", iMonth+1 }, + { L"d", iDay }, + { L"H", iHour }, + { L"h", iHour>12?iHour-12:iHour }, + { L"M", iMin }, + { L"s", iSec }, }; //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1); @@ -336,7 +336,7 @@ FX_BOOL util::printd(OBJ_METHOD_PARAMS) wchar_t tszValue[10]; //_itot(cTableAd[iIndex].iValue,tszValue,10); CFX_WideString sValue; - sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue); + sValue.Format(L"%d",cTableAd[iIndex].iValue); memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetLength()+1), (sValue.GetLength()+1)*sizeof(wchar_t)); @@ -360,7 +360,7 @@ FX_BOOL util::printd(OBJ_METHOD_PARAMS) } CFX_WideString strFormat; -// strFormat.Format((FX_LPCWSTR)L"%d,%d,%d,%d,%d,%d",iYear, iMonth, iDay, iHour, iMin, iSec); +// strFormat.Format(L"%d,%d,%d,%d,%d,%d",iYear, iMonth, iDay, iHour, iMin, iSec); // CString strFormat = cppTm.Format(cFormat.c_str()); wchar_t buf[64] = {0}; strFormat = wcsftime(buf, 64, cFormat.c_str(), &time); @@ -418,12 +418,12 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur }; stru_TbConvertAd cTableAd[] ={ - { (FX_LPCWSTR)L"m", iMonth+1 }, - { (FX_LPCWSTR)L"d", iDay }, - { (FX_LPCWSTR)L"H", iHour }, - { (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour }, - { (FX_LPCWSTR)L"M", iMin }, - { (FX_LPCWSTR)L"s", iSec }, + { L"m", iMonth+1 }, + { L"d", iDay }, + { L"H", iHour }, + { L"h", iHour>12?iHour-12:iHour }, + { L"M", iMin }, + { L"s", iSec }, }; //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1); @@ -432,7 +432,7 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur wchar_t tszValue[10]; //_itot(cTableAd[iIndex].iValue,tszValue,10); CFX_WideString sValue; - sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue); + sValue.Format(L"%d",cTableAd[iIndex].iValue); memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetLength()+1),sValue.GetLength()*sizeof(wchar_t)); @@ -456,7 +456,7 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur } CFX_WideString strFormat; -// strFormat.Format((FX_LPCWSTR)L"%d,%d,%d,%d,%d,%d",iYear, iMonth, iDay, iHour, iMin, iSec); +// strFormat.Format(L"%d,%d,%d,%d,%d,%d",iYear, iMonth, iDay, iHour, iMin, iSec); // CString strFormat = cppTm.Format(cFormat.c_str()); wchar_t buf[64] = {0}; strFormat = wcsftime(buf, 64, cFormat.c_str(), &time); @@ -643,7 +643,7 @@ FX_BOOL util::byteToChar(OBJ_METHOD_PARAMS) int nByte = (int)params[0]; unsigned char cByte = (unsigned char)nByte; CFX_WideString csValue; - csValue.Format((FX_LPCWSTR)L"%c", cByte); + csValue.Format(L"%c", cByte); vRet = csValue; return TRUE; } diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp index b0028b6c66..7bc8fad395 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp @@ -865,7 +865,7 @@ void CPWL_NoteItem::SetDateTime(FX_SYSTEMTIME time) m_dtNote = time; CFX_WideString swTime; - swTime.Format((FX_LPCWSTR)L"%04d-%02d-%02d %02d:%02d:%02d", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond); + swTime.Format(L"%04d-%02d-%02d %02d:%02d:%02d", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond); if (m_pDateTime) { m_pDateTime->SetText(swTime); -- cgit v1.2.3