summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_char.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-13 15:32:07 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 14:13:24 +0000
commit893822aa5b6254591f8e80fbffcbb4fa6ad849aa (patch)
tree74e20ab6378d515c12a1ec9b9fc70d8e309b361b /core/fxcrt/cfx_char.cpp
parent80e370c7d8b6541f59d98b6cbfbaae51f7e139da (diff)
downloadpdfium-893822aa5b6254591f8e80fbffcbb4fa6ad849aa.tar.xz
Merge text breaking helper classes.
This Cl merges the CFX_TxtPiece and CFX_RTFPiece classes into CFX_BreakPiece. CFX_TxtLine and CFX_RTFLine into CFX_BreakLine and CFX_TxtChar and CFX_RTFChar into CFX_Char. Change-Id: I95421bdf4cafd5e394db9238dea3603ccb8349c3 Reviewed-on: https://pdfium-review.googlesource.com/2966 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_char.cpp')
-rw-r--r--core/fxcrt/cfx_char.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_char.cpp b/core/fxcrt/cfx_char.cpp
new file mode 100644
index 0000000000..ab7abd9884
--- /dev/null
+++ b/core/fxcrt/cfx_char.cpp
@@ -0,0 +1,50 @@
+// Copyright 2017 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 "core/fxcrt/cfx_char.h"
+
+CFX_Char::CFX_Char()
+ : m_dwStatus(CFX_BreakType::None),
+ m_nBreakType(0),
+ m_dwCharStyles(0),
+ m_dwCharProps(0),
+ m_iCharWidth(0),
+ m_iHorizontalScale(100),
+ m_iVerticalScale(100),
+ m_iBidiClass(0),
+ m_iBidiLevel(0),
+ m_iBidiPos(0),
+ m_iBidiOrder(0),
+ m_wCharCode(0),
+ m_iFontSize(0),
+ m_iFontHeight(0),
+ m_dwIdentity(0),
+ m_pUserData(nullptr) {}
+
+CFX_Char::CFX_Char(uint16_t wCharCode, uint32_t dwCharProps)
+ : m_nBreakType(0),
+ m_dwCharStyles(0),
+ m_dwCharProps(dwCharProps),
+ m_iCharWidth(0),
+ m_iHorizontalScale(100),
+ m_iVerticalScale(100),
+ m_iBidiClass(0),
+ m_iBidiLevel(0),
+ m_iBidiPos(0),
+ m_iBidiOrder(0),
+ m_wCharCode(wCharCode),
+ m_iFontSize(0),
+ m_iFontHeight(0),
+ m_dwIdentity(0),
+ m_pUserData(nullptr) {}
+
+CFX_Char::CFX_Char(const CFX_Char& other) = default;
+
+CFX_Char::~CFX_Char() = default;
+
+FX_CHARTYPE CFX_Char::GetCharType() const {
+ return GetCharTypeFromProp(m_dwCharProps);
+}