From 5fe712cb6c605e597f65f6b4cd0afa3213234639 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 7 Nov 2017 20:59:30 +0000 Subject: Rename CXFA_Para to CXFA_ParaData This CL renames CXFA_Para to CXFA_ParaData to show it is part of the data hierarchy. Change-Id: I71f58c87416b17d1e59252ca374aad13935fc430 Reviewed-on: https://pdfium-review.googlesource.com/17989 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fxfa/parser/cxfa_para.cpp | 60 ------------------------------------- xfa/fxfa/parser/cxfa_para.h | 29 ------------------ xfa/fxfa/parser/cxfa_paradata.cpp | 60 +++++++++++++++++++++++++++++++++++++ xfa/fxfa/parser/cxfa_paradata.h | 29 ++++++++++++++++++ xfa/fxfa/parser/cxfa_widgetdata.cpp | 5 ++-- xfa/fxfa/parser/cxfa_widgetdata.h | 4 +-- 6 files changed, 94 insertions(+), 93 deletions(-) delete mode 100644 xfa/fxfa/parser/cxfa_para.cpp delete mode 100644 xfa/fxfa/parser/cxfa_para.h create mode 100644 xfa/fxfa/parser/cxfa_paradata.cpp create mode 100644 xfa/fxfa/parser/cxfa_paradata.h (limited to 'xfa/fxfa/parser') diff --git a/xfa/fxfa/parser/cxfa_para.cpp b/xfa/fxfa/parser/cxfa_para.cpp deleted file mode 100644 index 34555a9732..0000000000 --- a/xfa/fxfa/parser/cxfa_para.cpp +++ /dev/null @@ -1,60 +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 - -#include "xfa/fxfa/parser/cxfa_para.h" - -#include "xfa/fxfa/parser/cxfa_measurement.h" -#include "xfa/fxfa/parser/cxfa_node.h" - -CXFA_Para::CXFA_Para(CXFA_Node* pNode) : CXFA_Data(pNode) {} - -int32_t CXFA_Para::GetHorizontalAlign() { - XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Left; - m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_HAlign, eAttr, true); - return eAttr; -} - -int32_t CXFA_Para::GetVerticalAlign() { - XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Top; - m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_VAlign, eAttr, true); - return eAttr; -} - -float CXFA_Para::GetLineHeight() { - CXFA_Measurement ms; - m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_LineHeight, ms, true); - return ms.ToUnit(XFA_UNIT_Pt); -} - -float CXFA_Para::GetMarginLeft() { - CXFA_Measurement ms; - m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_MarginLeft, ms, true); - return ms.ToUnit(XFA_UNIT_Pt); -} - -float CXFA_Para::GetMarginRight() { - CXFA_Measurement ms; - m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_MarginRight, ms, true); - return ms.ToUnit(XFA_UNIT_Pt); -} - -float CXFA_Para::GetSpaceAbove() { - CXFA_Measurement ms; - m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_SpaceAbove, ms, true); - return ms.ToUnit(XFA_UNIT_Pt); -} - -float CXFA_Para::GetSpaceBelow() { - CXFA_Measurement ms; - m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_SpaceBelow, ms, true); - return ms.ToUnit(XFA_UNIT_Pt); -} - -float CXFA_Para::GetTextIndent() { - CXFA_Measurement ms; - m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_TextIndent, ms, true); - return ms.ToUnit(XFA_UNIT_Pt); -} diff --git a/xfa/fxfa/parser/cxfa_para.h b/xfa/fxfa/parser/cxfa_para.h deleted file mode 100644 index c2d67b8a19..0000000000 --- a/xfa/fxfa/parser/cxfa_para.h +++ /dev/null @@ -1,29 +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_PARA_H_ -#define XFA_FXFA_PARSER_CXFA_PARA_H_ - -#include "core/fxcrt/fx_system.h" -#include "xfa/fxfa/parser/cxfa_data.h" - -class CXFA_Node; - -class CXFA_Para : public CXFA_Data { - public: - explicit CXFA_Para(CXFA_Node* pNode); - - int32_t GetHorizontalAlign(); - int32_t GetVerticalAlign(); - float GetLineHeight(); - float GetMarginLeft(); - float GetMarginRight(); - float GetSpaceAbove(); - float GetSpaceBelow(); - float GetTextIndent(); -}; - -#endif // XFA_FXFA_PARSER_CXFA_PARA_H_ diff --git a/xfa/fxfa/parser/cxfa_paradata.cpp b/xfa/fxfa/parser/cxfa_paradata.cpp new file mode 100644 index 0000000000..44d5c941fd --- /dev/null +++ b/xfa/fxfa/parser/cxfa_paradata.cpp @@ -0,0 +1,60 @@ +// 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 + +#include "xfa/fxfa/parser/cxfa_paradata.h" + +#include "xfa/fxfa/parser/cxfa_measurement.h" +#include "xfa/fxfa/parser/cxfa_node.h" + +CXFA_ParaData::CXFA_ParaData(CXFA_Node* pNode) : CXFA_Data(pNode) {} + +int32_t CXFA_ParaData::GetHorizontalAlign() { + XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Left; + m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_HAlign, eAttr, true); + return eAttr; +} + +int32_t CXFA_ParaData::GetVerticalAlign() { + XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Top; + m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_VAlign, eAttr, true); + return eAttr; +} + +float CXFA_ParaData::GetLineHeight() { + CXFA_Measurement ms; + m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_LineHeight, ms, true); + return ms.ToUnit(XFA_UNIT_Pt); +} + +float CXFA_ParaData::GetMarginLeft() { + CXFA_Measurement ms; + m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_MarginLeft, ms, true); + return ms.ToUnit(XFA_UNIT_Pt); +} + +float CXFA_ParaData::GetMarginRight() { + CXFA_Measurement ms; + m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_MarginRight, ms, true); + return ms.ToUnit(XFA_UNIT_Pt); +} + +float CXFA_ParaData::GetSpaceAbove() { + CXFA_Measurement ms; + m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_SpaceAbove, ms, true); + return ms.ToUnit(XFA_UNIT_Pt); +} + +float CXFA_ParaData::GetSpaceBelow() { + CXFA_Measurement ms; + m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_SpaceBelow, ms, true); + return ms.ToUnit(XFA_UNIT_Pt); +} + +float CXFA_ParaData::GetTextIndent() { + CXFA_Measurement ms; + m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_TextIndent, ms, true); + return ms.ToUnit(XFA_UNIT_Pt); +} diff --git a/xfa/fxfa/parser/cxfa_paradata.h b/xfa/fxfa/parser/cxfa_paradata.h new file mode 100644 index 0000000000..3e0afb36e5 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_paradata.h @@ -0,0 +1,29 @@ +// 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_PARADATA_H_ +#define XFA_FXFA_PARSER_CXFA_PARADATA_H_ + +#include "core/fxcrt/fx_system.h" +#include "xfa/fxfa/parser/cxfa_data.h" + +class CXFA_Node; + +class CXFA_ParaData : public CXFA_Data { + public: + explicit CXFA_ParaData(CXFA_Node* pNode); + + int32_t GetHorizontalAlign(); + int32_t GetVerticalAlign(); + float GetLineHeight(); + float GetMarginLeft(); + float GetMarginRight(); + float GetSpaceAbove(); + float GetSpaceBelow(); + float GetTextIndent(); +}; + +#endif // XFA_FXFA_PARSER_CXFA_PARADATA_H_ diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 5edbc7fad4..841fbd065a 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -299,8 +299,9 @@ CXFA_MarginData CXFA_WidgetData::GetMarginData() { m_pNode->JSNode()->GetProperty(0, XFA_Element::Margin, false)); } -CXFA_Para CXFA_WidgetData::GetPara() { - return CXFA_Para(m_pNode->JSNode()->GetProperty(0, XFA_Element::Para, false)); +CXFA_ParaData CXFA_WidgetData::GetParaData() { + return CXFA_ParaData( + m_pNode->JSNode()->GetProperty(0, XFA_Element::Para, false)); } std::vector CXFA_WidgetData::GetEventList() { diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h index 3df30dc5f1..d076b9b01e 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.h +++ b/xfa/fxfa/parser/cxfa_widgetdata.h @@ -20,7 +20,7 @@ #include "xfa/fxfa/parser/cxfa_data.h" #include "xfa/fxfa/parser/cxfa_fontdata.h" #include "xfa/fxfa/parser/cxfa_margindata.h" -#include "xfa/fxfa/parser/cxfa_para.h" +#include "xfa/fxfa/parser/cxfa_paradata.h" #include "xfa/fxfa/parser/cxfa_validate.h" enum XFA_CHECKSTATE { @@ -54,7 +54,7 @@ class CXFA_WidgetData : public CXFA_Data { CXFA_CaptionData GetCaptionData(); CXFA_FontData GetFontData(bool bModified); CXFA_MarginData GetMarginData(); - CXFA_Para GetPara(); + CXFA_ParaData GetParaData(); std::vector GetEventList(); std::vector GetEventByActivity(int32_t iActivity, bool bIsFormReady); -- cgit v1.2.3