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

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

Issue 2049003003: Add some consts and remove more casts in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 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/doc_form.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/ctypeset.h" 7 #include "core/fpdfdoc/ctypeset.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 nStart = m_pVT->m_nCharArray - m_pSection->m_WordArray.GetSize(); 207 nStart = m_pVT->m_nCharArray - m_pSection->m_WordArray.GetSize();
208 pLine->m_LineInfo.fLineX = 208 pLine->m_LineInfo.fLineX =
209 fNodeWidth * nStart - fNodeWidth * VARIABLETEXT_HALF; 209 fNodeWidth * nStart - fNodeWidth * VARIABLETEXT_HALF;
210 break; 210 break;
211 } 211 }
212 for (int32_t w = 0, sz = m_pSection->m_WordArray.GetSize(); w < sz; w++) { 212 for (int32_t w = 0, sz = m_pSection->m_WordArray.GetSize(); w < sz; w++) {
213 if (w >= m_pVT->m_nCharArray) { 213 if (w >= m_pVT->m_nCharArray) {
214 break; 214 break;
215 } 215 }
216 fNextWidth = 0; 216 fNextWidth = 0;
217 if (CPVT_WordInfo* pNextWord = 217 if (CPVT_WordInfo* pNextWord = m_pSection->m_WordArray.GetAt(w + 1)) {
218 (CPVT_WordInfo*)m_pSection->m_WordArray.GetAt(w + 1)) {
219 pNextWord->fWordTail = 0; 218 pNextWord->fWordTail = 0;
220 fNextWidth = m_pVT->GetWordWidth(*pNextWord); 219 fNextWidth = m_pVT->GetWordWidth(*pNextWord);
221 } 220 }
222 if (CPVT_WordInfo* pWord = 221 if (CPVT_WordInfo* pWord = m_pSection->m_WordArray.GetAt(w)) {
223 (CPVT_WordInfo*)m_pSection->m_WordArray.GetAt(w)) {
224 pWord->fWordTail = 0; 222 pWord->fWordTail = 0;
225 FX_FLOAT fWordWidth = m_pVT->GetWordWidth(*pWord); 223 FX_FLOAT fWordWidth = m_pVT->GetWordWidth(*pWord);
226 FX_FLOAT fWordAscent = m_pVT->GetWordAscent(*pWord); 224 FX_FLOAT fWordAscent = m_pVT->GetWordAscent(*pWord);
227 FX_FLOAT fWordDescent = m_pVT->GetWordDescent(*pWord); 225 FX_FLOAT fWordDescent = m_pVT->GetWordDescent(*pWord);
228 x = (FX_FLOAT)(fNodeWidth * (w + nStart + 0.5) - 226 x = (FX_FLOAT)(fNodeWidth * (w + nStart + 0.5) -
229 fWordWidth * VARIABLETEXT_HALF); 227 fWordWidth * VARIABLETEXT_HALF);
230 pWord->fWordX = x; 228 pWord->fWordX = x;
231 pWord->fWordY = y; 229 pWord->fWordY = y;
232 if (w == 0) { 230 if (w == 0) {
233 pLine->m_LineInfo.fLineX = x; 231 pLine->m_LineInfo.fLineX = x;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 } 485 }
488 fPosX += m_pVT->GetWordWidth(*pWord); 486 fPosX += m_pVT->GetWordWidth(*pWord);
489 } 487 }
490 } 488 }
491 fPosY -= pLine->m_LineInfo.fLineDescent; 489 fPosY -= pLine->m_LineInfo.fLineDescent;
492 } 490 }
493 } 491 }
494 } 492 }
495 m_rcRet = CPVT_FloatRect(fMinX, fMinY, fMaxX, fMaxY); 493 m_rcRet = CPVT_FloatRect(fMinX, fMinY, fMaxX, fMaxY);
496 } 494 }
OLDNEW
« no previous file with comments | « no previous file | core/fpdfdoc/doc_form.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698