Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Unified Diff: xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp

Issue 1938163002: More define cleanup. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/parser/xfa_script_eventpseudomodel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
diff --git a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
index 2ddf0920d530ff789084bf049b6fd44ebafcee0f..335df6a32ea811d4868d0d805f46bb8483e346a7 100644
--- a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
@@ -48,90 +48,90 @@ void Script_EventPseudoModel_InterProperty(FXJSE_HVALUE hValue,
void Script_EventPseudoModel_BooleanProperty(FXJSE_HVALUE hValue,
FX_BOOL& bValue,
FX_BOOL bSetting) {
- if (bSetting) {
+ if (bSetting)
bValue = FXJSE_Value_ToBoolean(hValue);
- } else {
+ else
FXJSE_Value_SetBoolean(hValue, bValue);
- }
}
+
void CScript_EventPseudoModel::Script_EventPseudoModel_Property(
FXJSE_HVALUE hValue,
- uint32_t dwFlag,
+ XFA_Event dwFlag,
FX_BOOL bSetting) {
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
- if (!pScriptContext) {
+ if (!pScriptContext)
return;
- }
+
CXFA_EventParam* pEventParam = pScriptContext->GetEventParam();
- if (!pEventParam) {
+ if (!pEventParam)
return;
- }
+
switch (dwFlag) {
- case XFA_EVENT_CANCELACTION:
+ case XFA_Event::CancelAction:
Script_EventPseudoModel_BooleanProperty(
hValue, pEventParam->m_bCancelAction, bSetting);
break;
- case XFA_EVENT_CHANGE:
+ case XFA_Event::Change:
Script_EventPseudoModel_StringProperty(hValue, pEventParam->m_wsChange,
bSetting);
break;
- case XFA_EVENT_COMMITKEY:
+ case XFA_Event::CommitKey:
Script_EventPseudoModel_InterProperty(hValue, pEventParam->m_iCommitKey,
bSetting);
break;
- case XFA_EVENT_FULLTEXT:
+ case XFA_Event::FullText:
Script_EventPseudoModel_StringProperty(hValue, pEventParam->m_wsFullText,
bSetting);
break;
- case XFA_EVENT_KEYDOWN:
+ case XFA_Event::Keydown:
Script_EventPseudoModel_BooleanProperty(hValue, pEventParam->m_bKeyDown,
bSetting);
break;
- case XFA_EVENT_MODIFIER:
+ case XFA_Event::Modifier:
Script_EventPseudoModel_BooleanProperty(hValue, pEventParam->m_bModifier,
bSetting);
break;
- case XFA_EVENT_NEWCONTENTTYPE:
+ case XFA_Event::NewContentType:
Script_EventPseudoModel_StringProperty(
hValue, pEventParam->m_wsNewContentType, bSetting);
break;
- case XFA_EVENT_NEWTEXT:
+ case XFA_Event::NewText:
Script_EventPseudoModel_StringProperty(hValue, pEventParam->m_wsNewText,
bSetting);
break;
- case XFA_EVENT_PREVCONTENTTYPE:
+ case XFA_Event::PreviousContentType:
Script_EventPseudoModel_StringProperty(
hValue, pEventParam->m_wsPrevContentType, bSetting);
break;
- case XFA_EVENT_PREVTEXT:
+ case XFA_Event::PreviousText:
Script_EventPseudoModel_StringProperty(hValue, pEventParam->m_wsPrevText,
bSetting);
break;
- case XFA_EVENT_REENTER:
+ case XFA_Event::Reenter:
Script_EventPseudoModel_BooleanProperty(hValue, pEventParam->m_bReenter,
bSetting);
break;
- case XFA_EVENT_SELEND:
+ case XFA_Event::SelectionEnd:
Script_EventPseudoModel_InterProperty(hValue, pEventParam->m_iSelEnd,
bSetting);
break;
- case XFA_EVENT_SELSTART:
+ case XFA_Event::SelectionStart:
Script_EventPseudoModel_InterProperty(hValue, pEventParam->m_iSelStart,
bSetting);
break;
- case XFA_EVENT_SHIFT:
+ case XFA_Event::Shift:
Script_EventPseudoModel_BooleanProperty(hValue, pEventParam->m_bShift,
bSetting);
break;
- case XFA_EVENT_SOAPFAULTCODE:
+ case XFA_Event::SoapFaultCode:
Script_EventPseudoModel_StringProperty(
hValue, pEventParam->m_wsSoapFaultCode, bSetting);
break;
- case XFA_EVENT_SOAPFAULTSTRING:
+ case XFA_Event::SoapFaultString:
Script_EventPseudoModel_StringProperty(
hValue, pEventParam->m_wsSoapFaultString, bSetting);
break;
- case XFA_EVENT_TARGET:
+ case XFA_Event::Target:
break;
default:
break;
@@ -141,97 +141,99 @@ void CScript_EventPseudoModel::Script_EventPseudoModel_Change(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_CHANGE, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::Change, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_CommitKey(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_COMMITKEY, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::CommitKey, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_FullText(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_FULLTEXT, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::FullText, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_KeyDown(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_KEYDOWN, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::Keydown, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Modifier(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_MODIFIER, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::Modifier, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_NewContentType(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_NEWCONTENTTYPE, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::NewContentType, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_NewText(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_NEWTEXT, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::NewText, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_PrevContentType(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_PREVCONTENTTYPE, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::PreviousContentType,
+ bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_PrevText(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_PREVTEXT, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::PreviousText, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Reenter(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_REENTER, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::Reenter, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_SelEnd(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_SELEND, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::SelectionEnd, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_SelStart(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_SELSTART, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::SelectionStart, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Shift(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_SHIFT, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::Shift, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_SoapFaultCode(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_SOAPFAULTCODE, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::SoapFaultCode, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_SoapFaultString(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_SOAPFAULTSTRING, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::SoapFaultString,
+ bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Target(
FXJSE_HVALUE hValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_EVENT_TARGET, bSetting);
+ Script_EventPseudoModel_Property(hValue, XFA_Event::Target, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Emit(
CFXJSE_Arguments* pArguments) {
« no previous file with comments | « xfa/fxfa/parser/xfa_script_eventpseudomodel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698