diff options
-rw-r--r-- | BUILD.gn | 2 | ||||
-rw-r--r-- | fxjs/cjx_node.cpp | 20 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_edittp.cpp | 5 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffbarcode.cpp | 3 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffcheckbutton.cpp | 9 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fffield.cpp | 9 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffimageedit.cpp | 3 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffpushbutton.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffsignature.cpp | 3 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffwidget.cpp | 8 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_borderdata.h (renamed from xfa/fxfa/parser/cxfa_border.h) | 10 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.cpp | 18 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.h | 6 |
13 files changed, 49 insertions, 53 deletions
@@ -1796,7 +1796,7 @@ if (pdf_enable_xfa) { "xfa/fxfa/parser/cxfa_binddata.h", "xfa/fxfa/parser/cxfa_binditemsdata.cpp", "xfa/fxfa/parser/cxfa_binditemsdata.h", - "xfa/fxfa/parser/cxfa_border.h", + "xfa/fxfa/parser/cxfa_borderdata.h", "xfa/fxfa/parser/cxfa_box.cpp", "xfa/fxfa/parser/cxfa_box.h", "xfa/fxfa/parser/cxfa_calculate.cpp", diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp index c710d31812..224d295755 100644 --- a/fxjs/cjx_node.cpp +++ b/fxjs/cjx_node.cpp @@ -1528,8 +1528,8 @@ void CJX_Node::Script_Som_BorderColor(CFXJSE_Value* pValue, if (!pWidgetData) { return; } - CXFA_Border border = pWidgetData->GetBorder(true); - int32_t iSize = border.CountEdges(); + CXFA_BorderData borderData = pWidgetData->GetBorderData(true); + int32_t iSize = borderData.CountEdges(); if (bSetting) { int32_t r = 0; int32_t g = 0; @@ -1537,11 +1537,11 @@ void CJX_Node::Script_Som_BorderColor(CFXJSE_Value* pValue, StrToRGB(pValue->ToWideString(), r, g, b); FX_ARGB rgb = ArgbEncode(100, r, g, b); for (int32_t i = 0; i < iSize; ++i) { - CXFA_Edge edge = border.GetEdge(i); + CXFA_Edge edge = borderData.GetEdge(i); edge.SetColor(rgb); } } else { - CXFA_Edge edge = border.GetEdge(0); + CXFA_Edge edge = borderData.GetEdge(0); FX_ARGB color = edge.GetColor(); int32_t a; int32_t r; @@ -1561,18 +1561,18 @@ void CJX_Node::Script_Som_BorderWidth(CFXJSE_Value* pValue, if (!pWidgetData) { return; } - CXFA_Border border = pWidgetData->GetBorder(true); - int32_t iSize = border.CountEdges(); + CXFA_BorderData borderData = pWidgetData->GetBorderData(true); + int32_t iSize = borderData.CountEdges(); WideString wsThickness; if (bSetting) { wsThickness = pValue->ToWideString(); for (int32_t i = 0; i < iSize; ++i) { - CXFA_Edge edge = border.GetEdge(i); + CXFA_Edge edge = borderData.GetEdge(i); CXFA_Measurement thickness(wsThickness.AsStringView()); edge.SetMSThickness(thickness); } } else { - CXFA_Edge edge = border.GetEdge(0); + CXFA_Edge edge = borderData.GetEdge(0); CXFA_Measurement thickness = edge.GetMSThickness(); thickness.ToString(&wsThickness); pValue->SetString(wsThickness.UTF8Encode().AsStringView()); @@ -1586,8 +1586,8 @@ void CJX_Node::Script_Som_FillColor(CFXJSE_Value* pValue, if (!pWidgetData) { return; } - CXFA_Border border = pWidgetData->GetBorder(true); - CXFA_Fill borderfill = border.GetFill(true); + CXFA_BorderData borderData = pWidgetData->GetBorderData(true); + CXFA_Fill borderfill = borderData.GetFill(true); CXFA_Node* pNode = borderfill.GetNode(); if (!pNode) { return; diff --git a/xfa/fwl/theme/cfwl_edittp.cpp b/xfa/fwl/theme/cfwl_edittp.cpp index 0300deaba4..c01d5c9158 100644 --- a/xfa/fwl/theme/cfwl_edittp.cpp +++ b/xfa/fwl/theme/cfwl_edittp.cpp @@ -21,10 +21,11 @@ CFWL_EditTP::~CFWL_EditTP() {} void CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) { if (CFWL_Part::CombTextLine == pParams->m_iPart) { CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget); + CXFA_BorderData borderUIData = pWidget->GetDataAcc()->GetUIBorderData(); FX_ARGB cr = 0xFF000000; float fWidth = 1.0f; - if (CXFA_Border borderUI = pWidget->GetDataAcc()->GetUIBorder()) { - CXFA_Edge edge = borderUI.GetEdge(0); + if (borderUIData) { + CXFA_Edge edge = borderUIData.GetEdge(0); if (edge) { cr = edge.GetColor(); fWidth = edge.GetThickness(); diff --git a/xfa/fxfa/cxfa_ffbarcode.cpp b/xfa/fxfa/cxfa_ffbarcode.cpp index 9686416f89..5dd30dcf56 100644 --- a/xfa/fxfa/cxfa_ffbarcode.cpp +++ b/xfa/fxfa/cxfa_ffbarcode.cpp @@ -147,8 +147,7 @@ void CXFA_FFBarcode::RenderWidget(CXFA_Graphics* pGS, mtRotate.Concat(matrix); CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); - CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - DrawBorder(pGS, borderUI, m_rtUI, mtRotate); + DrawBorder(pGS, m_pDataAcc->GetUIBorderData(), m_rtUI, mtRotate); RenderCaption(pGS, &mtRotate); CFX_RectF rtWidget = m_pNormalWidget->GetWidgetRect(); diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp index 05c5a72ef5..ab303b08dd 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.cpp +++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp @@ -172,9 +172,9 @@ bool CXFA_FFCheckButton::PerformLayout() { m_rtUI.height = fCheckSize; AddUIMargin(iCapPlacement); m_rtCheckBox = m_rtUI; - CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - if (borderUI) { - CXFA_Margin margin = borderUI.GetMargin(); + CXFA_BorderData borderUIData = m_pDataAcc->GetUIBorderData(); + if (borderUIData) { + CXFA_Margin margin = borderUIData.GetMargin(); if (margin) XFA_RectWidthoutMargin(m_rtUI, margin); } @@ -232,9 +232,8 @@ void CXFA_FFCheckButton::RenderWidget(CXFA_Graphics* pGS, mtRotate.Concat(matrix); CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); - CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorderWithFlags( - pGS, borderUI, m_rtUI, mtRotate, + pGS, m_pDataAcc->GetUIBorderData(), m_rtUI, mtRotate, m_pDataAcc->GetCheckButtonShape() == XFA_ATTRIBUTEENUM_Round ? XFA_DRAWBOX_ForceRound : 0); diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp index 09ea23f9eb..f6c21d9fd7 100644 --- a/xfa/fxfa/cxfa_fffield.cpp +++ b/xfa/fxfa/cxfa_fffield.cpp @@ -65,8 +65,7 @@ void CXFA_FFField::RenderWidget(CXFA_Graphics* pGS, mtRotate.Concat(matrix); CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); - CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - DrawBorder(pGS, borderUI, m_rtUI, mtRotate); + DrawBorder(pGS, m_pDataAcc->GetUIBorderData(), m_rtUI, mtRotate); RenderCaption(pGS, &mtRotate); DrawHighlight(pGS, &mtRotate, dwStatus, false); @@ -267,9 +266,9 @@ void CXFA_FFField::CapPlacement() { break; } - CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - if (borderUI) { - CXFA_Margin margin = borderUI.GetMargin(); + CXFA_BorderData borderUIData = m_pDataAcc->GetUIBorderData(); + if (borderUIData) { + CXFA_Margin margin = borderUIData.GetMargin(); if (margin) XFA_RectWidthoutMargin(m_rtUI, margin); } diff --git a/xfa/fxfa/cxfa_ffimageedit.cpp b/xfa/fxfa/cxfa_ffimageedit.cpp index 2189877afb..14d66e6198 100644 --- a/xfa/fxfa/cxfa_ffimageedit.cpp +++ b/xfa/fxfa/cxfa_ffimageedit.cpp @@ -61,8 +61,7 @@ void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS, mtRotate.Concat(matrix); CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); - CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - DrawBorder(pGS, borderUI, m_rtUI, mtRotate); + DrawBorder(pGS, m_pDataAcc->GetUIBorderData(), m_rtUI, mtRotate); RenderCaption(pGS, &mtRotate); RetainPtr<CFX_DIBitmap> pDIBitmap = m_pDataAcc->GetImageEditImage(); if (!pDIBitmap) diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp index 2f2c133ede..7c532fc01f 100644 --- a/xfa/fxfa/cxfa_ffpushbutton.cpp +++ b/xfa/fxfa/cxfa_ffpushbutton.cpp @@ -113,9 +113,9 @@ bool CXFA_FFPushButton::PerformLayout() { return true; } float CXFA_FFPushButton::GetLineWidth() { - CXFA_Border border = m_pDataAcc->GetBorder(false); - if (border && border.GetPresence() == XFA_ATTRIBUTEENUM_Visible) { - CXFA_Edge edge = border.GetEdge(0); + CXFA_BorderData borderData = m_pDataAcc->GetBorderData(false); + if (borderData && borderData.GetPresence() == XFA_ATTRIBUTEENUM_Visible) { + CXFA_Edge edge = borderData.GetEdge(0); return edge.GetThickness(); } return 0; diff --git a/xfa/fxfa/cxfa_ffsignature.cpp b/xfa/fxfa/cxfa_ffsignature.cpp index 202e387f89..3aeddfd970 100644 --- a/xfa/fxfa/cxfa_ffsignature.cpp +++ b/xfa/fxfa/cxfa_ffsignature.cpp @@ -31,8 +31,7 @@ void CXFA_FFSignature::RenderWidget(CXFA_Graphics* pGS, CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); - CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - DrawBorder(pGS, borderUI, m_rtUI, mtRotate); + DrawBorder(pGS, m_pDataAcc->GetUIBorderData(), m_rtUI, mtRotate); RenderCaption(pGS, &mtRotate); DrawHighlight(pGS, &mtRotate, dwStatus, false); } diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 5cfa836aed..dad1f01afd 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -993,17 +993,17 @@ void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS, if (!IsMatchVisibleStatus(dwStatus)) return; - CXFA_Border border = m_pDataAcc->GetBorder(false); - if (!border) + CXFA_BorderData borderData = m_pDataAcc->GetBorderData(false); + if (!borderData) return; CFX_RectF rtBorder = GetRectWithoutRotate(); - CXFA_Margin margin = border.GetMargin(); + CXFA_Margin margin = borderData.GetMargin(); if (margin) XFA_RectWidthoutMargin(rtBorder, margin); rtBorder.Normalize(); - DrawBorder(pGS, border, rtBorder, matrix); + DrawBorder(pGS, borderData, rtBorder, matrix); } bool CXFA_FFWidget::IsLoaded() { diff --git a/xfa/fxfa/parser/cxfa_border.h b/xfa/fxfa/parser/cxfa_borderdata.h index 27b469cd2f..20e66562e5 100644 --- a/xfa/fxfa/parser/cxfa_border.h +++ b/xfa/fxfa/parser/cxfa_borderdata.h @@ -4,16 +4,16 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#ifndef XFA_FXFA_PARSER_CXFA_BORDER_H_ -#define XFA_FXFA_PARSER_CXFA_BORDER_H_ +#ifndef XFA_FXFA_PARSER_CXFA_BORDERDATA_H_ +#define XFA_FXFA_PARSER_CXFA_BORDERDATA_H_ #include "xfa/fxfa/parser/cxfa_box.h" class CXFA_Node; -class CXFA_Border : public CXFA_Box { +class CXFA_BorderData : public CXFA_Box { public: - explicit CXFA_Border(CXFA_Node* pNode) : CXFA_Box(pNode) {} + explicit CXFA_BorderData(CXFA_Node* pNode) : CXFA_Box(pNode) {} }; -#endif // XFA_FXFA_PARSER_CXFA_BORDER_H_ +#endif // XFA_FXFA_PARSER_CXFA_BORDERDATA_H_ diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 75de937944..ae857cb9c5 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -279,8 +279,8 @@ int32_t CXFA_WidgetData::GetRotate() { return iRotate / 90 * 90; } -CXFA_Border CXFA_WidgetData::GetBorder(bool bModified) { - return CXFA_Border( +CXFA_BorderData CXFA_WidgetData::GetBorderData(bool bModified) { + return CXFA_BorderData( m_pNode->JSNode()->GetProperty(0, XFA_Element::Border, bModified)); } @@ -387,9 +387,9 @@ bool CXFA_WidgetData::GetMaxHeight(float& fMaxHeight) { return TryMeasure(XFA_ATTRIBUTE_MaxH, fMaxHeight); } -CXFA_Border CXFA_WidgetData::GetUIBorder() { +CXFA_BorderData CXFA_WidgetData::GetUIBorderData() { CXFA_Node* pUIChild = GetUIChild(); - return CXFA_Border( + return CXFA_BorderData( pUIChild ? pUIChild->JSNode()->GetProperty(0, XFA_Element::Border, false) : nullptr); } @@ -403,8 +403,8 @@ CFX_RectF CXFA_WidgetData::GetUIMargin() { if (!mgUI) return CFX_RectF(); - CXFA_Border border = GetUIBorder(); - if (border && border.GetPresence() != XFA_ATTRIBUTEENUM_Visible) + CXFA_BorderData borderData = GetUIBorderData(); + if (borderData && borderData.GetPresence() != XFA_ATTRIBUTEENUM_Visible) return CFX_RectF(); float fLeftInset, fTopInset, fRightInset, fBottomInset; @@ -412,13 +412,13 @@ CFX_RectF CXFA_WidgetData::GetUIMargin() { bool bTop = mgUI.GetTopInset(fTopInset); bool bRight = mgUI.GetRightInset(fRightInset); bool bBottom = mgUI.GetBottomInset(fBottomInset); - if (border) { + if (borderData) { bool bVisible = false; float fThickness = 0; - border.Get3DStyle(bVisible, fThickness); + borderData.Get3DStyle(bVisible, fThickness); if (!bLeft || !bTop || !bRight || !bBottom) { std::vector<CXFA_Stroke> strokes; - border.GetStrokes(&strokes); + borderData.GetStrokes(&strokes); if (!bTop) fTopInset = GetEdgeThickness(strokes, bVisible, 0); if (!bRight) diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h index deeb51d9ce..f741a33858 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.h +++ b/xfa/fxfa/parser/cxfa_widgetdata.h @@ -14,7 +14,7 @@ #include "core/fxcrt/fx_system.h" #include "xfa/fxfa/parser/cxfa_assistdata.h" #include "xfa/fxfa/parser/cxfa_binddata.h" -#include "xfa/fxfa/parser/cxfa_border.h" +#include "xfa/fxfa/parser/cxfa_borderdata.h" #include "xfa/fxfa/parser/cxfa_calculate.h" #include "xfa/fxfa/parser/cxfa_caption.h" #include "xfa/fxfa/parser/cxfa_data.h" @@ -50,7 +50,7 @@ class CXFA_WidgetData : public CXFA_Data { int32_t GetRotate(); CXFA_AssistData GetAssistData(); - CXFA_Border GetBorder(bool bModified); + CXFA_BorderData GetBorderData(bool bModified); CXFA_Caption GetCaption(); CXFA_Font GetFont(bool bModified); CXFA_Margin GetMargin(); @@ -70,7 +70,7 @@ class CXFA_WidgetData : public CXFA_Data { bool GetMaxWidth(float& fMaxWidth); bool GetMaxHeight(float& fMaxHeight); - CXFA_Border GetUIBorder(); + CXFA_BorderData GetUIBorderData(); CFX_RectF GetUIMargin(); int32_t GetButtonHighlight(); bool GetButtonRollover(WideString& wsRollover, bool& bRichText); |