summaryrefslogtreecommitdiff
path: root/core/src/fpdftext/fpdf_text.cpp
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-09-11 14:26:42 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-09-11 14:26:42 -0700
commit56ef173042d786281edcbbc9f1c38c8f97ef10d5 (patch)
tree67dffa9b0fe1961ef5f041e149c1c6478f52112c /core/src/fpdftext/fpdf_text.cpp
parent12a9940905825e028bebc0bf8d3eddcc65b1933d (diff)
downloadpdfium-56ef173042d786281edcbbc9f1c38c8f97ef10d5.tar.xz
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
Diffstat (limited to 'core/src/fpdftext/fpdf_text.cpp')
-rw-r--r--core/src/fpdftext/fpdf_text.cpp7
1 files changed, 6 insertions, 1 deletions
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;