| OLD | NEW |
| 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_pageobj.h" | 7 #include "../../include/fpdfapi/fpdf_pageobj.h" |
| 8 #include "../../include/fpdftext/fpdf_text.h" | 8 #include "../../include/fpdftext/fpdf_text.h" |
| 9 #include "../../include/fpdfapi/fpdf_page.h" | 9 #include "../../include/fpdfapi/fpdf_page.h" |
| 10 class CPDF_TextStream | 10 class CPDF_TextStream |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 if (item.m_CharCode == (FX_DWORD) - 1) { | 259 if (item.m_CharCode == (FX_DWORD) - 1) { |
| 260 continue; | 260 continue; |
| 261 } | 261 } |
| 262 spacing = 0; | 262 spacing = 0; |
| 263 } | 263 } |
| 264 CFX_WideString unicode_str = pFont->UnicodeFromCharCode(item.m_CharCode)
; | 264 CFX_WideString unicode_str = pFont->UnicodeFromCharCode(item.m_CharCode)
; |
| 265 if (unicode_str.IsEmpty()) { | 265 if (unicode_str.IsEmpty()) { |
| 266 m_Buffer.AppendChar((FX_WCHAR)item.m_CharCode); | 266 m_Buffer.AppendChar((FX_WCHAR)item.m_CharCode); |
| 267 if (m_pObjArray) { | 267 if (m_pObjArray) { |
| 268 m_pObjArray->Add((void*)pObj); | 268 m_pObjArray->Add((void*)pObj); |
| 269 m_pObjArray->Add((void*)(FX_INTPTR)item_index); | 269 m_pObjArray->Add((void*)(intptr_t)item_index); |
| 270 } | 270 } |
| 271 } else { | 271 } else { |
| 272 m_Buffer << unicode_str; | 272 m_Buffer << unicode_str; |
| 273 if (m_pObjArray) { | 273 if (m_pObjArray) { |
| 274 for (int i = 0; i < unicode_str.GetLength(); i ++) { | 274 for (int i = 0; i < unicode_str.GetLength(); i ++) { |
| 275 m_pObjArray->Add((void*)pObj); | 275 m_pObjArray->Add((void*)pObj); |
| 276 m_pObjArray->Add((void*)(FX_INTPTR)item_index); | 276 m_pObjArray->Add((void*)(intptr_t)item_index); |
| 277 } | 277 } |
| 278 } | 278 } |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 return FALSE; | 281 return FALSE; |
| 282 } | 282 } |
| 283 void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage
, FX_BOOL bUseLF, | 283 void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage
, FX_BOOL bUseLF, |
| 284 CFX_PtrArray* pObjArray) | 284 CFX_PtrArray* pObjArray) |
| 285 { | 285 { |
| 286 CPDF_TextStream textstream(buffer, bUseLF, pObjArray); | 286 CPDF_TextStream textstream(buffer, bUseLF, pObjArray); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 312 CPDF_PageObject* pObject = page.GetNextObject(pos); | 312 CPDF_PageObject* pObject = page.GetNextObject(pos); |
| 313 if (pObject->m_Type != PDFPAGE_TEXT) { | 313 if (pObject->m_Type != PDFPAGE_TEXT) { |
| 314 continue; | 314 continue; |
| 315 } | 315 } |
| 316 if (textstream.ProcessObject((CPDF_TextObject*)pObject, TRUE)) { | 316 if (textstream.ProcessObject((CPDF_TextObject*)pObject, TRUE)) { |
| 317 break; | 317 break; |
| 318 } | 318 } |
| 319 } | 319 } |
| 320 return buffer.GetWideString(); | 320 return buffer.GetWideString(); |
| 321 } | 321 } |
| OLD | NEW |