Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp

Issue 1636873004: XFA: Fix DOS newlines (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: All of them Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/src/fxfa/src/app/xfa_ffConfigAcc.h ('k') | xfa/src/fxfa/src/app/xfa_ffapp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp
diff --git a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp
index e5b7e8789bbcb943b0db50b496e3f887e0a5dc4b..b88c05973ef370b85142e898b1b3f420b07a9c4c 100644
--- a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp
@@ -1,61 +1,61 @@
-// Copyright 2014 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/src/foxitlib.h"
-#include "xfa/src/fxfa/src/common/xfa_common.h"
-#include "xfa_ffConfigAcc.h"
-CXFA_FFConfigAcc::CXFA_FFConfigAcc(CXFA_Node* pNode)
- : m_pNode(pNode), m_pPsMapNode(NULL) {}
-CXFA_FFConfigAcc::~CXFA_FFConfigAcc() {}
-int32_t CXFA_FFConfigAcc::CountChildren() {
- GetPsMapNode();
- if (m_pPsMapNode == NULL) {
- return 0;
- }
- int32_t iCount = 0;
- CXFA_Node* pNode = m_pPsMapNode->GetNodeItem(XFA_NODEITEM_FirstChild);
- for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
- iCount++;
- }
- return iCount;
-}
-FX_BOOL CXFA_FFConfigAcc::GetFontInfo(int32_t index,
- CFX_WideString& wsFontFamily,
- CFX_WideString& wsPsName,
- FX_BOOL bBold,
- FX_BOOL bItalic) {
- if (index < 0 || index >= CountChildren()) {
- return FALSE;
- }
- CXFA_Node* pFontNode = m_pPsMapNode->GetChild(index, XFA_ELEMENT_Font);
- if (pFontNode == NULL) {
- return FALSE;
- }
- wsFontFamily.Empty();
- wsPsName.Empty();
- bBold = FALSE;
- bItalic = FALSE;
- pFontNode->GetAttribute(XFA_ATTRIBUTE_Typeface, wsFontFamily);
- pFontNode->GetAttribute(XFA_ATTRIBUTE_PsName, wsPsName);
- CFX_WideString wsValue;
- pFontNode->GetAttribute(XFA_ATTRIBUTE_Weight, wsValue);
- wsValue.MakeLower();
- if (wsValue == FX_WSTRC(L"bold")) {
- bBold = TRUE;
- }
- pFontNode->GetAttribute(XFA_ATTRIBUTE_Posture, wsValue);
- wsValue.MakeLower();
- if (wsValue == FX_WSTRC(L"italic")) {
- bItalic = TRUE;
- }
- return wsFontFamily.GetLength() > 0;
-}
-void CXFA_FFConfigAcc::GetPsMapNode() {
- if (m_pNode == NULL) {
- return;
- }
- m_pPsMapNode = m_pNode->GetChild(0, XFA_ELEMENT_PsMap);
-}
+// Copyright 2014 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/src/foxitlib.h"
+#include "xfa/src/fxfa/src/common/xfa_common.h"
+#include "xfa_ffConfigAcc.h"
+CXFA_FFConfigAcc::CXFA_FFConfigAcc(CXFA_Node* pNode)
+ : m_pNode(pNode), m_pPsMapNode(NULL) {}
+CXFA_FFConfigAcc::~CXFA_FFConfigAcc() {}
+int32_t CXFA_FFConfigAcc::CountChildren() {
+ GetPsMapNode();
+ if (m_pPsMapNode == NULL) {
+ return 0;
+ }
+ int32_t iCount = 0;
+ CXFA_Node* pNode = m_pPsMapNode->GetNodeItem(XFA_NODEITEM_FirstChild);
+ for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
+ iCount++;
+ }
+ return iCount;
+}
+FX_BOOL CXFA_FFConfigAcc::GetFontInfo(int32_t index,
+ CFX_WideString& wsFontFamily,
+ CFX_WideString& wsPsName,
+ FX_BOOL bBold,
+ FX_BOOL bItalic) {
+ if (index < 0 || index >= CountChildren()) {
+ return FALSE;
+ }
+ CXFA_Node* pFontNode = m_pPsMapNode->GetChild(index, XFA_ELEMENT_Font);
+ if (pFontNode == NULL) {
+ return FALSE;
+ }
+ wsFontFamily.Empty();
+ wsPsName.Empty();
+ bBold = FALSE;
+ bItalic = FALSE;
+ pFontNode->GetAttribute(XFA_ATTRIBUTE_Typeface, wsFontFamily);
+ pFontNode->GetAttribute(XFA_ATTRIBUTE_PsName, wsPsName);
+ CFX_WideString wsValue;
+ pFontNode->GetAttribute(XFA_ATTRIBUTE_Weight, wsValue);
+ wsValue.MakeLower();
+ if (wsValue == FX_WSTRC(L"bold")) {
+ bBold = TRUE;
+ }
+ pFontNode->GetAttribute(XFA_ATTRIBUTE_Posture, wsValue);
+ wsValue.MakeLower();
+ if (wsValue == FX_WSTRC(L"italic")) {
+ bItalic = TRUE;
+ }
+ return wsFontFamily.GetLength() > 0;
+}
+void CXFA_FFConfigAcc::GetPsMapNode() {
+ if (m_pNode == NULL) {
+ return;
+ }
+ m_pPsMapNode = m_pNode->GetChild(0, XFA_ELEMENT_PsMap);
+}
« no previous file with comments | « xfa/src/fxfa/src/app/xfa_ffConfigAcc.h ('k') | xfa/src/fxfa/src/app/xfa_ffapp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698