summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_calculate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_calculate.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_calculate.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_calculate.cpp b/xfa/fxfa/parser/cxfa_calculate.cpp
index 714dfdecd7..cacb326f0f 100644
--- a/xfa/fxfa/parser/cxfa_calculate.cpp
+++ b/xfa/fxfa/parser/cxfa_calculate.cpp
@@ -8,6 +8,9 @@
#include "fxjs/xfa/cjx_calculate.h"
#include "third_party/base/ptr_util.h"
+#include "xfa/fxfa/parser/cxfa_message.h"
+#include "xfa/fxfa/parser/cxfa_script.h"
+#include "xfa/fxfa/parser/cxfa_text.h"
namespace {
@@ -39,3 +42,22 @@ CXFA_Calculate::CXFA_Calculate(CXFA_Document* doc, XFA_PacketType packet)
pdfium::MakeUnique<CJX_Calculate>(this)) {}
CXFA_Calculate::~CXFA_Calculate() {}
+
+XFA_AttributeEnum CXFA_Calculate::GetOverride() {
+ return JSObject()
+ ->TryEnum(XFA_Attribute::Override, false)
+ .value_or(XFA_AttributeEnum::Error);
+}
+
+CXFA_Script* CXFA_Calculate::GetScript() {
+ return GetChild<CXFA_Script>(0, XFA_Element::Script, false);
+}
+
+WideString CXFA_Calculate::GetMessageText() {
+ CXFA_Message* pNode = GetChild<CXFA_Message>(0, XFA_Element::Message, false);
+ if (!pNode)
+ return L"";
+
+ CXFA_Text* text = pNode->GetChild<CXFA_Text>(0, XFA_Element::Text, false);
+ return text ? text->GetContent() : L"";
+}