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

Side by Side Diff: fpdfsdk/fpdfppo.cpp

Issue 2340513002: Remove more strcmp/memcmp usage. (Closed)
Patch Set: Nit 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/fpdfapi/fpdf_font/fpdf_font_cid.cpp ('k') | fpdfsdk/pdfwindow/PWL_ScrollBar.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 "public/fpdf_ppo.h" 7 #include "public/fpdf_ppo.h"
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 pReference->SetRef(pDoc, newobjnum); 216 pReference->SetRef(pDoc, newobjnum);
217 break; 217 break;
218 } 218 }
219 case CPDF_Object::DICTIONARY: { 219 case CPDF_Object::DICTIONARY: {
220 CPDF_Dictionary* pDict = pObj->AsDictionary(); 220 CPDF_Dictionary* pDict = pObj->AsDictionary();
221 auto it = pDict->begin(); 221 auto it = pDict->begin();
222 while (it != pDict->end()) { 222 while (it != pDict->end()) {
223 const CFX_ByteString& key = it->first; 223 const CFX_ByteString& key = it->first;
224 CPDF_Object* pNextObj = it->second; 224 CPDF_Object* pNextObj = it->second;
225 ++it; 225 ++it;
226 if (!FXSYS_strcmp(key.c_str(), "Parent") || 226 if (key == "Parent" || key == "Prev" || key == "First")
227 !FXSYS_strcmp(key.c_str(), "Prev") ||
228 !FXSYS_strcmp(key.c_str(), "First")) {
229 continue; 227 continue;
230 } 228 if (!pNextObj)
231 if (pNextObj) {
232 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
233 pDict->RemoveAt(key);
234 } else {
235 return FALSE; 229 return FALSE;
236 } 230 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
231 pDict->RemoveAt(key);
237 } 232 }
238 break; 233 break;
239 } 234 }
240 case CPDF_Object::ARRAY: { 235 case CPDF_Object::ARRAY: {
241 CPDF_Array* pArray = pObj->AsArray(); 236 CPDF_Array* pArray = pObj->AsArray();
242 for (size_t i = 0; i < pArray->GetCount(); ++i) { 237 for (size_t i = 0; i < pArray->GetCount(); ++i) {
243 CPDF_Object* pNextObj = pArray->GetObjectAt(i); 238 CPDF_Object* pNextObj = pArray->GetObjectAt(i);
244 if (!pNextObj) 239 if (!pNextObj)
245 return FALSE; 240 return FALSE;
246 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap)) 241 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 if (!pSrcDict) 398 if (!pSrcDict)
404 return FALSE; 399 return FALSE;
405 400
406 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); 401 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot();
407 if (!pDstDict) 402 if (!pDstDict)
408 return FALSE; 403 return FALSE;
409 404
410 pDstDict->SetAt("ViewerPreferences", pSrcDict->CloneDirectObject()); 405 pDstDict->SetAt("ViewerPreferences", pSrcDict->CloneDirectObject());
411 return TRUE; 406 return TRUE;
412 } 407 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_font/fpdf_font_cid.cpp ('k') | fpdfsdk/pdfwindow/PWL_ScrollBar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698