From b924003d35048babcf86d6b8cc0aef9e3ad33173 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 14 Aug 2018 20:22:40 +0000 Subject: Remove unreachable vertical text code in CPDF_Document. Change-Id: I64b34da202a0f1c30a38cba2f24490aad4063828 Reviewed-on: https://pdfium-review.googlesource.com/40150 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- core/fpdfapi/parser/cpdf_document.cpp | 15 +++++++-------- core/fpdfapi/parser/cpdf_document.h | 3 +-- fpdfsdk/cfx_systemhandler.cpp | 2 +- 3 files changed, 9 insertions(+), 11 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 Insert) { CPDF_Dictionary* pFontDict = NewIndirect(); @@ -673,14 +672,14 @@ CPDF_Dictionary* CPDF_Document::ProcessbCJK( CPDF_Array* pWidthArray = pFontDict->SetNewFor("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(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(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(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(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, 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_Dictionary* ProcessbCJK( CPDF_Dictionary* pBaseDict, int charset, - bool bVert, ByteString basefont, std::function Insert); bool InsertDeletePDFPage(CPDF_Dictionary* pPages, diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp index 99aff8c6f8..e33e433531 100644 --- a/fpdfsdk/cfx_systemhandler.cpp +++ b/fpdfsdk/cfx_systemhandler.cpp @@ -106,7 +106,7 @@ CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( auto pFXFont = pdfium::MakeUnique(); pFXFont->LoadSubst(sFontFaceName, true, 0, 0, 0, FX_GetCodePageFromCharset(nCharset), false); - return pDoc->AddFont(pFXFont.get(), nCharset, false); + return pDoc->AddFont(pFXFont.get(), nCharset); } int32_t CFX_SystemHandler::SetTimer(int32_t uElapse, -- cgit v1.2.3