diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-04 11:03:26 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-04 16:46:22 +0000 |
commit | d9dfb6cc16f689753e9b3f896fbda1aec791051a (patch) | |
tree | 8063ebecea18abc6989cac8b67b0d2fb03a4877a /fxjs | |
parent | 8ee5207f4f792295badd21f90727e8c810e7dbdf (diff) | |
download | pdfium-d9dfb6cc16f689753e9b3f896fbda1aec791051a.tar.xz |
Merge CXFA_WidgetData into CXFA_WidgetAcc
This CL merges the CXFA_WidgetData class into the only subclass,
CXFA_WidgetAcc. Code has been updated as needed.
Change-Id: I3f5bc83b1422bcbe065276b16bfb91e656f5c174
Reviewed-on: https://pdfium-review.googlesource.com/22252
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r-- | fxjs/xfa/cjx_boolean.cpp | 8 | ||||
-rw-r--r-- | fxjs/xfa/cjx_draw.cpp | 4 | ||||
-rw-r--r-- | fxjs/xfa/cjx_exclgroup.cpp | 17 | ||||
-rw-r--r-- | fxjs/xfa/cjx_field.cpp | 106 | ||||
-rw-r--r-- | fxjs/xfa/cjx_hostpseudomodel.cpp | 2 | ||||
-rw-r--r-- | fxjs/xfa/cjx_manifest.cpp | 4 | ||||
-rw-r--r-- | fxjs/xfa/cjx_node.cpp | 14 | ||||
-rw-r--r-- | fxjs/xfa/cjx_object.cpp | 25 | ||||
-rw-r--r-- | fxjs/xfa/cjx_object.h | 9 | ||||
-rw-r--r-- | fxjs/xfa/cjx_template.cpp | 6 |
10 files changed, 96 insertions, 99 deletions
diff --git a/fxjs/xfa/cjx_boolean.cpp b/fxjs/xfa/cjx_boolean.cpp index f5af9547a7..1e66a14e77 100644 --- a/fxjs/xfa/cjx_boolean.cpp +++ b/fxjs/xfa/cjx_boolean.cpp @@ -35,10 +35,10 @@ void CJX_Boolean::defaultValue(CFXJSE_Value* pValue, int32_t iValue = FXSYS_atoi(newValue.c_str()); WideString wsNewValue(iValue == 0 ? L"0" : L"1"); WideString wsFormatValue(wsNewValue); - CXFA_WidgetData* pContainerWidgetData = - ToNode(GetXFAObject())->GetContainerWidgetData(); - if (pContainerWidgetData) - wsFormatValue = pContainerWidgetData->GetFormatDataValue(wsNewValue); + CXFA_WidgetAcc* pContainerWidgetAcc = + ToNode(GetXFAObject())->GetContainerWidgetAcc(); + if (pContainerWidgetAcc) + wsFormatValue = pContainerWidgetAcc->GetFormatDataValue(wsNewValue); SetContent(wsNewValue, wsFormatValue, true, true, true); } diff --git a/fxjs/xfa/cjx_draw.cpp b/fxjs/xfa/cjx_draw.cpp index 0752bf7457..036cfc76bc 100644 --- a/fxjs/xfa/cjx_draw.cpp +++ b/fxjs/xfa/cjx_draw.cpp @@ -119,8 +119,8 @@ void CJX_Draw::defaultValue(CFXJSE_Value* pValue, if (!pValue || !pValue->IsString()) return; - CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); - XFA_Element uiType = pWidgetData->GetUIType(); + CXFA_WidgetAcc* pWidgetAcc = GetXFANode()->GetWidgetAcc(); + XFA_Element uiType = pWidgetAcc->GetUIType(); if (uiType != XFA_Element::Text) return; diff --git a/fxjs/xfa/cjx_exclgroup.cpp b/fxjs/xfa/cjx_exclgroup.cpp index fac58ff054..b7223ec200 100644 --- a/fxjs/xfa/cjx_exclgroup.cpp +++ b/fxjs/xfa/cjx_exclgroup.cpp @@ -16,7 +16,6 @@ #include "xfa/fxfa/fxfa.h" #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/cxfa_exclgroup.h" -#include "xfa/fxfa/parser/cxfa_widgetdata.h" const CJX_MethodSpec CJX_ExclGroup::MethodSpecs[] = { {"execCalculate", execCalculate_static}, @@ -86,15 +85,15 @@ CJS_Return CJX_ExclGroup::selectedMember( if (!params.empty()) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - CXFA_WidgetData* pWidgetData = GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + if (!pWidgetAcc) return CJS_Return(runtime->NewNull()); CXFA_Node* pReturnNode = nullptr; if (params.empty()) { - pReturnNode = pWidgetData->GetSelectedMember(); + pReturnNode = pWidgetAcc->GetSelectedMember(); } else { - pReturnNode = pWidgetData->SetSelectedMember( + pReturnNode = pWidgetAcc->SetSelectedMember( runtime->ToWideString(params[0]).AsStringView(), true); } if (!pReturnNode) @@ -111,13 +110,13 @@ CJS_Return CJX_ExclGroup::selectedMember( void CJX_ExclGroup::defaultValue(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetXFANode()->GetWidgetAcc(); + if (!pWidgetAcc) return; if (bSetting) { - pWidgetData->SetSelectedMemberByValue(pValue->ToWideString().AsStringView(), - true, true, true); + pWidgetAcc->SetSelectedMemberByValue(pValue->ToWideString().AsStringView(), + true, true, true); return; } diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp index a3e4405a17..cb0722eeee 100644 --- a/fxjs/xfa/cjx_field.cpp +++ b/fxjs/xfa/cjx_field.cpp @@ -17,7 +17,6 @@ #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/cxfa_field.h" #include "xfa/fxfa/parser/cxfa_value.h" -#include "xfa/fxfa/parser/cxfa_widgetdata.h" const CJX_MethodSpec CJX_Field::MethodSpecs[] = { {"addItem", addItem_static}, @@ -42,9 +41,9 @@ CJX_Field::~CJX_Field() {} CJS_Return CJX_Field::clearItems( CJS_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) { - CXFA_WidgetData* pWidgetData = GetWidgetData(); - if (pWidgetData) - pWidgetData->DeleteItem(-1, true, false); + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + if (pWidgetAcc) + pWidgetAcc->DeleteItem(-1, true, false); return CJS_Return(true); } @@ -83,12 +82,11 @@ CJS_Return CJX_Field::deleteItem( if (params.size() != 1) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - CXFA_WidgetData* pWidgetData = GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + if (!pWidgetAcc) return CJS_Return(true); - bool bValue = - pWidgetData->DeleteItem(runtime->ToInt32(params[0]), true, true); + bool bValue = pWidgetAcc->DeleteItem(runtime->ToInt32(params[0]), true, true); return CJS_Return(runtime->NewBoolean(bValue)); } @@ -102,12 +100,12 @@ CJS_Return CJX_Field::getSaveItem( if (iIndex < 0) return CJS_Return(runtime->NewNull()); - CXFA_WidgetData* pWidgetData = GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + if (!pWidgetAcc) return CJS_Return(runtime->NewNull()); pdfium::Optional<WideString> value = - pWidgetData->GetChoiceListItem(iIndex, true); + pWidgetAcc->GetChoiceListItem(iIndex, true); if (!value) return CJS_Return(runtime->NewNull()); @@ -120,12 +118,12 @@ CJS_Return CJX_Field::boundItem( if (params.size() != 1) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - CXFA_WidgetData* pWidgetData = GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + if (!pWidgetAcc) return CJS_Return(true); WideString value = runtime->ToWideString(params[0]); - WideString boundValue = pWidgetData->GetItemValue(value.AsStringView()); + WideString boundValue = pWidgetAcc->GetItemValue(value.AsStringView()); return CJS_Return(runtime->NewString(boundValue.UTF8Encode().AsStringView())); } @@ -135,11 +133,11 @@ CJS_Return CJX_Field::getItemState( if (params.size() != 1) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - CXFA_WidgetData* pWidgetData = GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + if (!pWidgetAcc) return CJS_Return(true); - int32_t state = pWidgetData->GetItemState(runtime->ToInt32(params[0])); + int32_t state = pWidgetAcc->GetItemState(runtime->ToInt32(params[0])); return CJS_Return(runtime->NewBoolean(state != 0)); } @@ -167,12 +165,12 @@ CJS_Return CJX_Field::getDisplayItem( if (iIndex < 0) return CJS_Return(runtime->NewNull()); - CXFA_WidgetData* pWidgetData = GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + if (!pWidgetAcc) return CJS_Return(runtime->NewNull()); pdfium::Optional<WideString> value = - pWidgetData->GetChoiceListItem(iIndex, false); + pWidgetAcc->GetChoiceListItem(iIndex, false); if (!value) return CJS_Return(runtime->NewNull()); @@ -185,17 +183,17 @@ CJS_Return CJX_Field::setItemState( if (params.size() != 2) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - CXFA_WidgetData* pWidgetData = GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + if (!pWidgetAcc) return CJS_Return(true); int32_t iIndex = runtime->ToInt32(params[0]); if (runtime->ToInt32(params[1]) != 0) { - pWidgetData->SetItemState(iIndex, true, true, true, true); + pWidgetAcc->SetItemState(iIndex, true, true, true, true); return CJS_Return(true); } - if (pWidgetData->GetItemState(iIndex)) - pWidgetData->SetItemState(iIndex, false, true, true, true); + if (pWidgetAcc->GetItemState(iIndex)) + pWidgetAcc->SetItemState(iIndex, false, true, true, true); return CJS_Return(true); } @@ -205,8 +203,8 @@ CJS_Return CJX_Field::addItem(CJS_V8* runtime, if (params.size() != 1 && params.size() != 2) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - CXFA_WidgetData* pWidgetData = GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + if (!pWidgetAcc) return CJS_Return(true); WideString label; @@ -217,7 +215,7 @@ CJS_Return CJX_Field::addItem(CJS_V8* runtime, if (params.size() >= 2) value = runtime->ToWideString(params[1]); - pWidgetData->InsertItem(label, value, true); + pWidgetAcc->InsertItem(label, value, true); return CJS_Return(true); } @@ -239,32 +237,30 @@ CJS_Return CJX_Field::execValidate( void CJX_Field::defaultValue(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetXFANode()->GetWidgetAcc(); + if (!pWidgetAcc) return; if (bSetting) { if (pValue) { - pWidgetData->SetPreNull(pWidgetData->IsNull()); - pWidgetData->SetIsNull(pValue->IsNull()); + pWidgetAcc->SetPreNull(pWidgetAcc->IsNull()); + pWidgetAcc->SetIsNull(pValue->IsNull()); } WideString wsNewText; if (pValue && !(pValue->IsNull() || pValue->IsUndefined())) wsNewText = pValue->ToWideString(); - CXFA_Node* pUIChild = pWidgetData->GetUIChild(); + CXFA_Node* pUIChild = pWidgetAcc->GetUIChild(); if (pUIChild->GetElementType() == XFA_Element::NumericEdit) { - wsNewText = - pWidgetData->NumericLimit(wsNewText, pWidgetData->GetLeadDigits(), - pWidgetData->GetFracDigits()); + wsNewText = pWidgetAcc->NumericLimit( + wsNewText, pWidgetAcc->GetLeadDigits(), pWidgetAcc->GetFracDigits()); } - CXFA_WidgetData* pContainerWidgetData = - GetXFANode()->GetContainerWidgetData(); + CXFA_WidgetAcc* pContainerWidgetAcc = GetXFANode()->GetContainerWidgetAcc(); WideString wsFormatText(wsNewText); - if (pContainerWidgetData) - wsFormatText = pContainerWidgetData->GetFormatDataValue(wsNewText); + if (pContainerWidgetAcc) + wsFormatText = pContainerWidgetAcc->GetFormatDataValue(wsNewText); SetContent(wsNewText, wsFormatText, true, true, true); return; @@ -276,9 +272,9 @@ void CJX_Field::defaultValue(CFXJSE_Value* pValue, return; } - CXFA_Node* pUIChild = pWidgetData->GetUIChild(); + CXFA_Node* pUIChild = pWidgetAcc->GetUIChild(); CXFA_Node* pNode = - pWidgetData->GetFormValue()->GetNodeItem(XFA_NODEITEM_FirstChild); + pWidgetAcc->GetFormValue()->GetNodeItem(XFA_NODEITEM_FirstChild); if (pNode && pNode->GetElementType() == XFA_Element::Decimal) { if (pUIChild->GetElementType() == XFA_Element::NumericEdit && (pNode->JSObject()->GetInteger(XFA_Attribute::FracDigits) == -1)) { @@ -302,16 +298,16 @@ void CJX_Field::defaultValue(CFXJSE_Value* pValue, void CJX_Field::editValue(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetXFANode()->GetWidgetAcc(); + if (!pWidgetAcc) return; if (bSetting) { - pWidgetData->SetValue(XFA_VALUEPICTURE_Edit, pValue->ToWideString()); + pWidgetAcc->SetValue(XFA_VALUEPICTURE_Edit, pValue->ToWideString()); return; } pValue->SetString( - pWidgetData->GetValue(XFA_VALUEPICTURE_Edit).UTF8Encode().AsStringView()); + pWidgetAcc->GetValue(XFA_VALUEPICTURE_Edit).UTF8Encode().AsStringView()); } void CJX_Field::formatMessage(CFXJSE_Value* pValue, @@ -323,15 +319,15 @@ void CJX_Field::formatMessage(CFXJSE_Value* pValue, void CJX_Field::formattedValue(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetXFANode()->GetWidgetAcc(); + if (!pWidgetAcc) return; if (bSetting) { - pWidgetData->SetValue(XFA_VALUEPICTURE_Display, pValue->ToWideString()); + pWidgetAcc->SetValue(XFA_VALUEPICTURE_Display, pValue->ToWideString()); return; } - pValue->SetString(pWidgetData->GetValue(XFA_VALUEPICTURE_Display) + pValue->SetString(pWidgetAcc->GetValue(XFA_VALUEPICTURE_Display) .UTF8Encode() .AsStringView()); } @@ -349,22 +345,22 @@ void CJX_Field::parentSubform(CFXJSE_Value* pValue, void CJX_Field::selectedIndex(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetXFANode()->GetWidgetAcc(); + if (!pWidgetAcc) return; if (!bSetting) { - pValue->SetInteger(pWidgetData->GetSelectedItem(0)); + pValue->SetInteger(pWidgetAcc->GetSelectedItem(0)); return; } int32_t iIndex = pValue->ToInteger(); if (iIndex == -1) { - pWidgetData->ClearAllSelections(); + pWidgetAcc->ClearAllSelections(); return; } - pWidgetData->SetItemState(iIndex, true, true, true, true); + pWidgetAcc->SetItemState(iIndex, true, true, true, true); } void CJX_Field::access(CFXJSE_Value* pValue, diff --git a/fxjs/xfa/cjx_hostpseudomodel.cpp b/fxjs/xfa/cjx_hostpseudomodel.cpp index f862accbe0..12aa2bdb2b 100644 --- a/fxjs/xfa/cjx_hostpseudomodel.cpp +++ b/fxjs/xfa/cjx_hostpseudomodel.cpp @@ -394,7 +394,7 @@ CJS_Return CJX_HostPseudoModel::resetData( continue; pNode = resolveNodeRS.objects.front()->AsNode(); - pNotify->ResetData(pNode->GetWidgetData()); + pNotify->ResetData(pNode->GetWidgetAcc()); } if (!pNode) pNotify->ResetData(); diff --git a/fxjs/xfa/cjx_manifest.cpp b/fxjs/xfa/cjx_manifest.cpp index bd482d0f4b..69c3e944df 100644 --- a/fxjs/xfa/cjx_manifest.cpp +++ b/fxjs/xfa/cjx_manifest.cpp @@ -27,8 +27,8 @@ CJS_Return CJX_Manifest::evaluate( if (!params.empty()) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - CXFA_WidgetData* pWidgetData = GetWidgetData(); - return CJS_Return(runtime->NewBoolean(!!pWidgetData)); + CXFA_WidgetAcc* pWidgetAcc = GetWidgetAcc(); + return CJS_Return(runtime->NewBoolean(!!pWidgetAcc)); } void CJX_Manifest::defaultValue(CFXJSE_Value* pValue, diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index e64f1fd5e7..c0634767cf 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp @@ -500,11 +500,11 @@ int32_t CJX_Node::execSingleEventByName(const WideStringView& wsEventName, return pNotify->ExecEventByDeepFirst( GetXFANode(), eventParaInfo->m_eventType, false, false); case EventAppliesToo::kSignature: { - CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetXFANode()->GetWidgetAcc(); + if (!pWidgetAcc) return XFA_EVENTERROR_NotExist; - CXFA_Node* pUINode = pWidgetData->GetUIChild(); + CXFA_Node* pUINode = pWidgetAcc->GetUIChild(); if (pUINode->GetElementType() != XFA_Element::Signature) return XFA_EVENTERROR_NotExist; @@ -512,13 +512,13 @@ int32_t CJX_Node::execSingleEventByName(const WideStringView& wsEventName, GetXFANode(), eventParaInfo->m_eventType, false, false); } case EventAppliesToo::kChoiceList: { - CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData(); - if (!pWidgetData) + CXFA_WidgetAcc* pWidgetAcc = GetXFANode()->GetWidgetAcc(); + if (!pWidgetAcc) return XFA_EVENTERROR_NotExist; - CXFA_Node* pUINode = pWidgetData->GetUIChild(); + CXFA_Node* pUINode = pWidgetAcc->GetUIChild(); if (pUINode->GetElementType() != XFA_Element::ChoiceList || - pWidgetData->IsListBox()) { + pWidgetAcc->IsListBox()) { return XFA_EVENTERROR_NotExist; } return pNotify->ExecEventByDeepFirst( diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index ce3f92a9bf..e574454673 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp @@ -21,6 +21,7 @@ #include "third_party/base/ptr_util.h" #include "xfa/fxfa/cxfa_ffnotify.h" #include "xfa/fxfa/cxfa_ffwidget.h" +#include "xfa/fxfa/cxfa_widgetacc.h" #include "xfa/fxfa/parser/cxfa_border.h" #include "xfa/fxfa/parser/cxfa_datavalue.h" #include "xfa/fxfa/parser/cxfa_document.h" @@ -1166,9 +1167,9 @@ void CJX_Object::MoveBufferMapData(CXFA_Object* pDstModule) { WideString wsValue = ToNode(pDstModule)->JSObject()->GetContent(false); WideString wsFormatValue(wsValue); - CXFA_WidgetData* pWidgetData = ToNode(pDstModule)->GetContainerWidgetData(); - if (pWidgetData) - wsFormatValue = pWidgetData->GetFormatDataValue(wsValue); + CXFA_WidgetAcc* pWidgetAcc = ToNode(pDstModule)->GetContainerWidgetAcc(); + if (pWidgetAcc) + wsFormatValue = pWidgetAcc->GetFormatDataValue(wsValue); ToNode(pDstModule) ->JSObject() @@ -1524,30 +1525,30 @@ void CJX_Object::Script_Som_DefaultValue(CFXJSE_Value* pValue, wsNewValue = pValue->ToWideString(); WideString wsFormatValue(wsNewValue); - CXFA_WidgetData* pContainerWidgetData = nullptr; + CXFA_WidgetAcc* pContainerWidgetAcc = nullptr; if (ToNode(GetXFAObject())->GetPacketType() == XFA_PacketType::Datasets) { WideString wsPicture; for (const auto& pFormNode : *(ToNode(GetXFAObject())->GetBindItems())) { if (!pFormNode || pFormNode->HasRemovedChildren()) continue; - pContainerWidgetData = pFormNode->GetContainerWidgetData(); - if (pContainerWidgetData) { - wsPicture = pContainerWidgetData->GetPictureContent( - XFA_VALUEPICTURE_DataBind); + pContainerWidgetAcc = pFormNode->GetContainerWidgetAcc(); + if (pContainerWidgetAcc) { + wsPicture = + pContainerWidgetAcc->GetPictureContent(XFA_VALUEPICTURE_DataBind); } if (!wsPicture.IsEmpty()) break; - pContainerWidgetData = nullptr; + pContainerWidgetAcc = nullptr; } } else if (ToNode(GetXFAObject())->GetPacketType() == XFA_PacketType::Form) { - pContainerWidgetData = ToNode(GetXFAObject())->GetContainerWidgetData(); + pContainerWidgetAcc = ToNode(GetXFAObject())->GetContainerWidgetAcc(); } - if (pContainerWidgetData) - wsFormatValue = pContainerWidgetData->GetFormatDataValue(wsNewValue); + if (pContainerWidgetAcc) + wsFormatValue = pContainerWidgetAcc->GetFormatDataValue(wsNewValue); SetContent(wsNewValue, wsFormatValue, true, true, true); return; diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h index 32bb01f3f6..d7979a381f 100644 --- a/fxjs/xfa/cjx_object.h +++ b/fxjs/xfa/cjx_object.h @@ -17,14 +17,15 @@ #include "core/fxcrt/xml/cfx_xmlelement.h" #include "fxjs/CJX_Define.h" #include "third_party/base/optional.h" +#include "xfa/fxfa/cxfa_widgetacc.h" #include "xfa/fxfa/fxfa_basic.h" -#include "xfa/fxfa/parser/cxfa_widgetdata.h" class CFXJSE_Value; class CJS_V8; class CXFA_CalcData; class CXFA_Document; class CXFA_LayoutItem; +class CXFA_Node; class CXFA_Object; struct XFA_MAPMODULEDATA; @@ -63,10 +64,10 @@ class CJX_Object { CXFA_Document* GetDocument() const; - void SetWidgetData(std::unique_ptr<CXFA_WidgetData> data) { + void SetWidgetAcc(std::unique_ptr<CXFA_WidgetAcc> data) { widget_data_ = std::move(data); } - CXFA_WidgetData* GetWidgetData() const { return widget_data_.get(); } + CXFA_WidgetAcc* GetWidgetAcc() const { return widget_data_.get(); } void SetCalcRecursionCount(size_t count) { calc_recursion_count_ = count; } size_t GetCalcRecursionCount() const { return calc_recursion_count_; } @@ -272,7 +273,7 @@ class CJX_Object { UnownedPtr<CXFA_Object> object_; UnownedPtr<CXFA_LayoutItem> layout_item_; - std::unique_ptr<CXFA_WidgetData> widget_data_; + std::unique_ptr<CXFA_WidgetAcc> widget_data_; std::unique_ptr<XFA_MAPMODULEDATA> map_module_data_; std::unique_ptr<CXFA_CalcData> calc_data_; std::map<ByteString, CJX_MethodCall> method_specs_; diff --git a/fxjs/xfa/cjx_template.cpp b/fxjs/xfa/cjx_template.cpp index d55fd66452..9e72257cf3 100644 --- a/fxjs/xfa/cjx_template.cpp +++ b/fxjs/xfa/cjx_template.cpp @@ -50,7 +50,7 @@ CJS_Return CJX_Template::execInitialize( const std::vector<v8::Local<v8::Value>>& params) { if (!params.empty()) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - return CJS_Return(runtime->NewBoolean(!!GetWidgetData())); + return CJS_Return(runtime->NewBoolean(!!GetWidgetAcc())); } CJS_Return CJX_Template::recalculate( @@ -66,7 +66,7 @@ CJS_Return CJX_Template::execCalculate( const std::vector<v8::Local<v8::Value>>& params) { if (!params.empty()) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - return CJS_Return(runtime->NewBoolean(!!GetWidgetData())); + return CJS_Return(runtime->NewBoolean(!!GetWidgetAcc())); } CJS_Return CJX_Template::execValidate( @@ -74,5 +74,5 @@ CJS_Return CJX_Template::execValidate( const std::vector<v8::Local<v8::Value>>& params) { if (!params.empty()) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - return CJS_Return(runtime->NewBoolean(!!GetWidgetData())); + return CJS_Return(runtime->NewBoolean(!!GetWidgetAcc())); } |