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 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 | 1452 |
1453 int nWords = 0; | 1453 int nWords = 0; |
1454 | 1454 |
1455 CPDF_Font* pFont = pTextObj->GetFont(); | 1455 CPDF_Font* pFont = pTextObj->GetFont(); |
1456 if (!pFont) | 1456 if (!pFont) |
1457 return 0; | 1457 return 0; |
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 = -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 FX_WORD 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) |
(...skipping 12 matching lines...) Expand all Loading... |
1485 CFX_WideString swRet; | 1485 CFX_WideString swRet; |
1486 | 1486 |
1487 CPDF_Font* pFont = pTextObj->GetFont(); | 1487 CPDF_Font* pFont = pTextObj->GetFont(); |
1488 if (!pFont) | 1488 if (!pFont) |
1489 return L""; | 1489 return L""; |
1490 | 1490 |
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 = -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 FX_WORD 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) { |
(...skipping 89 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 |