Split fx_ucd.h into fx_unicode.h and fx_ucddata.h.
File naming now matches.
Fix one usage not going through the accessor function.
Change-Id: I5cc4986238764964f2a71807a94bd2facf517263
Reviewed-on: https://pdfium-review.googlesource.com/12930
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index c7b86ea..ddb0d5e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -850,9 +850,10 @@
"core/fxcrt/fx_string.h",
"core/fxcrt/fx_system.cpp",
"core/fxcrt/fx_system.h",
- "core/fxcrt/fx_ucd.h",
"core/fxcrt/fx_ucddata.cpp",
+ "core/fxcrt/fx_ucddata.h",
"core/fxcrt/fx_unicode.cpp",
+ "core/fxcrt/fx_unicode.h",
"core/fxcrt/ifx_fileaccess.h",
"core/fxcrt/ifx_pauseindicator.h",
"core/fxcrt/xml/cxml_attritem.cpp",
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index ffc3729..3006ebc 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -21,7 +21,7 @@
#include "core/fpdftext/unicodenormalizationdata.h"
#include "core/fxcrt/fx_bidi.h"
#include "core/fxcrt/fx_extension.h"
-#include "core/fxcrt/fx_ucd.h"
+#include "core/fxcrt/fx_unicode.h"
#include "third_party/base/stl_util.h"
namespace {
diff --git a/core/fxcrt/cfx_char.h b/core/fxcrt/cfx_char.h
index 009e87b..74f0a4f 100644
--- a/core/fxcrt/cfx_char.h
+++ b/core/fxcrt/cfx_char.h
@@ -9,7 +9,7 @@
#include <stdint.h>
-#include "core/fxcrt/fx_ucd.h"
+#include "core/fxcrt/fx_unicode.h"
enum class CFX_BreakType { None = 0, Piece, Line, Paragraph, Page };
diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp
index d9804ba..0d6f039 100644
--- a/core/fxcrt/fx_arabic.cpp
+++ b/core/fxcrt/fx_arabic.cpp
@@ -10,7 +10,7 @@
#include <vector>
#include "core/fxcrt/fx_memory.h"
-#include "core/fxcrt/fx_ucd.h"
+#include "core/fxcrt/fx_unicode.h"
#include "third_party/base/stl_util.h"
namespace {
diff --git a/core/fxcrt/fx_bidi.cpp b/core/fxcrt/fx_bidi.cpp
index 5b5b198..b7c7cac 100644
--- a/core/fxcrt/fx_bidi.cpp
+++ b/core/fxcrt/fx_bidi.cpp
@@ -8,7 +8,7 @@
#include <algorithm>
-#include "core/fxcrt/fx_ucd.h"
+#include "core/fxcrt/fx_unicode.h"
#include "third_party/base/ptr_util.h"
#ifdef PDF_ENABLE_XFA
diff --git a/core/fxcrt/fx_ucddata.cpp b/core/fxcrt/fx_ucddata.cpp
index 1f28bfb..527eacf 100644
--- a/core/fxcrt/fx_ucddata.cpp
+++ b/core/fxcrt/fx_ucddata.cpp
@@ -4,8 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "core/fxcrt/fx_ucddata.h"
+
#include "core/fxcrt/fx_memory.h"
-#include "core/fxcrt/fx_ucd.h"
const uint32_t kTextLayoutCodeProperties[] = {
0xfffe9a93, 0xfffe9a93, 0xfffe9a93, 0xfffe9a93, 0xfffe9a93, 0xfffe9a93,
diff --git a/core/fxcrt/fx_ucddata.h b/core/fxcrt/fx_ucddata.h
new file mode 100644
index 0000000..78a6b97
--- /dev/null
+++ b/core/fxcrt/fx_ucddata.h
@@ -0,0 +1,18 @@
+// 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
+
+#ifndef CORE_FXCRT_FX_UCDDATA_H_
+#define CORE_FXCRT_FX_UCDDATA_H_
+
+#include "core/fxcrt/fx_system.h"
+
+extern const uint32_t kTextLayoutCodeProperties[];
+extern const size_t kTextLayoutCodePropertiesSize;
+
+extern const uint16_t kFXTextLayoutBidiMirror[];
+extern const size_t kFXTextLayoutBidiMirrorSize;
+
+#endif // CORE_FXCRT_FX_UCDDATA_H_
diff --git a/core/fxcrt/fx_unicode.cpp b/core/fxcrt/fx_unicode.cpp
index f232004..aafdba1 100644
--- a/core/fxcrt/fx_unicode.cpp
+++ b/core/fxcrt/fx_unicode.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "core/fxcrt/fx_ucd.h"
+#include "core/fxcrt/fx_unicode.h"
+
+#include "core/fxcrt/fx_ucddata.h"
namespace {
diff --git a/core/fxcrt/fx_ucd.h b/core/fxcrt/fx_unicode.h
similarity index 83%
rename from core/fxcrt/fx_ucd.h
rename to core/fxcrt/fx_unicode.h
index bca830f..a4a237a 100644
--- a/core/fxcrt/fx_ucd.h
+++ b/core/fxcrt/fx_unicode.h
@@ -4,17 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef CORE_FXCRT_FX_UCD_H_
-#define CORE_FXCRT_FX_UCD_H_
+#ifndef CORE_FXCRT_FX_UNICODE_H_
+#define CORE_FXCRT_FX_UNICODE_H_
#include "core/fxcrt/cfx_retain_ptr.h"
-extern const uint32_t kTextLayoutCodeProperties[];
-extern const size_t kTextLayoutCodePropertiesSize;
-
-extern const uint16_t kFXTextLayoutBidiMirror[];
-extern const size_t kFXTextLayoutBidiMirrorSize;
-
uint32_t FX_GetUnicodeProperties(wchar_t wch);
wchar_t FX_GetMirrorChar(wchar_t wch);
@@ -51,4 +45,4 @@
#endif // PDF_ENABLE_XFA
-#endif // CORE_FXCRT_FX_UCD_H_
+#endif // CORE_FXCRT_FX_UNICODE_H_
diff --git a/xfa/fgas/layout/cfx_linebreak.cpp b/xfa/fgas/layout/cfx_linebreak.cpp
index 9531bc5..1435248 100644
--- a/xfa/fgas/layout/cfx_linebreak.cpp
+++ b/xfa/fgas/layout/cfx_linebreak.cpp
@@ -6,7 +6,7 @@
#include "xfa/fgas/layout/cfx_linebreak.h"
-#include "core/fxcrt/fx_ucd.h"
+#include "core/fxcrt/fx_unicode.h"
const FX_LINEBREAKTYPE gs_FX_LineBreak_PairTable[64][32] = {
{FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB,
diff --git a/xfa/fgas/layout/cfx_rtfbreak.h b/xfa/fgas/layout/cfx_rtfbreak.h
index 5151f4f..699815a 100644
--- a/xfa/fgas/layout/cfx_rtfbreak.h
+++ b/xfa/fgas/layout/cfx_rtfbreak.h
@@ -12,7 +12,7 @@
#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/fx_coordinates.h"
-#include "core/fxcrt/fx_ucd.h"
+#include "core/fxcrt/fx_unicode.h"
#include "core/fxge/cfx_renderdevice.h"
#include "xfa/fgas/layout/cfx_break.h"
#include "xfa/fxfa/cxfa_textuserdata.h"
diff --git a/xfa/fgas/layout/cfx_txtbreak.cpp b/xfa/fgas/layout/cfx_txtbreak.cpp
index 2ea64d2..c30b4a1 100644
--- a/xfa/fgas/layout/cfx_txtbreak.cpp
+++ b/xfa/fgas/layout/cfx_txtbreak.cpp
@@ -202,7 +202,7 @@
}
CFX_BreakType CFX_TxtBreak::AppendChar(wchar_t wch) {
- uint32_t dwProps = kTextLayoutCodeProperties[static_cast<uint16_t>(wch)];
+ uint32_t dwProps = FX_GetUnicodeProperties(wch);
FX_CHARTYPE chartype = GetCharTypeFromProp(dwProps);
m_pCurLine->m_LineChars.emplace_back(wch, dwProps, m_iHorizontalScale,
m_iVerticalScale);