| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 if (m_bRichText) { | 303 if (m_bRichText) { |
| 304 CPVT_WordProps* pNewProps = | 304 CPVT_WordProps* pNewProps = |
| 305 pWordProps ? new CPVT_WordProps(*pWordProps) : new CPVT_WordProps(); | 305 pWordProps ? new CPVT_WordProps(*pWordProps) : new CPVT_WordProps(); |
| 306 pNewProps->nFontIndex = | 306 pNewProps->nFontIndex = |
| 307 GetWordFontIndex(word, charset, pWordProps->nFontIndex); | 307 GetWordFontIndex(word, charset, pWordProps->nFontIndex); |
| 308 return AddWord(newplace, CPVT_WordInfo(word, charset, -1, pNewProps)); | 308 return AddWord(newplace, CPVT_WordInfo(word, charset, -1, pNewProps)); |
| 309 } | 309 } |
| 310 int32_t nFontIndex = | 310 int32_t nFontIndex = |
| 311 GetSubWord() > 0 ? GetDefaultFontIndex() | 311 GetSubWord() > 0 ? GetDefaultFontIndex() |
| 312 : GetWordFontIndex(word, charset, GetDefaultFontIndex()); | 312 : GetWordFontIndex(word, charset, GetDefaultFontIndex()); |
| 313 return AddWord(newplace, CPVT_WordInfo(word, charset, nFontIndex, NULL)); | 313 return AddWord(newplace, CPVT_WordInfo(word, charset, nFontIndex, nullptr)); |
| 314 } | 314 } |
| 315 | 315 |
| 316 CPVT_WordPlace CPDF_VariableText::InsertSection( | 316 CPVT_WordPlace CPDF_VariableText::InsertSection( |
| 317 const CPVT_WordPlace& place, | 317 const CPVT_WordPlace& place, |
| 318 const CPVT_SecProps* pSecProps, | 318 const CPVT_SecProps* pSecProps, |
| 319 const CPVT_WordProps* pWordProps) { | 319 const CPVT_WordProps* pWordProps) { |
| 320 int32_t nTotlaWords = GetTotalWords(); | 320 int32_t nTotlaWords = GetTotalWords(); |
| 321 if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) | 321 if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) |
| 322 return place; | 322 return place; |
| 323 if (m_nCharArray > 0 && nTotlaWords >= m_nCharArray) | 323 if (m_nCharArray > 0 && nTotlaWords >= m_nCharArray) |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 | 1142 |
| 1143 CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() { | 1143 CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() { |
| 1144 if (!m_pVTIterator) | 1144 if (!m_pVTIterator) |
| 1145 m_pVTIterator.reset(new CPDF_VariableText::Iterator(this)); | 1145 m_pVTIterator.reset(new CPDF_VariableText::Iterator(this)); |
| 1146 return m_pVTIterator.get(); | 1146 return m_pVTIterator.get(); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) { | 1149 void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) { |
| 1150 m_pVTProvider = pProvider; | 1150 m_pVTProvider = pProvider; |
| 1151 } | 1151 } |
| OLD | NEW |