summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-14 20:22:40 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-14 20:22:40 +0000
commitb924003d35048babcf86d6b8cc0aef9e3ad33173 (patch)
tree49e4e0a246c574772fc7658ea1b3433aafa21c4f /core/fpdfapi/parser
parent8c068b396dedc7d29ba7c107f03b2663520c11f1 (diff)
downloadpdfium-b924003d35048babcf86d6b8cc0aef9e3ad33173.tar.xz
Remove unreachable vertical text code in CPDF_Document.
Change-Id: I64b34da202a0f1c30a38cba2f24490aad4063828 Reviewed-on: https://pdfium-review.googlesource.com/40150 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_document.cpp15
-rw-r--r--core/fpdfapi/parser/cpdf_document.h3
2 files changed, 8 insertions, 10 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index a8d1f56b4e..cda6bd5582 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -663,7 +663,6 @@ size_t CPDF_Document::CalculateEncodingDict(int charset,
CPDF_Dictionary* CPDF_Document::ProcessbCJK(
CPDF_Dictionary* pBaseDict,
int charset,
- bool bVert,
ByteString basefont,
std::function<void(wchar_t, wchar_t, CPDF_Array*)> Insert) {
CPDF_Dictionary* pFontDict = NewIndirect<CPDF_Dictionary>();
@@ -673,14 +672,14 @@ CPDF_Dictionary* CPDF_Document::ProcessbCJK(
CPDF_Array* pWidthArray = pFontDict->SetNewFor<CPDF_Array>("W");
switch (charset) {
case FX_CHARSET_ChineseTraditional:
- cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
+ cmap = "ETenms-B5-H";
ordering = "CNS1";
supplement = 4;
pWidthArray->AddNew<CPDF_Number>(1);
Insert(0x20, 0x7e, pWidthArray);
break;
case FX_CHARSET_ChineseSimplified:
- cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
+ cmap = "GBK-EUC-H";
ordering = "GB1";
supplement = 2;
pWidthArray->AddNew<CPDF_Number>(7716);
@@ -689,14 +688,14 @@ CPDF_Dictionary* CPDF_Document::ProcessbCJK(
Insert(0x21, 0x7e, pWidthArray);
break;
case FX_CHARSET_Hangul:
- cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
+ cmap = "KSCms-UHC-H";
ordering = "Korea1";
supplement = 2;
pWidthArray->AddNew<CPDF_Number>(1);
Insert(0x20, 0x7e, pWidthArray);
break;
case FX_CHARSET_ShiftJIS:
- cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
+ cmap = "90ms-RKSJ-H";
ordering = "Japan1";
supplement = 5;
pWidthArray->AddNew<CPDF_Number>(231);
@@ -727,7 +726,7 @@ CPDF_Dictionary* CPDF_Document::ProcessbCJK(
return pFontDict;
}
-CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, bool bVert) {
+CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset) {
if (!pFont)
return nullptr;
@@ -772,7 +771,7 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, bool bVert) {
std::move(pWidths));
} else {
pFontDict = ProcessbCJK(
- pBaseDict, charset, bVert, basefont,
+ pBaseDict, charset, basefont,
[pFont, &pEncoding](wchar_t start, wchar_t end, CPDF_Array* widthArr) {
InsertWidthArray1(pFont, pEncoding.get(), start, end, widthArr);
});
@@ -868,7 +867,7 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont) {
pLogFont->lfItalic != 0, basefont, std::move(pWidths));
} else {
pFontDict =
- ProcessbCJK(pBaseDict, pLogFont->lfCharSet, false, basefont,
+ ProcessbCJK(pBaseDict, pLogFont->lfCharSet, basefont,
[&hDC](wchar_t start, wchar_t end, CPDF_Array* widthArr) {
InsertWidthArray(hDC, start, end, widthArr);
});
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index d42539fa7f..0c6ec79c72 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -118,7 +118,7 @@ class CPDF_Document : public Observable<CPDF_Document>,
uint32_t GetParsedPageCountForTesting() { return m_ParsedPageCount; }
CPDF_Font* AddStandardFont(const char* font, CPDF_FontEncoding* pEncoding);
- CPDF_Font* AddFont(CFX_Font* pFont, int charset, bool bVert);
+ CPDF_Font* AddFont(CFX_Font* pFont, int charset);
#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont);
@@ -142,7 +142,6 @@ class CPDF_Document : public Observable<CPDF_Document>,
CPDF_Dictionary* ProcessbCJK(
CPDF_Dictionary* pBaseDict,
int charset,
- bool bVert,
ByteString basefont,
std::function<void(wchar_t, wchar_t, CPDF_Array*)> Insert);
bool InsertDeletePDFPage(CPDF_Dictionary* pPages,