diff options
author | Lei Zhang <thestig@chromium.org> | 2018-08-14 20:22:40 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-14 20:22:40 +0000 |
commit | b924003d35048babcf86d6b8cc0aef9e3ad33173 (patch) | |
tree | 49e4e0a246c574772fc7658ea1b3433aafa21c4f | |
parent | 8c068b396dedc7d29ba7c107f03b2663520c11f1 (diff) | |
download | pdfium-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>
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.cpp | 15 | ||||
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.h | 3 | ||||
-rw-r--r-- | 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<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, 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<CFX_Font>(); 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, |