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

Side by Side Diff: core/src/fpdftext/fpdf_text.cpp

Issue 484503002: Fix hebrew character highlight issue in a special document (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | core/src/fpdftext/fpdf_text_int.cpp » ('j') | core/src/fpdftext/fpdf_text_int.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../include/fpdfapi/fpdf_page.h" 7 #include "../../include/fpdfapi/fpdf_page.h"
8 #include "../../include/fpdfapi/fpdf_pageobj.h" 8 #include "../../include/fpdfapi/fpdf_pageobj.h"
9 #include "../../include/fpdftext/fpdf_text.h" 9 #include "../../include/fpdftext/fpdf_text.h"
10 #include "txtproc.h" 10 #include "txtproc.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 pBaseLine->m_BaseLine = basey; 177 pBaseLine->m_BaseLine = basey;
178 m_BaseLines.InsertAt(i, pBaseLine); 178 m_BaseLines.InsertAt(i, pBaseLine);
179 } 179 }
180 } 180 }
181 CFX_WideString text; 181 CFX_WideString text;
182 FX_LPCSTR pStr = str; 182 FX_LPCSTR pStr = str;
183 int len = str.GetLength(), offset = 0; 183 int len = str.GetLength(), offset = 0;
184 while (offset < len) { 184 while (offset < len) {
185 FX_DWORD ch = pFont->GetNextChar(pStr, offset); 185 FX_DWORD ch = pFont->GetNextChar(pStr, offset);
186 CFX_WideString unicode_str = pFont->UnicodeFromCharCode(ch); 186 CFX_WideString unicode_str = pFont->UnicodeFromCharCode(ch);
187 text += unicode_str; 187 if (unicode_str.IsEmpty()) {
188 text += (FX_WCHAR)ch;
jbreiden 2014/08/18 19:10:49 The example PDF file for this bug contains a mappi
189 }
190 else {
191 text += unicode_str;
192 }
188 } 193 }
189 pBaseLine->InsertTextBox(leftx, rightx, topy, bottomy, spacew, fontsize_v, t ext); 194 pBaseLine->InsertTextBox(leftx, rightx, topy, bottomy, spacew, fontsize_v, t ext);
190 return pBaseLine; 195 return pBaseLine;
191 } 196 }
192 void CTextPage::WriteOutput(CFX_WideStringArray& lines, int iMinWidth) 197 void CTextPage::WriteOutput(CFX_WideStringArray& lines, int iMinWidth)
193 { 198 {
194 FX_FLOAT lastheight = -1; 199 FX_FLOAT lastheight = -1;
195 FX_FLOAT lastbaseline = -1; 200 FX_FLOAT lastbaseline = -1;
196 FX_FLOAT MinLeftX = 1000000; 201 FX_FLOAT MinLeftX = 1000000;
197 FX_FLOAT MaxRightX = 0; 202 FX_FLOAT MaxRightX = 0;
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 { 783 {
779 buffer.EstimateSize(0, 10240); 784 buffer.EstimateSize(0, 10240);
780 CPDF_Page page; 785 CPDF_Page page;
781 page.Load(pDoc, pPage); 786 page.Load(pDoc, pPage);
782 CPDF_ParseOptions options; 787 CPDF_ParseOptions options;
783 options.m_bTextOnly = TRUE; 788 options.m_bTextOnly = TRUE;
784 options.m_bSeparateForm = FALSE; 789 options.m_bSeparateForm = FALSE;
785 page.ParseContent(&options); 790 page.ParseContent(&options);
786 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); 791 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL);
787 } 792 }
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdftext/fpdf_text_int.cpp » ('j') | core/src/fpdftext/fpdf_text_int.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698