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

Side by Side Diff: core/fpdfdoc/cpdf_variabletext.cpp

Issue 1960043003: Fix some misc nits. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 7 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 | « no previous file | core/fpdfdoc/cpvt_generateap.cpp » ('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 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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 } 1105 }
1106 return rcRet; 1106 return rcRet;
1107 } 1107 }
1108 1108
1109 int32_t CPDF_VariableText::GetCharWidth(int32_t nFontIndex, 1109 int32_t CPDF_VariableText::GetCharWidth(int32_t nFontIndex,
1110 uint16_t Word, 1110 uint16_t Word,
1111 uint16_t SubWord, 1111 uint16_t SubWord,
1112 int32_t nWordStyle) { 1112 int32_t nWordStyle) {
1113 if (!m_pVTProvider) 1113 if (!m_pVTProvider)
1114 return 0; 1114 return 0;
1115 if (SubWord > 0) 1115 uint16_t word = SubWord ? SubWord : Word;
Wei Li 2016/05/12 21:11:59 SubWord > 0 ? SubWord : Word
Lei Zhang 2016/05/12 22:11:31 |SubWord| is unsigned, so it doesn't matter?
1116 return m_pVTProvider->GetCharWidth(nFontIndex, SubWord, nWordStyle); 1116 return m_pVTProvider->GetCharWidth(nFontIndex, word, nWordStyle);
1117 return m_pVTProvider->GetCharWidth(nFontIndex, Word, nWordStyle);
1118 } 1117 }
1119 1118
1120 int32_t CPDF_VariableText::GetTypeAscent(int32_t nFontIndex) { 1119 int32_t CPDF_VariableText::GetTypeAscent(int32_t nFontIndex) {
1121 return m_pVTProvider ? m_pVTProvider->GetTypeAscent(nFontIndex) : 0; 1120 return m_pVTProvider ? m_pVTProvider->GetTypeAscent(nFontIndex) : 0;
1122 } 1121 }
1123 1122
1124 int32_t CPDF_VariableText::GetTypeDescent(int32_t nFontIndex) { 1123 int32_t CPDF_VariableText::GetTypeDescent(int32_t nFontIndex) {
1125 return m_pVTProvider ? m_pVTProvider->GetTypeDescent(nFontIndex) : 0; 1124 return m_pVTProvider ? m_pVTProvider->GetTypeDescent(nFontIndex) : 0;
1126 } 1125 }
1127 1126
(...skipping 15 matching lines...) Expand all
1143 1142
1144 CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() { 1143 CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() {
1145 if (!m_pVTIterator) 1144 if (!m_pVTIterator)
1146 m_pVTIterator.reset(new CPDF_VariableText::Iterator(this)); 1145 m_pVTIterator.reset(new CPDF_VariableText::Iterator(this));
1147 return m_pVTIterator.get(); 1146 return m_pVTIterator.get();
1148 } 1147 }
1149 1148
1150 void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) { 1149 void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) {
1151 m_pVTProvider = pProvider; 1150 m_pVTProvider = pProvider;
1152 } 1151 }
OLDNEW
« no previous file with comments | « no previous file | core/fpdfdoc/cpvt_generateap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698