OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/fpdfdoc/include/cpdf_variabletext.h" | 7 #include "core/fpdfdoc/include/cpdf_variabletext.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
10 #include "core/fpdfdoc/cpvt_wordinfo.h" | 10 #include "core/fpdfdoc/cpvt_wordinfo.h" |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 | 780 |
781 FX_BOOL CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace& place, | 781 FX_BOOL CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace& place, |
782 CPVT_SectionInfo& secinfo) { | 782 CPVT_SectionInfo& secinfo) { |
783 if (CSection* pSection = m_SectionArray.GetAt(place.nSecIndex)) { | 783 if (CSection* pSection = m_SectionArray.GetAt(place.nSecIndex)) { |
784 secinfo = pSection->m_SecInfo; | 784 secinfo = pSection->m_SecInfo; |
785 return TRUE; | 785 return TRUE; |
786 } | 786 } |
787 return FALSE; | 787 return FALSE; |
788 } | 788 } |
789 | 789 |
| 790 void CPDF_VariableText::SetPlateRect(const CFX_FloatRect& rect) { |
| 791 CPDF_EditContainer::SetPlateRect(rect); |
| 792 } |
| 793 |
790 CFX_FloatRect CPDF_VariableText::GetContentRect() const { | 794 CFX_FloatRect CPDF_VariableText::GetContentRect() const { |
791 return InToOut(CPVT_FloatRect(CPDF_EditContainer::GetContentRect())); | 795 return InToOut(CPVT_FloatRect(CPDF_EditContainer::GetContentRect())); |
792 } | 796 } |
793 | 797 |
| 798 const CFX_FloatRect& CPDF_VariableText::GetPlateRect() const { |
| 799 return CPDF_EditContainer::GetPlateRect(); |
| 800 } |
| 801 |
794 FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo& WordInfo, | 802 FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo& WordInfo, |
795 FX_BOOL bFactFontSize) { | 803 FX_BOOL bFactFontSize) { |
796 return m_bRichText && WordInfo.pWordProps | 804 return m_bRichText && WordInfo.pWordProps |
797 ? (WordInfo.pWordProps->nScriptType == ScriptType::Normal || | 805 ? (WordInfo.pWordProps->nScriptType == ScriptType::Normal || |
798 bFactFontSize | 806 bFactFontSize |
799 ? WordInfo.pWordProps->fFontSize | 807 ? WordInfo.pWordProps->fFontSize |
800 : WordInfo.pWordProps->fFontSize * VARIABLETEXT_HALF) | 808 : WordInfo.pWordProps->fFontSize * VARIABLETEXT_HALF) |
801 : GetFontSize(); | 809 : GetFontSize(); |
802 } | 810 } |
803 | 811 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 | 1150 |
1143 CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() { | 1151 CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() { |
1144 if (!m_pVTIterator) | 1152 if (!m_pVTIterator) |
1145 m_pVTIterator.reset(new CPDF_VariableText::Iterator(this)); | 1153 m_pVTIterator.reset(new CPDF_VariableText::Iterator(this)); |
1146 return m_pVTIterator.get(); | 1154 return m_pVTIterator.get(); |
1147 } | 1155 } |
1148 | 1156 |
1149 void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) { | 1157 void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) { |
1150 m_pVTProvider = pProvider; | 1158 m_pVTProvider = pProvider; |
1151 } | 1159 } |
OLD | NEW |