| 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 "xfa/src/fee/fde_txtedtbuf.h" | 7 #include "xfa/fee/fde_txtedtbuf.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "xfa/src/fee/ifde_txtedtbuf.h" | 11 #include "xfa/fee/ifde_txtedtbuf.h" |
| 12 #include "xfa/src/fee/ifde_txtedtengine.h" | 12 #include "xfa/fee/ifde_txtedtengine.h" |
| 13 | 13 |
| 14 #define FDE_DEFCHUNKCOUNT 2 | 14 #define FDE_DEFCHUNKCOUNT 2 |
| 15 #define FDE_TXTEDT_FORMATBLOCK_BGN 0xFFF9 | 15 #define FDE_TXTEDT_FORMATBLOCK_BGN 0xFFF9 |
| 16 #define FDE_TXTEDT_FORMATBLOCK_END 0xFFFB | 16 #define FDE_TXTEDT_FORMATBLOCK_END 0xFFFB |
| 17 #define FDE_TXTEDT_ZEROWIDTHSPACE 0x200B | 17 #define FDE_TXTEDT_ZEROWIDTHSPACE 0x200B |
| 18 | 18 |
| 19 CFDE_TxtEdtBufIter::CFDE_TxtEdtBufIter(CFDE_TxtEdtBuf* pBuf, FX_WCHAR wcAlias) | 19 CFDE_TxtEdtBufIter::CFDE_TxtEdtBufIter(CFDE_TxtEdtBuf* pBuf, FX_WCHAR wcAlias) |
| 20 : m_pBuf(pBuf), | 20 : m_pBuf(pBuf), |
| 21 m_nCurChunk(0), | 21 m_nCurChunk(0), |
| 22 m_nCurIndex(0), | 22 m_nCurIndex(0), |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 int32_t nCount = m_Chunks.GetSize(); | 394 int32_t nCount = m_Chunks.GetSize(); |
| 395 for (; i < nCount; i++) { | 395 for (; i < nCount; i++) { |
| 396 nTotal += ((FDE_LPCHUNKHEADER)m_Chunks[i])->nUsed; | 396 nTotal += ((FDE_LPCHUNKHEADER)m_Chunks[i])->nUsed; |
| 397 if (nTotal > nIndex) { | 397 if (nTotal > nIndex) { |
| 398 break; | 398 break; |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 cp.nChunkIndex = i; | 401 cp.nChunkIndex = i; |
| 402 cp.nCharIndex = ((FDE_LPCHUNKHEADER)m_Chunks[i])->nUsed - (nTotal - nIndex); | 402 cp.nCharIndex = ((FDE_LPCHUNKHEADER)m_Chunks[i])->nUsed - (nTotal - nIndex); |
| 403 } | 403 } |
| OLD | NEW |