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

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

Issue 2031653003: Get rid of NULLs in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_core
Patch Set: Fix bad search/replace 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
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 "core/fpdfapi/fpdf_font/include/cpdf_font.h" 7 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
8 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" 8 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h"
9 #include "core/fpdfdoc/include/cpvt_word.h" 9 #include "core/fpdfdoc/include/cpvt_word.h"
10 #include "core/fpdfdoc/include/ipvt_fontmap.h" 10 #include "core/fpdfdoc/include/ipvt_fontmap.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); 52 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex);
53 if (sFontAlias.GetLength() > 0 && fFontSize > 0) 53 if (sFontAlias.GetLength() > 0 && fFontSize > 0)
54 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; 54 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n";
55 } 55 }
56 return sRet.MakeString(); 56 return sRet.MakeString();
57 } 57 }
58 58
59 CFX_ByteString IFX_Edit::GetEditAppearanceStream( 59 CFX_ByteString IFX_Edit::GetEditAppearanceStream(
60 IFX_Edit* pEdit, 60 IFX_Edit* pEdit,
61 const CFX_FloatPoint& ptOffset, 61 const CFX_FloatPoint& ptOffset,
62 const CPVT_WordRange* pRange /* = NULL*/, 62 const CPVT_WordRange* pRange /* = nullptr*/,
Tom Sepez 2016/06/02 20:26:26 kill comments.
Lei Zhang 2016/06/07 08:03:13 Done.
63 FX_BOOL bContinuous /* = TRUE*/, 63 FX_BOOL bContinuous /* = TRUE*/,
64 uint16_t SubWord /* = 0*/) { 64 uint16_t SubWord /* = 0*/) {
65 CFX_ByteTextBuf sEditStream, sWords; 65 CFX_ByteTextBuf sEditStream, sWords;
66 66
67 CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); 67 CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f);
68 int32_t nCurFontIndex = -1; 68 int32_t nCurFontIndex = -1;
69 69
70 IFX_Edit_Iterator* pIterator = pEdit->GetIterator(); 70 IFX_Edit_Iterator* pIterator = pEdit->GetIterator();
71 if (pRange) 71 if (pRange)
72 pIterator->SetAt(pRange->BeginPos); 72 pIterator->SetAt(pRange->BeginPos);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 if (pIterator->GetWord(word) && pIterator->GetLine(line)) { 192 if (pIterator->GetWord(word) && pIterator->GetLine(line)) {
193 sRet << word.ptWord.x + ptOffset.x << " " 193 sRet << word.ptWord.x + ptOffset.x << " "
194 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " " 194 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " "
195 << line.fLineAscent - line.fLineDescent << " re\nf\n"; 195 << line.fLineAscent - line.fLineDescent << " re\nf\n";
196 } 196 }
197 } 197 }
198 } 198 }
199 199
200 return sRet.MakeString(); 200 return sRet.MakeString();
201 } 201 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698