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

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

Issue 2017863002: Fix MSVC C4800 build warnings. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: put C4800 back Created 4 years, 7 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_document_datamerger_imp.cpp ('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_object_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index 3864c1a32ca900cfe5de65731f41414796714b96..53c8847be810d512ecab35d33dca2e0d9cfb461e 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -2143,7 +2143,7 @@ void CXFA_Node::Script_Field_SelectedIndex(CFXJSE_Value* pValue,
pWidgetData->ClearAllSelections();
return;
}
- pWidgetData->SetItemState(iIndex, TRUE, TRUE, TRUE);
+ pWidgetData->SetItemState(iIndex, TRUE, true, TRUE, TRUE);
} else {
FXJSE_Value_SetInteger(pValue, pWidgetData->GetSelectedItem());
}
@@ -2312,16 +2312,15 @@ void CXFA_Node::Script_Field_SetItemState(CFXJSE_Arguments* pArguments) {
return;
}
CXFA_WidgetData* pWidgetData = GetWidgetData();
- if (!pWidgetData) {
+ if (!pWidgetData)
return;
- }
+
int32_t iIndex = pArguments->GetInt32(0);
if (pArguments->GetInt32(1) != 0) {
- pWidgetData->SetItemState(iIndex, TRUE, TRUE, TRUE);
+ pWidgetData->SetItemState(iIndex, TRUE, true, TRUE, TRUE);
} else {
- if (pWidgetData->GetItemState(iIndex)) {
- pWidgetData->SetItemState(iIndex, FALSE, TRUE, TRUE);
- }
+ if (pWidgetData->GetItemState(iIndex))
+ pWidgetData->SetItemState(iIndex, FALSE, true, TRUE, TRUE);
}
}
void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments) {
@@ -2382,7 +2381,8 @@ void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue,
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(pValue, bsValue);
pWidgetData->SetSelectedMemberByValue(
- CFX_WideString::FromUTF8(bsValue.AsStringC()).AsStringC(), TRUE, TRUE);
+ CFX_WideString::FromUTF8(bsValue.AsStringC()).AsStringC(), true, TRUE,
+ TRUE);
} else {
CFX_WideString wsValue = GetScriptContent(TRUE);
XFA_VERSION curVersion = GetDocument()->GetCurVersionMode();
@@ -2407,35 +2407,39 @@ void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent");
}
}
+
void CXFA_Node::Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
- if ((argc == 0) || (argc == 1)) {
- CXFA_WidgetData* pWidgetData = GetWidgetData();
- if (!pWidgetData) {
- FXJSE_Value_SetNull(pArguments->GetReturnValue());
- } else {
- CXFA_Node* pReturnNode = NULL;
- if (argc == 0) {
- pReturnNode = pWidgetData->GetSelectedMember();
- } else {
- CFX_ByteString szName;
- szName = pArguments->GetUTF8String(0);
- pReturnNode = pWidgetData->SetSelectedMember(
- CFX_WideString::FromUTF8(szName.AsStringC()).AsStringC());
- }
- if (pReturnNode) {
- FXJSE_Value_Set(
- pArguments->GetReturnValue(),
- m_pDocument->GetScriptContext()->GetJSValueFromMap(pReturnNode));
- } else {
- FXJSE_Value_SetNull(pArguments->GetReturnValue());
- }
- }
- } else {
+ if (argc < 0 || argc > 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"selectedMember");
+ return;
}
+
+ CXFA_WidgetData* pWidgetData = GetWidgetData();
+ if (!pWidgetData) {
+ FXJSE_Value_SetNull(pArguments->GetReturnValue());
+ return;
+ }
+
+ CXFA_Node* pReturnNode = nullptr;
+ if (argc == 0) {
+ pReturnNode = pWidgetData->GetSelectedMember();
+ } else {
+ CFX_ByteString szName;
+ szName = pArguments->GetUTF8String(0);
+ pReturnNode = pWidgetData->SetSelectedMember(
+ CFX_WideString::FromUTF8(szName.AsStringC()).AsStringC(), true);
+ }
+ if (!pReturnNode) {
+ FXJSE_Value_SetNull(pArguments->GetReturnValue());
+ return;
+ }
+ FXJSE_Value_Set(
+ pArguments->GetReturnValue(),
+ m_pDocument->GetScriptContext()->GetJSValueFromMap(pReturnNode));
}
+
void CXFA_Node::Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if (argc == 0) {
« no previous file with comments | « xfa/fxfa/parser/xfa_document_datamerger_imp.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698