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: fpdfsdk/src/fxedit/fxet_ap.cpp

Issue 1512763013: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 5 years 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 | « fpdfsdk/src/fsdk_mgr.cpp ('k') | fpdfsdk/src/fxedit/fxet_edit.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 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/include/fxedit/fx_edit.h" 7 #include "fpdfsdk/include/fxedit/fx_edit.h"
8 #include "fpdfsdk/include/fxedit/fxet_edit.h" 8 #include "fpdfsdk/include/fxedit/fxet_edit.h"
9 #include "fpdfsdk/include/fxedit/fxet_stub.h" 9 #include "fpdfsdk/include/fxedit/fxet_stub.h"
10 10
11 CFX_ByteString GetPDFWordString(IFX_Edit_FontMap* pFontMap, 11 CFX_ByteString GetPDFWordString(IFX_Edit_FontMap* pFontMap,
12 int32_t nFontIndex, 12 int32_t nFontIndex,
13 FX_WORD Word, 13 FX_WORD Word,
14 FX_WORD SubWord) { 14 FX_WORD SubWord) {
15 ASSERT(pFontMap != NULL);
16
17 CFX_ByteString sWord; 15 CFX_ByteString sWord;
18
19 if (CPDF_Font* pPDFFont = pFontMap->GetPDFFont(nFontIndex)) { 16 if (CPDF_Font* pPDFFont = pFontMap->GetPDFFont(nFontIndex)) {
20 if (SubWord > 0) { 17 if (SubWord > 0) {
21 Word = SubWord; 18 Word = SubWord;
22 } else { 19 } else {
23 FX_DWORD dwCharCode = -1; 20 FX_DWORD dwCharCode = -1;
24 21
25 if (pPDFFont->IsUnicodeCompatible()) 22 if (pPDFFont->IsUnicodeCompatible())
26 dwCharCode = pPDFFont->CharCodeFromUnicode(Word); 23 dwCharCode = pPDFFont->CharCodeFromUnicode(Word);
27 else 24 else
28 dwCharCode = pFontMap->CharCodeFromUnicode(nFontIndex, Word); 25 dwCharCode = pFontMap->CharCodeFromUnicode(nFontIndex, Word);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 sRet << word.ptWord.x + ptOffset.x << " " 196 sRet << word.ptWord.x + ptOffset.x << " "
200 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " " 197 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " "
201 << line.fLineAscent - line.fLineDescent << " re\nf\n"; 198 << line.fLineAscent - line.fLineDescent << " re\nf\n";
202 } 199 }
203 } 200 }
204 } 201 }
205 } 202 }
206 203
207 return sRet.GetByteString(); 204 return sRet.GetByteString();
208 } 205 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fsdk_mgr.cpp ('k') | fpdfsdk/src/fxedit/fxet_edit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698