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 "core/src/fpdftext/text_int.h" | 7 #include "core/src/fpdftext/text_int.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cctype> | 10 #include <cctype> |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 } | 741 } |
742 } | 742 } |
743 return breakPos; | 743 return breakPos; |
744 } | 744 } |
745 int32_t CPDF_TextPage::FindTextlineFlowDirection() { | 745 int32_t CPDF_TextPage::FindTextlineFlowDirection() { |
746 if (!m_pPage) { | 746 if (!m_pPage) { |
747 return -1; | 747 return -1; |
748 } | 748 } |
749 const int32_t nPageWidth = (int32_t)((CPDF_Page*)m_pPage)->GetPageWidth(); | 749 const int32_t nPageWidth = (int32_t)((CPDF_Page*)m_pPage)->GetPageWidth(); |
750 const int32_t nPageHeight = (int32_t)((CPDF_Page*)m_pPage)->GetPageHeight(); | 750 const int32_t nPageHeight = (int32_t)((CPDF_Page*)m_pPage)->GetPageHeight(); |
751 CFX_ByteArray nHorizontalMask; | 751 std::vector<uint8_t> nHorizontalMask(nPageWidth); |
752 if (!nHorizontalMask.SetSize(nPageWidth)) { | 752 std::vector<uint8_t> nVerticalMask(nPageHeight); |
753 return -1; | 753 uint8_t* pDataH = nHorizontalMask.data(); |
754 } | 754 uint8_t* pDataV = nVerticalMask.data(); |
755 uint8_t* pDataH = nHorizontalMask.GetData(); | |
756 CFX_ByteArray nVerticalMask; | |
757 if (!nVerticalMask.SetSize(nPageHeight)) { | |
758 return -1; | |
759 } | |
760 uint8_t* pDataV = nVerticalMask.GetData(); | |
761 int32_t index = 0; | 755 int32_t index = 0; |
762 FX_FLOAT fLineHeight = 0.0f; | 756 FX_FLOAT fLineHeight = 0.0f; |
763 CPDF_PageObject* pPageObj = NULL; | 757 CPDF_PageObject* pPageObj = NULL; |
764 FX_POSITION pos = NULL; | 758 FX_POSITION pos = NULL; |
765 pos = m_pPage->GetFirstObjectPosition(); | 759 pos = m_pPage->GetFirstObjectPosition(); |
766 if (!pos) { | 760 if (!pos) { |
767 return -1; | 761 return -1; |
768 } | 762 } |
769 while (pos) { | 763 while (pos) { |
770 pPageObj = m_pPage->GetNextObject(pos); | 764 pPageObj = m_pPage->GetNextObject(pos); |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2634 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { | 2628 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { |
2635 return; | 2629 return; |
2636 } | 2630 } |
2637 CPDF_LinkExt* link = NULL; | 2631 CPDF_LinkExt* link = NULL; |
2638 link = m_LinkList.GetAt(index); | 2632 link = m_LinkList.GetAt(index); |
2639 if (!link) { | 2633 if (!link) { |
2640 return; | 2634 return; |
2641 } | 2635 } |
2642 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2636 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2643 } | 2637 } |
OLD | NEW |