| 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/fxedit/include/fxet_edit.h" | 7 #include "fpdfsdk/fxedit/include/fxet_edit.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 : CPDF_VariableText::Provider(pFontMap), m_pFontMap(pFontMap) { | 214 : CPDF_VariableText::Provider(pFontMap), m_pFontMap(pFontMap) { |
| 215 ASSERT(m_pFontMap); | 215 ASSERT(m_pFontMap); |
| 216 } | 216 } |
| 217 | 217 |
| 218 CFX_Edit_Provider::~CFX_Edit_Provider() {} | 218 CFX_Edit_Provider::~CFX_Edit_Provider() {} |
| 219 | 219 |
| 220 IPVT_FontMap* CFX_Edit_Provider::GetFontMap() { | 220 IPVT_FontMap* CFX_Edit_Provider::GetFontMap() { |
| 221 return m_pFontMap; | 221 return m_pFontMap; |
| 222 } | 222 } |
| 223 | 223 |
| 224 int32_t CFX_Edit_Provider::GetCharWidth(int32_t nFontIndex, | 224 int32_t CFX_Edit_Provider::GetCharWidth(int32_t nFontIndex, uint16_t word) { |
| 225 uint16_t word, | |
| 226 int32_t nWordStyle) { | |
| 227 if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) { | 225 if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) { |
| 228 uint32_t charcode = word; | 226 uint32_t charcode = word; |
| 229 | 227 |
| 230 if (pPDFFont->IsUnicodeCompatible()) | 228 if (pPDFFont->IsUnicodeCompatible()) |
| 231 charcode = pPDFFont->CharCodeFromUnicode(word); | 229 charcode = pPDFFont->CharCodeFromUnicode(word); |
| 232 else | 230 else |
| 233 charcode = m_pFontMap->CharCodeFromUnicode(nFontIndex, word); | 231 charcode = m_pFontMap->CharCodeFromUnicode(nFontIndex, word); |
| 234 | 232 |
| 235 if (charcode != CPDF_Font::kInvalidCharCode) | 233 if (charcode != CPDF_Font::kInvalidCharCode) |
| 236 return pPDFFont->GetCharWidthF(charcode); | 234 return pPDFFont->GetCharWidthF(charcode); |
| (...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2529 int32_t CFX_Edit_RectArray::GetSize() const { | 2527 int32_t CFX_Edit_RectArray::GetSize() const { |
| 2530 return m_Rects.GetSize(); | 2528 return m_Rects.GetSize(); |
| 2531 } | 2529 } |
| 2532 | 2530 |
| 2533 CFX_FloatRect* CFX_Edit_RectArray::GetAt(int32_t nIndex) const { | 2531 CFX_FloatRect* CFX_Edit_RectArray::GetAt(int32_t nIndex) const { |
| 2534 if (nIndex < 0 || nIndex >= m_Rects.GetSize()) | 2532 if (nIndex < 0 || nIndex >= m_Rects.GetSize()) |
| 2535 return nullptr; | 2533 return nullptr; |
| 2536 | 2534 |
| 2537 return m_Rects.GetAt(nIndex); | 2535 return m_Rects.GetAt(nIndex); |
| 2538 } | 2536 } |
| OLD | NEW |