summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_ffdocview.cpp4
-rw-r--r--xfa/fxfa/cxfa_ffwidgethandler.cpp4
-rw-r--r--xfa/fxfa/cxfa_widgetacc.cpp39
-rw-r--r--xfa/fxfa/cxfa_widgetacc.h7
-rw-r--r--xfa/fxfa/parser/cxfa_validatedata.cpp (renamed from xfa/fxfa/parser/cxfa_validate.cpp)36
-rw-r--r--xfa/fxfa/parser/cxfa_validatedata.h (renamed from xfa/fxfa/parser/cxfa_validate.h)10
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.h4
8 files changed, 55 insertions, 53 deletions
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp
index 1779b9e2f0..57cd7d2f95 100644
--- a/xfa/fxfa/cxfa_ffdocview.cpp
+++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -225,9 +225,9 @@ bool CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) {
pWidgetAcc->ResetData();
pWidgetAcc->UpdateUIDisplay();
- if (CXFA_Validate validate = pWidgetAcc->GetValidate(false)) {
+ if (CXFA_ValidateData validateData = pWidgetAcc->GetValidateData(false)) {
AddValidateWidget(pWidgetAcc);
- validate.GetNode()->SetFlag(XFA_NodeFlag_NeedsInitApp, false);
+ validateData.GetNode()->SetFlag(XFA_NodeFlag_NeedsInitApp, false);
}
return true;
}
diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp
index 9ab19623c2..4a2bf08222 100644
--- a/xfa/fxfa/cxfa_ffwidgethandler.cpp
+++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp
@@ -193,8 +193,8 @@ bool CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc,
return calcData && calcData.GetScriptData();
}
case XFA_EVENT_Validate: {
- CXFA_Validate val = pWidgetAcc->GetValidate(false);
- return val && val.GetScriptData();
+ CXFA_ValidateData validateData = pWidgetAcc->GetValidateData(false);
+ return validateData && validateData.GetScriptData();
}
default:
break;
diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp
index e9ccaaa218..1e005791a2 100644
--- a/xfa/fxfa/cxfa_widgetacc.cpp
+++ b/xfa/fxfa/cxfa_widgetacc.cpp
@@ -341,7 +341,7 @@ int32_t CXFA_WidgetAcc::ProcessCalculate() {
return XFA_EVENTERROR_Success;
}
-void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate,
+void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_ValidateData validateData,
int32_t iRet,
bool bRetValue,
bool bVersionFlag) {
@@ -356,8 +356,8 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate,
WideString wsTitle = pAppProvider->GetAppTitle();
WideString wsScriptMsg;
- validate.GetScriptMessageText(wsScriptMsg);
- int32_t eScriptTest = validate.GetScriptTest();
+ validateData.GetScriptMessageText(wsScriptMsg);
+ int32_t eScriptTest = validateData.GetScriptTest();
if (eScriptTest == XFA_ATTRIBUTEENUM_Warning) {
if (GetNode()->IsUserInteractive())
return;
@@ -380,12 +380,13 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate,
pAppProvider->MsgBox(wsScriptMsg, wsTitle, XFA_MBICON_Error, XFA_MB_OK);
}
-int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate,
- bool bVersionFlag) {
+int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(
+ CXFA_ValidateData validateData,
+ bool bVersionFlag) {
WideString wsRawValue = GetRawValue();
if (!wsRawValue.IsEmpty()) {
WideString wsPicture;
- validate.GetPicture(wsPicture);
+ validateData.GetPicture(wsPicture);
if (wsPicture.IsEmpty())
return XFA_EVENTERROR_NotExist;
@@ -401,9 +402,9 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate,
return XFA_EVENTERROR_NotExist;
WideString wsFormatMsg;
- validate.GetFormatMessageText(wsFormatMsg);
+ validateData.GetFormatMessageText(wsFormatMsg);
WideString wsTitle = pAppProvider->GetAppTitle();
- int32_t eFormatTest = validate.GetFormatTest();
+ int32_t eFormatTest = validateData.GetFormatTest();
if (eFormatTest == XFA_ATTRIBUTEENUM_Error) {
if (wsFormatMsg.IsEmpty())
wsFormatMsg = GetValidateMessage(true, bVersionFlag);
@@ -430,7 +431,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate,
return XFA_EVENTERROR_NotExist;
}
-int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate,
+int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_ValidateData validateData,
int32_t iFlags,
bool bVersionFlag) {
WideString wsValue;
@@ -440,9 +441,9 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate,
if (m_bIsNull && (m_bPreNull == m_bIsNull))
return XFA_EVENTERROR_Success;
- int32_t eNullTest = validate.GetNullTest();
+ int32_t eNullTest = validateData.GetNullTest();
WideString wsNullMsg;
- validate.GetNullMessageText(wsNullMsg);
+ validateData.GetNullMessageText(wsNullMsg);
if (iFlags & 0x01) {
int32_t iRet = XFA_EVENTERROR_Success;
if (eNullTest != XFA_ATTRIBUTEENUM_Disabled)
@@ -539,15 +540,15 @@ int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) {
if (GetElementType() == XFA_Element::Draw)
return XFA_EVENTERROR_NotExist;
- CXFA_Validate validate = GetValidate(false);
- if (!validate)
+ CXFA_ValidateData validateData = GetValidateData(false);
+ if (!validateData)
return XFA_EVENTERROR_NotExist;
- bool bInitDoc = validate.GetNode()->NeedsInitApp();
+ bool bInitDoc = validateData.GetNode()->NeedsInitApp();
bool bStatus = m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End;
int32_t iFormat = 0;
int32_t iRet = XFA_EVENTERROR_NotExist;
- CXFA_ScriptData scriptData = validate.GetScriptData();
+ CXFA_ScriptData scriptData = validateData.GetScriptData();
bool bRet = false;
bool hasBoolResult = (bInitDoc || bStatus) && GetRawValue().IsEmpty();
if (scriptData) {
@@ -563,17 +564,17 @@ int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) {
bVersionFlag = true;
if (bInitDoc) {
- validate.GetNode()->ClearFlag(XFA_NodeFlag_NeedsInitApp);
+ validateData.GetNode()->ClearFlag(XFA_NodeFlag_NeedsInitApp);
} else {
- iFormat = ProcessFormatTestValidate(validate, bVersionFlag);
+ iFormat = ProcessFormatTestValidate(validateData, bVersionFlag);
if (!bVersionFlag)
bVersionFlag = GetDoc()->GetXFADoc()->HasFlag(XFA_DOCFLAG_Scripting);
- iRet |= ProcessNullTestValidate(validate, iFlags, bVersionFlag);
+ iRet |= ProcessNullTestValidate(validateData, iFlags, bVersionFlag);
}
if (iFormat != XFA_EVENTERROR_Success && hasBoolResult)
- ProcessScriptTestValidate(validate, iRet, bRet, bVersionFlag);
+ ProcessScriptTestValidate(validateData, iRet, bRet, bVersionFlag);
return iRet | iFormat;
}
diff --git a/xfa/fxfa/cxfa_widgetacc.h b/xfa/fxfa/cxfa_widgetacc.h
index 9191ac963c..036a6734b2 100644
--- a/xfa/fxfa/cxfa_widgetacc.h
+++ b/xfa/fxfa/cxfa_widgetacc.h
@@ -86,12 +86,13 @@ class CXFA_WidgetAcc : public CXFA_WidgetData {
private:
IXFA_AppProvider* GetAppProvider();
- void ProcessScriptTestValidate(CXFA_Validate validate,
+ void ProcessScriptTestValidate(CXFA_ValidateData validateData,
int32_t iRet,
bool pRetValue,
bool bVersionFlag);
- int32_t ProcessFormatTestValidate(CXFA_Validate validate, bool bVersionFlag);
- int32_t ProcessNullTestValidate(CXFA_Validate validate,
+ int32_t ProcessFormatTestValidate(CXFA_ValidateData validateData,
+ bool bVersionFlag);
+ int32_t ProcessNullTestValidate(CXFA_ValidateData validateData,
int32_t iFlags,
bool bVersionFlag);
WideString GetValidateCaptionName(bool bVersionFlag);
diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validatedata.cpp
index 2f38d82290..756ddf23bf 100644
--- a/xfa/fxfa/parser/cxfa_validate.cpp
+++ b/xfa/fxfa/parser/cxfa_validatedata.cpp
@@ -4,18 +4,18 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/fxfa/parser/cxfa_validate.h"
+#include "xfa/fxfa/parser/cxfa_validatedata.h"
#include "xfa/fxfa/parser/cxfa_node.h"
#include "xfa/fxfa/parser/xfa_utils.h"
-CXFA_Validate::CXFA_Validate(CXFA_Node* pNode) : CXFA_Data(pNode) {}
+CXFA_ValidateData::CXFA_ValidateData(CXFA_Node* pNode) : CXFA_Data(pNode) {}
-int32_t CXFA_Validate::GetFormatTest() {
+int32_t CXFA_ValidateData::GetFormatTest() {
return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_FormatTest);
}
-bool CXFA_Validate::SetNullTest(WideString wsValue) {
+bool CXFA_ValidateData::SetNullTest(WideString wsValue) {
const XFA_ATTRIBUTEENUMINFO* pInfo =
XFA_GetAttributeEnumByName(wsValue.AsStringView());
m_pNode->JSNode()->SetEnum(XFA_ATTRIBUTE_NullTest,
@@ -24,16 +24,16 @@ bool CXFA_Validate::SetNullTest(WideString wsValue) {
return true;
}
-int32_t CXFA_Validate::GetNullTest() {
+int32_t CXFA_ValidateData::GetNullTest() {
return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_NullTest);
}
-int32_t CXFA_Validate::GetScriptTest() {
+int32_t CXFA_ValidateData::GetScriptTest() {
return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_ScriptTest);
}
-void CXFA_Validate::GetMessageText(WideString& wsMessage,
- const WideString& wsMessageType) {
+void CXFA_ValidateData::GetMessageText(WideString& wsMessage,
+ const WideString& wsMessageType) {
CXFA_Node* pNode =
m_pNode->JSNode()->GetProperty(0, XFA_Element::Message, false);
if (!pNode)
@@ -54,24 +54,24 @@ void CXFA_Validate::GetMessageText(WideString& wsMessage,
}
}
-void CXFA_Validate::SetFormatMessageText(WideString wsMessage) {
+void CXFA_ValidateData::SetFormatMessageText(WideString wsMessage) {
SetMessageText(wsMessage, L"formatTest");
}
-void CXFA_Validate::GetFormatMessageText(WideString& wsMessage) {
+void CXFA_ValidateData::GetFormatMessageText(WideString& wsMessage) {
GetMessageText(wsMessage, L"formatTest");
}
-void CXFA_Validate::SetNullMessageText(WideString wsMessage) {
+void CXFA_ValidateData::SetNullMessageText(WideString wsMessage) {
SetMessageText(wsMessage, L"nullTest");
}
-void CXFA_Validate::GetNullMessageText(WideString& wsMessage) {
+void CXFA_ValidateData::GetNullMessageText(WideString& wsMessage) {
GetMessageText(wsMessage, L"nullTest");
}
-void CXFA_Validate::SetMessageText(WideString& wsMessage,
- const WideString& wsMessageType) {
+void CXFA_ValidateData::SetMessageText(WideString& wsMessage,
+ const WideString& wsMessageType) {
CXFA_Node* pNode =
m_pNode->JSNode()->GetProperty(0, XFA_Element::Message, true);
if (!pNode)
@@ -97,19 +97,19 @@ void CXFA_Validate::SetMessageText(WideString& wsMessage,
pTextNode->JSNode()->SetContent(wsMessage, wsMessage, false, false, true);
}
-void CXFA_Validate::GetScriptMessageText(WideString& wsMessage) {
+void CXFA_ValidateData::GetScriptMessageText(WideString& wsMessage) {
GetMessageText(wsMessage, L"scriptTest");
}
-void CXFA_Validate::SetScriptMessageText(WideString wsMessage) {
+void CXFA_ValidateData::SetScriptMessageText(WideString wsMessage) {
SetMessageText(wsMessage, L"scriptTest");
}
-void CXFA_Validate::GetPicture(WideString& wsPicture) {
+void CXFA_ValidateData::GetPicture(WideString& wsPicture) {
if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Picture, false))
pNode->JSNode()->TryContent(wsPicture, false, true);
}
-CXFA_ScriptData CXFA_Validate::GetScriptData() {
+CXFA_ScriptData CXFA_ValidateData::GetScriptData() {
return CXFA_ScriptData(m_pNode->GetChild(0, XFA_Element::Script, false));
}
diff --git a/xfa/fxfa/parser/cxfa_validate.h b/xfa/fxfa/parser/cxfa_validatedata.h
index bf6b807b7e..53df39429d 100644
--- a/xfa/fxfa/parser/cxfa_validate.h
+++ b/xfa/fxfa/parser/cxfa_validatedata.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_FXFA_PARSER_CXFA_VALIDATE_H_
-#define XFA_FXFA_PARSER_CXFA_VALIDATE_H_
+#ifndef XFA_FXFA_PARSER_CXFA_VALIDATEDATA_H_
+#define XFA_FXFA_PARSER_CXFA_VALIDATEDATA_H_
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
@@ -14,9 +14,9 @@
class CXFA_Node;
-class CXFA_Validate : public CXFA_Data {
+class CXFA_ValidateData : public CXFA_Data {
public:
- explicit CXFA_Validate(CXFA_Node* pNode);
+ explicit CXFA_ValidateData(CXFA_Node* pNode);
int32_t GetFormatTest();
int32_t GetNullTest();
@@ -36,4 +36,4 @@ class CXFA_Validate : public CXFA_Data {
void SetMessageText(WideString& wsMessage, const WideString& wsMessageType);
};
-#endif // XFA_FXFA_PARSER_CXFA_VALIDATE_H_
+#endif // XFA_FXFA_PARSER_CXFA_VALIDATEDATA_H_
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index b9a54bd447..d5b1609aea 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -349,8 +349,8 @@ CXFA_CalculateData CXFA_WidgetData::GetCalculateData() {
m_pNode->JSNode()->GetProperty(0, XFA_Element::Calculate, false));
}
-CXFA_Validate CXFA_WidgetData::GetValidate(bool bModified) {
- return CXFA_Validate(
+CXFA_ValidateData CXFA_WidgetData::GetValidateData(bool bModified) {
+ return CXFA_ValidateData(
m_pNode->JSNode()->GetProperty(0, XFA_Element::Validate, bModified));
}
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h
index d076b9b01e..40ee92d299 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.h
+++ b/xfa/fxfa/parser/cxfa_widgetdata.h
@@ -21,7 +21,7 @@
#include "xfa/fxfa/parser/cxfa_fontdata.h"
#include "xfa/fxfa/parser/cxfa_margindata.h"
#include "xfa/fxfa/parser/cxfa_paradata.h"
-#include "xfa/fxfa/parser/cxfa_validate.h"
+#include "xfa/fxfa/parser/cxfa_validatedata.h"
enum XFA_CHECKSTATE {
XFA_CHECKSTATE_On = 0,
@@ -61,7 +61,7 @@ class CXFA_WidgetData : public CXFA_Data {
CXFA_Value GetDefaultValue();
CXFA_Value GetFormValue();
CXFA_CalculateData GetCalculateData();
- CXFA_Validate GetValidate(bool bModified);
+ CXFA_ValidateData GetValidateData(bool bModified);
bool GetWidth(float& fWidth);
bool GetHeight(float& fHeight);