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/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
8 #include "../../include/fpdfdoc/fpdf_vt.h" | 8 #include "../../include/fpdfdoc/fpdf_vt.h" |
9 #include "pdf_vt.h" | 9 #include "pdf_vt.h" |
10 const FX_BYTE gFontSizeSteps[] = { 4, 6, 8, 9, 10, 12, 14, 18, 20, 25,
30, 35, 40, 45, 50, 55, 60, 70, 80, 90, 100, 110, 120, 130, 144}; | 10 const FX_BYTE gFontSizeSteps[] = { 4, 6, 8, 9, 10, 12, 14, 18, 20, 25,
30, 35, 40, 45, 50, 55, 60, 70, 80, 90, 100, 110, 120, 130, 144}; |
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1); | 1734 m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1); |
1735 return TRUE; | 1735 return TRUE; |
1736 } | 1736 } |
1737 } | 1737 } |
1738 } | 1738 } |
1739 return FALSE; | 1739 return FALSE; |
1740 } | 1740 } |
1741 FX_BOOL CPDF_VariableText_Iterator::PrevLine() | 1741 FX_BOOL CPDF_VariableText_Iterator::PrevLine() |
1742 { | 1742 { |
1743 ASSERT(m_pVT != NULL); | 1743 ASSERT(m_pVT != NULL); |
1744 if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) { | 1744 if (m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) { |
1745 if (m_CurPos.nLineIndex > 0) { | 1745 if (m_CurPos.nLineIndex > 0) { |
1746 m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex -
1, -1); | 1746 m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex -
1, -1); |
1747 return TRUE; | 1747 return TRUE; |
1748 } else { | 1748 } else { |
1749 if (m_CurPos.nSecIndex > 0) { | 1749 if (m_CurPos.nSecIndex > 0) { |
1750 if (CSection * pLastSection = m_pVT->m_SectionArray.GetAt(m_CurP
os.nSecIndex - 1)) { | 1750 if (CSection * pLastSection = m_pVT->m_SectionArray.GetAt(m_CurP
os.nSecIndex - 1)) { |
1751 m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, pLastSecti
on->m_LineArray.GetSize() - 1, -1); | 1751 m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, pLastSecti
on->m_LineArray.GetSize() - 1, -1); |
1752 return TRUE; | 1752 return TRUE; |
1753 } | 1753 } |
1754 } | 1754 } |
(...skipping 17 matching lines...) Expand all Loading... |
1772 m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, 0, -1); | 1772 m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, 0, -1); |
1773 return TRUE; | 1773 return TRUE; |
1774 } | 1774 } |
1775 return FALSE; | 1775 return FALSE; |
1776 } | 1776 } |
1777 FX_BOOL CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const | 1777 FX_BOOL CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const |
1778 { | 1778 { |
1779 ASSERT(m_pVT != NULL); | 1779 ASSERT(m_pVT != NULL); |
1780 word.WordPlace = m_CurPos; | 1780 word.WordPlace = m_CurPos; |
1781 if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) { | 1781 if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) { |
1782 if (CLine * pLine = pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) { | 1782 if (pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) { |
1783 if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(m_CurPos.nWo
rdIndex)) { | 1783 if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(m_CurPos.nWo
rdIndex)) { |
1784 word.Word = pWord->Word; | 1784 word.Word = pWord->Word; |
1785 word.nCharset = pWord->nCharset; | 1785 word.nCharset = pWord->nCharset; |
1786 word.fWidth = m_pVT->GetWordWidth(*pWord); | 1786 word.fWidth = m_pVT->GetWordWidth(*pWord); |
1787 word.ptWord = m_pVT->InToOut( | 1787 word.ptWord = m_pVT->InToOut( |
1788 CPDF_Point(pWord->fWordX + pSection->m_SecInfo
.rcSection.left, | 1788 CPDF_Point(pWord->fWordX + pSection->m_SecInfo
.rcSection.left, |
1789 pWord->fWordY + pSection->m_SecInfo
.rcSection.top) ); | 1789 pWord->fWordY + pSection->m_SecInfo
.rcSection.top) ); |
1790 word.fAscent = m_pVT->GetWordAscent(*pWord); | 1790 word.fAscent = m_pVT->GetWordAscent(*pWord); |
1791 word.fDescent = m_pVT->GetWordDescent(*pWord); | 1791 word.fDescent = m_pVT->GetWordDescent(*pWord); |
1792 if (pWord->pWordProps) { | 1792 if (pWord->pWordProps) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 if (pSection->m_SecInfo.pSecProps) { | 1854 if (pSection->m_SecInfo.pSecProps) { |
1855 *pSection->m_SecInfo.pSecProps = section.SecProps; | 1855 *pSection->m_SecInfo.pSecProps = section.SecProps; |
1856 } | 1856 } |
1857 if (pSection->m_SecInfo.pWordProps) { | 1857 if (pSection->m_SecInfo.pWordProps) { |
1858 *pSection->m_SecInfo.pWordProps = section.WordProps; | 1858 *pSection->m_SecInfo.pWordProps = section.WordProps; |
1859 } | 1859 } |
1860 return TRUE; | 1860 return TRUE; |
1861 } | 1861 } |
1862 return FALSE; | 1862 return FALSE; |
1863 } | 1863 } |
OLD | NEW |