summaryrefslogtreecommitdiff
path: root/fxjs/xfa/cjx_node.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-12 18:54:48 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-12 18:54:48 +0000
commitebcbb85ea364605baf8e382ad66793bf1b4db029 (patch)
tree2c546368c63f65d7786a1ab9c818cb07b80d599c /fxjs/xfa/cjx_node.cpp
parent4b004930490e416a2a404deee5de4b97e649a1c1 (diff)
downloadpdfium-ebcbb85ea364605baf8e382ad66793bf1b4db029.tar.xz
Move Script_Som_Border{Width|Color} to CJX_Object
The CJX_Node isn't the root of the CJX hierarchy. This causes issues now that CJX_Object has child objects which don't inherit from CJX_Node. This CL moves Script_Som_Border{Width|Color} from CJX_Node to CJX_Object. Change-Id: I07ba9ef2af675993c9f4d14cb74f48252a907569 Reviewed-on: https://pdfium-review.googlesource.com/20990 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/xfa/cjx_node.cpp')
-rw-r--r--fxjs/xfa/cjx_node.cpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp
index 8234fa6be7..c0a7f37675 100644
--- a/fxjs/xfa/cjx_node.cpp
+++ b/fxjs/xfa/cjx_node.cpp
@@ -789,58 +789,6 @@ void CJX_Node::Script_Boolean_Value(CFXJSE_Value* pValue,
SetContent(wsNewValue, wsFormatValue, true, true, true);
}
-void CJX_Node::Script_Som_BorderColor(CFXJSE_Value* pValue,
- bool bSetting,
- XFA_Attribute eAttribute) {
- CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData();
- if (!pWidgetData)
- return;
-
- CXFA_BorderData borderData = pWidgetData->GetBorderData(true);
- int32_t iSize = borderData.CountEdges();
- if (bSetting) {
- int32_t r = 0;
- int32_t g = 0;
- int32_t b = 0;
- std::tie(r, g, b) = StrToRGB(pValue->ToWideString());
- FX_ARGB rgb = ArgbEncode(100, r, g, b);
- for (int32_t i = 0; i < iSize; ++i)
- borderData.GetEdgeData(i).SetColor(rgb);
-
- return;
- }
-
- FX_ARGB color = borderData.GetEdgeData(0).GetColor();
- int32_t a;
- int32_t r;
- int32_t g;
- int32_t b;
- std::tie(a, r, g, b) = ArgbDecode(color);
- pValue->SetString(
- WideString::Format(L"%d,%d,%d", r, g, b).UTF8Encode().AsStringView());
-}
-
-void CJX_Node::Script_Som_BorderWidth(CFXJSE_Value* pValue,
- bool bSetting,
- XFA_Attribute eAttribute) {
- CXFA_WidgetData* pWidgetData = GetXFANode()->GetWidgetData();
- if (!pWidgetData)
- return;
-
- CXFA_BorderData borderData = pWidgetData->GetBorderData(true);
- if (bSetting) {
- CXFA_Measurement thickness = borderData.GetEdgeData(0).GetMSThickness();
- pValue->SetString(thickness.ToString().UTF8Encode().AsStringView());
- return;
- }
-
- WideString wsThickness = pValue->ToWideString();
- for (int32_t i = 0; i < borderData.CountEdges(); ++i) {
- borderData.GetEdgeData(i).SetMSThickness(
- CXFA_Measurement(wsThickness.AsStringView()));
- }
-}
-
void CJX_Node::Script_Som_FillColor(CFXJSE_Value* pValue,
bool bSetting,
XFA_Attribute eAttribute) {
@@ -1343,10 +1291,6 @@ void CJX_Node::Script_Encrypt_Format(CFXJSE_Value* pValue,
bool bSetting,
XFA_Attribute eAttribute) {}
-void CJX_Node::SetWidgetData(std::unique_ptr<CXFA_WidgetData> data) {
- widget_data_ = std::move(data);
-}
-
pdfium::Optional<WideString> CJX_Node::TryNamespace() {
if (GetXFANode()->IsModelNode() ||
GetXFANode()->GetElementType() == XFA_Element::Packet) {