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 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 | 1453 |
1454 int nWords = 0; | 1454 int nWords = 0; |
1455 | 1455 |
1456 CPDF_Font* pFont = pTextObj->GetFont(); | 1456 CPDF_Font* pFont = pTextObj->GetFont(); |
1457 if (!pFont) | 1457 if (!pFont) |
1458 return 0; | 1458 return 0; |
1459 | 1459 |
1460 FX_BOOL bIsLatin = FALSE; | 1460 FX_BOOL bIsLatin = FALSE; |
1461 | 1461 |
1462 for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) { | 1462 for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) { |
1463 FX_DWORD charcode = static_cast<FX_DWORD>(-1); | 1463 uint32_t charcode = static_cast<uint32_t>(-1); |
1464 FX_FLOAT kerning; | 1464 FX_FLOAT kerning; |
1465 | 1465 |
1466 pTextObj->GetCharInfo(i, charcode, kerning); | 1466 pTextObj->GetCharInfo(i, charcode, kerning); |
1467 CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode); | 1467 CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode); |
1468 | 1468 |
1469 uint16_t unicode = 0; | 1469 uint16_t unicode = 0; |
1470 if (swUnicode.GetLength() > 0) | 1470 if (swUnicode.GetLength() > 0) |
1471 unicode = swUnicode[0]; | 1471 unicode = swUnicode[0]; |
1472 | 1472 |
1473 if (ISLATINWORD(unicode) && bIsLatin) | 1473 if (ISLATINWORD(unicode) && bIsLatin) |
(...skipping 12 matching lines...) Expand all Loading... |
1486 CFX_WideString swRet; | 1486 CFX_WideString swRet; |
1487 | 1487 |
1488 CPDF_Font* pFont = pTextObj->GetFont(); | 1488 CPDF_Font* pFont = pTextObj->GetFont(); |
1489 if (!pFont) | 1489 if (!pFont) |
1490 return L""; | 1490 return L""; |
1491 | 1491 |
1492 int nWords = 0; | 1492 int nWords = 0; |
1493 FX_BOOL bIsLatin = FALSE; | 1493 FX_BOOL bIsLatin = FALSE; |
1494 | 1494 |
1495 for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) { | 1495 for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) { |
1496 FX_DWORD charcode = static_cast<FX_DWORD>(-1); | 1496 uint32_t charcode = static_cast<uint32_t>(-1); |
1497 FX_FLOAT kerning; | 1497 FX_FLOAT kerning; |
1498 | 1498 |
1499 pTextObj->GetCharInfo(i, charcode, kerning); | 1499 pTextObj->GetCharInfo(i, charcode, kerning); |
1500 CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode); | 1500 CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode); |
1501 | 1501 |
1502 uint16_t unicode = 0; | 1502 uint16_t unicode = 0; |
1503 if (swUnicode.GetLength() > 0) | 1503 if (swUnicode.GetLength() > 0) |
1504 unicode = swUnicode[0]; | 1504 unicode = swUnicode[0]; |
1505 | 1505 |
1506 if (ISLATINWORD(unicode) && bIsLatin) { | 1506 if (ISLATINWORD(unicode) && bIsLatin) { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 } | 1596 } |
1597 } | 1597 } |
1598 | 1598 |
1599 for (const auto& pData : DelayDataForFieldAndControlIndex) | 1599 for (const auto& pData : DelayDataForFieldAndControlIndex) |
1600 Field::DoDelay(m_pDocument, pData.get()); | 1600 Field::DoDelay(m_pDocument, pData.get()); |
1601 } | 1601 } |
1602 | 1602 |
1603 CJS_Document* Document::GetCJSDoc() const { | 1603 CJS_Document* Document::GetCJSDoc() const { |
1604 return static_cast<CJS_Document*>(m_pJSObject); | 1604 return static_cast<CJS_Document*>(m_pJSObject); |
1605 } | 1605 } |
OLD | NEW |