summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-09-15 04:31:10 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-15 04:31:10 +0000
commit649bc02a2e2ab886733d7461ece89b4153a01d5f (patch)
treed9c5afedf1dc7267cc1d52bf3b53c32e25b424a1
parent0a815ae46f53330b69c585c708a4ebc5b85ecdb4 (diff)
downloadpdfium-649bc02a2e2ab886733d7461ece89b4153a01d5f.tar.xz
Remove FXFM_ENCODING_NONE.
FX_CreateFontEncodingEx() always passes FXFM_ENCODING_NONE. Just get rid of it instead. Change-Id: I417f84d8ae2f10ba874265a92576d3ef8481a9d6 Reviewed-on: https://pdfium-review.googlesource.com/42460 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
-rw-r--r--core/fxge/cfx_unicodeencoding.h1
-rw-r--r--core/fxge/cfx_unicodeencodingex.cpp6
-rw-r--r--core/fxge/cfx_unicodeencodingex.h4
-rw-r--r--fxbarcode/oned/BC_OneDimWriter.cpp2
-rw-r--r--xfa/fgas/font/cfgas_gefont.cpp2
5 files changed, 4 insertions, 11 deletions
diff --git a/core/fxge/cfx_unicodeencoding.h b/core/fxge/cfx_unicodeencoding.h
index 57848c1267..338bfba413 100644
--- a/core/fxge/cfx_unicodeencoding.h
+++ b/core/fxge/cfx_unicodeencoding.h
@@ -15,7 +15,6 @@
#define FXFM_ENC_TAG(a, b, c, d) \
(((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(c) << 8) | \
(uint32_t)(d))
-#define FXFM_ENCODING_NONE FXFM_ENC_TAG(0, 0, 0, 0)
#define FXFM_ENCODING_MS_SYMBOL FXFM_ENC_TAG('s', 'y', 'm', 'b')
#define FXFM_ENCODING_UNICODE FXFM_ENC_TAG('u', 'n', 'i', 'c')
#define FXFM_ENCODING_MS_SJIS FXFM_ENC_TAG('s', 'j', 'i', 's')
diff --git a/core/fxge/cfx_unicodeencodingex.cpp b/core/fxge/cfx_unicodeencodingex.cpp
index a8db745612..2f5eaf7aa8 100644
--- a/core/fxge/cfx_unicodeencodingex.cpp
+++ b/core/fxge/cfx_unicodeencodingex.cpp
@@ -85,14 +85,10 @@ uint32_t CFX_UnicodeEncodingEx::CharCodeFromUnicode(wchar_t Unicode) const {
}
std::unique_ptr<CFX_UnicodeEncodingEx> FX_CreateFontEncodingEx(
- CFX_Font* pFont,
- uint32_t nEncodingID) {
+ CFX_Font* pFont) {
if (!pFont || !pFont->GetFace())
return nullptr;
- if (nEncodingID != FXFM_ENCODING_NONE)
- return FXFM_CreateFontEncoding(pFont, nEncodingID);
-
for (uint32_t id : g_EncodingID) {
auto pFontEncoding = FXFM_CreateFontEncoding(pFont, id);
if (pFontEncoding)
diff --git a/core/fxge/cfx_unicodeencodingex.h b/core/fxge/cfx_unicodeencodingex.h
index d9d349a88b..9511d2ba7a 100644
--- a/core/fxge/cfx_unicodeencodingex.h
+++ b/core/fxge/cfx_unicodeencodingex.h
@@ -29,8 +29,6 @@ class CFX_UnicodeEncodingEx final : public CFX_UnicodeEncoding {
uint32_t m_nEncodingID;
};
-std::unique_ptr<CFX_UnicodeEncodingEx> FX_CreateFontEncodingEx(
- CFX_Font* pFont,
- uint32_t nEncodingID);
+std::unique_ptr<CFX_UnicodeEncodingEx> FX_CreateFontEncodingEx(CFX_Font* pFont);
#endif // CORE_FXGE_CFX_UNICODEENCODINGEX_H_
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp
index c76817d138..9ad053db28 100644
--- a/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -123,7 +123,7 @@ void CBC_OneDimWriter::CalcTextInfo(const ByteString& text,
int32_t fontSize,
float& charsLen) {
std::unique_ptr<CFX_UnicodeEncodingEx> encoding =
- FX_CreateFontEncodingEx(cFont, FXFM_ENCODING_NONE);
+ FX_CreateFontEncodingEx(cFont);
size_t length = text.GetLength();
uint32_t* pCharCode = FX_Alloc(uint32_t, text.GetLength());
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index 45119b7a98..4d5fb9fb59 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -106,7 +106,7 @@ bool CFGAS_GEFont::InitFont() {
if (m_pFontEncoding)
return true;
- m_pFontEncoding = FX_CreateFontEncodingEx(m_pFont.Get(), FXFM_ENCODING_NONE);
+ m_pFontEncoding = FX_CreateFontEncodingEx(m_pFont.Get());
return !!m_pFontEncoding;
}