Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: fpdfsdk/fxedit/fxet_edit.cpp

Issue 2337973004: Wordstyle not being used to calculate word width (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfdoc/include/cpdf_variabletext.h ('k') | fpdfsdk/fxedit/include/fxet_edit.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/include/cpdf_variabletext.h ('k') | fpdfsdk/fxedit/include/fxet_edit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698