Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2153)

Unified Diff: core/fpdftext/cpdf_textpage.cpp

Issue 2342073002: Respect ToUnicode map when it maps a charcode to unicode 0 (Closed)
Patch Set: Add test Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/fpdftext_embeddertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdftext/cpdf_textpage.cpp
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index c691d4b3a0706370c50a45bcd5897f711e1c7f90..105694329221539426e00d15e1be6c98e48f9f0c 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -1131,12 +1131,8 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) {
spacing = 0;
CFX_WideString wstrItem = pFont->UnicodeFromCharCode(item.m_CharCode);
bool bNoUnicode = false;
- FX_WCHAR wChar = wstrItem.GetAt(0);
- if ((wstrItem.IsEmpty() || wChar == 0) && item.m_CharCode) {
- if (wstrItem.IsEmpty())
- wstrItem += (FX_WCHAR)item.m_CharCode;
- else
- wstrItem.SetAt(0, (FX_WCHAR)item.m_CharCode);
+ if (wstrItem.IsEmpty() && item.m_CharCode) {
+ wstrItem += static_cast<FX_WCHAR>(item.m_CharCode);
bNoUnicode = true;
}
charinfo.m_Index = -1;
« no previous file with comments | « no previous file | fpdfsdk/fpdftext_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698