From c0c3b8cb21296f182da3be97acf175346bc06004 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 7 Nov 2017 20:03:02 +0000 Subject: Rename CXFA_Corner to CXFA_CornerData This CL renames CXFA_Corner to CXFA_CornerData to make it clear it's part of the data hierarchy. Change-Id: I9428c7a09735f11089de344fa148edc86e6e4694 Reviewed-on: https://pdfium-review.googlesource.com/17978 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- BUILD.gn | 2 +- xfa/fxfa/cxfa_ffwidget.cpp | 26 +++++++++++++------------- xfa/fxfa/parser/cxfa_boxdata.cpp | 8 ++++---- xfa/fxfa/parser/cxfa_corner.h | 19 ------------------- xfa/fxfa/parser/cxfa_cornerdata.h | 19 +++++++++++++++++++ 5 files changed, 37 insertions(+), 37 deletions(-) delete mode 100644 xfa/fxfa/parser/cxfa_corner.h create mode 100644 xfa/fxfa/parser/cxfa_cornerdata.h diff --git a/BUILD.gn b/BUILD.gn index 8547b4afd9..11a6b396c7 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1807,7 +1807,7 @@ if (pdf_enable_xfa) { "xfa/fxfa/parser/cxfa_containerlayoutitem.h", "xfa/fxfa/parser/cxfa_contentlayoutitem.cpp", "xfa/fxfa/parser/cxfa_contentlayoutitem.h", - "xfa/fxfa/parser/cxfa_corner.h", + "xfa/fxfa/parser/cxfa_cornerdata.h", "xfa/fxfa/parser/cxfa_data.cpp", "xfa/fxfa/parser/cxfa_data.h", "xfa/fxfa/parser/cxfa_dataexporter.cpp", diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index cca04dac5e..f6949c4853 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -28,7 +28,7 @@ #include "xfa/fxfa/cxfa_ffpageview.h" #include "xfa/fxfa/cxfa_textlayout.h" #include "xfa/fxfa/cxfa_widgetacc.h" -#include "xfa/fxfa/parser/cxfa_corner.h" +#include "xfa/fxfa/parser/cxfa_cornerdata.h" #include "xfa/fxfa/parser/cxfa_node.h" #include "xfa/fxgraphics/cxfa_color.h" #include "xfa/fxgraphics/cxfa_graphics.h" @@ -73,14 +73,14 @@ void XFA_BOX_GetPath(const std::vector& strokes, bool bCorner) { ASSERT(nIndex >= 0 && nIndex < 8); int32_t n = (nIndex & 1) ? nIndex - 1 : nIndex; - CXFA_Corner corner1(strokes[n].GetNode()); - CXFA_Corner corner2(strokes[(n + 2) % 8].GetNode()); - float fRadius1 = bCorner ? corner1.GetRadius() : 0.0f; - float fRadius2 = bCorner ? corner2.GetRadius() : 0.0f; - bool bInverted = corner1.IsInverted(); + CXFA_CornerData cornerData1(strokes[n].GetNode()); + CXFA_CornerData cornerData2(strokes[(n + 2) % 8].GetNode()); + float fRadius1 = bCorner ? cornerData1.GetRadius() : 0.0f; + float fRadius2 = bCorner ? cornerData2.GetRadius() : 0.0f; + bool bInverted = cornerData1.IsInverted(); float offsetY = 0.0f; float offsetX = 0.0f; - bool bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; + bool bRound = cornerData1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; float halfAfter = 0.0f; float halfBefore = 0.0f; CXFA_Stroke stroke = strokes[nIndex]; @@ -300,12 +300,12 @@ void XFA_BOX_GetFillPath(CXFA_BoxData boxData, float nx = 1.0f; float ny = 1.0f; CFX_PointF cp1, cp2; - CXFA_Corner corner1(strokes[i].GetNode()); - CXFA_Corner corner2(strokes[(i + 2) % 8].GetNode()); - float fRadius1 = corner1.GetRadius(); - float fRadius2 = corner2.GetRadius(); - bool bInverted = corner1.IsInverted(); - bool bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; + CXFA_CornerData cornerData1(strokes[i].GetNode()); + CXFA_CornerData cornerData2(strokes[(i + 2) % 8].GetNode()); + float fRadius1 = cornerData1.GetRadius(); + float fRadius2 = cornerData2.GetRadius(); + bool bInverted = cornerData1.IsInverted(); + bool bRound = cornerData1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; if (bRound) { sy = FX_PI / 2; } diff --git a/xfa/fxfa/parser/cxfa_boxdata.cpp b/xfa/fxfa/parser/cxfa_boxdata.cpp index c7a58a1c27..51fadffd79 100644 --- a/xfa/fxfa/parser/cxfa_boxdata.cpp +++ b/xfa/fxfa/parser/cxfa_boxdata.cpp @@ -6,7 +6,7 @@ #include "xfa/fxfa/parser/cxfa_boxdata.h" -#include "xfa/fxfa/parser/cxfa_corner.h" +#include "xfa/fxfa/parser/cxfa_cornerdata.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/cxfa_node.h" @@ -22,10 +22,10 @@ void GetStrokesInternal(CXFA_Node* pNode, strokes->resize(8); int32_t i, j; for (i = 0, j = 0; i < 4; i++) { - CXFA_Corner corner = CXFA_Corner( + CXFA_CornerData cornerData = CXFA_CornerData( pNode->JSNode()->GetProperty(i, XFA_Element::Corner, i == 0)); - if (corner || i == 0) { - (*strokes)[j] = corner; + if (cornerData || i == 0) { + (*strokes)[j] = cornerData; } else if (!bNull) { if (i == 1 || i == 2) (*strokes)[j] = (*strokes)[0]; diff --git a/xfa/fxfa/parser/cxfa_corner.h b/xfa/fxfa/parser/cxfa_corner.h deleted file mode 100644 index 7665c53812..0000000000 --- a/xfa/fxfa/parser/cxfa_corner.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FXFA_PARSER_CXFA_CORNER_H_ -#define XFA_FXFA_PARSER_CXFA_CORNER_H_ - -#include "xfa/fxfa/parser/cxfa_stroke.h" - -class CXFA_Node; - -class CXFA_Corner : public CXFA_Stroke { - public: - explicit CXFA_Corner(CXFA_Node* pNode) : CXFA_Stroke(pNode) {} -}; - -#endif // XFA_FXFA_PARSER_CXFA_CORNER_H_ diff --git a/xfa/fxfa/parser/cxfa_cornerdata.h b/xfa/fxfa/parser/cxfa_cornerdata.h new file mode 100644 index 0000000000..be0b602d78 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_cornerdata.h @@ -0,0 +1,19 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_PARSER_CXFA_CORNERDATA_H_ +#define XFA_FXFA_PARSER_CXFA_CORNERDATA_H_ + +#include "xfa/fxfa/parser/cxfa_stroke.h" + +class CXFA_Node; + +class CXFA_CornerData : public CXFA_Stroke { + public: + explicit CXFA_CornerData(CXFA_Node* pNode) : CXFA_Stroke(pNode) {} +}; + +#endif // XFA_FXFA_PARSER_CXFA_CORNERDATA_H_ -- cgit v1.2.3