| 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 "fpdfsdk/javascript/Document.h" | 7 #include "fpdfsdk/javascript/Document.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 | 1458 |
| 1459 FX_BOOL bIsLatin = FALSE; | 1459 FX_BOOL bIsLatin = FALSE; |
| 1460 | 1460 |
| 1461 for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) { | 1461 for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) { |
| 1462 FX_DWORD charcode = static_cast<FX_DWORD>(-1); | 1462 FX_DWORD charcode = static_cast<FX_DWORD>(-1); |
| 1463 FX_FLOAT kerning; | 1463 FX_FLOAT kerning; |
| 1464 | 1464 |
| 1465 pTextObj->GetCharInfo(i, charcode, kerning); | 1465 pTextObj->GetCharInfo(i, charcode, kerning); |
| 1466 CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode); | 1466 CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode); |
| 1467 | 1467 |
| 1468 FX_WORD unicode = 0; | 1468 uint16_t unicode = 0; |
| 1469 if (swUnicode.GetLength() > 0) | 1469 if (swUnicode.GetLength() > 0) |
| 1470 unicode = swUnicode[0]; | 1470 unicode = swUnicode[0]; |
| 1471 | 1471 |
| 1472 if (ISLATINWORD(unicode) && bIsLatin) | 1472 if (ISLATINWORD(unicode) && bIsLatin) |
| 1473 continue; | 1473 continue; |
| 1474 | 1474 |
| 1475 bIsLatin = ISLATINWORD(unicode); | 1475 bIsLatin = ISLATINWORD(unicode); |
| 1476 if (unicode != 0x20) | 1476 if (unicode != 0x20) |
| 1477 nWords++; | 1477 nWords++; |
| 1478 } | 1478 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1491 int nWords = 0; | 1491 int nWords = 0; |
| 1492 FX_BOOL bIsLatin = FALSE; | 1492 FX_BOOL bIsLatin = FALSE; |
| 1493 | 1493 |
| 1494 for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) { | 1494 for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) { |
| 1495 FX_DWORD charcode = static_cast<FX_DWORD>(-1); | 1495 FX_DWORD charcode = static_cast<FX_DWORD>(-1); |
| 1496 FX_FLOAT kerning; | 1496 FX_FLOAT kerning; |
| 1497 | 1497 |
| 1498 pTextObj->GetCharInfo(i, charcode, kerning); | 1498 pTextObj->GetCharInfo(i, charcode, kerning); |
| 1499 CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode); | 1499 CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode); |
| 1500 | 1500 |
| 1501 FX_WORD unicode = 0; | 1501 uint16_t unicode = 0; |
| 1502 if (swUnicode.GetLength() > 0) | 1502 if (swUnicode.GetLength() > 0) |
| 1503 unicode = swUnicode[0]; | 1503 unicode = swUnicode[0]; |
| 1504 | 1504 |
| 1505 if (ISLATINWORD(unicode) && bIsLatin) { | 1505 if (ISLATINWORD(unicode) && bIsLatin) { |
| 1506 } else { | 1506 } else { |
| 1507 bIsLatin = ISLATINWORD(unicode); | 1507 bIsLatin = ISLATINWORD(unicode); |
| 1508 if (unicode != 0x20) | 1508 if (unicode != 0x20) |
| 1509 nWords++; | 1509 nWords++; |
| 1510 } | 1510 } |
| 1511 | 1511 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1595 } | 1595 } |
| 1596 } | 1596 } |
| 1597 | 1597 |
| 1598 for (const auto& pData : DelayDataForFieldAndControlIndex) | 1598 for (const auto& pData : DelayDataForFieldAndControlIndex) |
| 1599 Field::DoDelay(m_pDocument, pData.get()); | 1599 Field::DoDelay(m_pDocument, pData.get()); |
| 1600 } | 1600 } |
| 1601 | 1601 |
| 1602 CJS_Document* Document::GetCJSDoc() const { | 1602 CJS_Document* Document::GetCJSDoc() const { |
| 1603 return static_cast<CJS_Document*>(m_pJSObject); | 1603 return static_cast<CJS_Document*>(m_pJSObject); |
| 1604 } | 1604 } |
| OLD | NEW |