From 56ef173042d786281edcbbc9f1c38c8f97ef10d5 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Thu, 11 Sep 2014 14:26:42 -0700 Subject: Fix hebrew character highlight issue in a special document There is an image object and text objects in this document, but the character in each text object is reversed. When rendering, the image object is shown. However, when highlighting, the text object is selected, resulting in text index issue. Moreover, the character in the document is in reading order, which is different from normal document. BUG=pdfium:43 R=jbreiden@google.com Review URL: https://codereview.chromium.org/484503002 --- core/src/fpdftext/fpdf_text.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/src/fpdftext/fpdf_text.cpp') diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp index defad925b9..f633e19517 100644 --- a/core/src/fpdftext/fpdf_text.cpp +++ b/core/src/fpdftext/fpdf_text.cpp @@ -184,7 +184,12 @@ CTextBaseLine* CTextPage::InsertTextBox(CTextBaseLine* pBaseLine, FX_FLOAT basey while (offset < len) { FX_DWORD ch = pFont->GetNextChar(pStr, offset); CFX_WideString unicode_str = pFont->UnicodeFromCharCode(ch); - text += unicode_str; + if (unicode_str.IsEmpty()) { + text += (FX_WCHAR)ch; + } + else { + text += unicode_str; + } } pBaseLine->InsertTextBox(leftx, rightx, topy, bottomy, spacew, fontsize_v, text); return pBaseLine; -- cgit v1.2.3