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

Side by Side Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp

Issue 1243883003: Fix else-after-returns throughout pdfium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, Address comments. Created 5 years, 5 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/include/fpdftext/fpdf_text.h ('k') | core/src/fpdfapi/fpdf_font/fpdf_font.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 "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../fpdf_page/pageint.h" 9 #include "../fpdf_page/pageint.h"
10 #include <limits.h> 10 #include <limits.h>
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 }; 514 };
515 static FX_WORD FX_GetCsFromLangCode(uint32_t uCode) 515 static FX_WORD FX_GetCsFromLangCode(uint32_t uCode)
516 { 516 {
517 int32_t iStart = 0; 517 int32_t iStart = 0;
518 int32_t iEnd = sizeof(gs_FXLang2CharsetTable) / sizeof(FX_LANG2CS) - 1; 518 int32_t iEnd = sizeof(gs_FXLang2CharsetTable) / sizeof(FX_LANG2CS) - 1;
519 while (iStart <= iEnd) { 519 while (iStart <= iEnd) {
520 int32_t iMid = (iStart + iEnd) / 2; 520 int32_t iMid = (iStart + iEnd) / 2;
521 const FX_LANG2CS &charset = gs_FXLang2CharsetTable[iMid]; 521 const FX_LANG2CS &charset = gs_FXLang2CharsetTable[iMid];
522 if (uCode == charset.uLang) { 522 if (uCode == charset.uLang) {
523 return charset.uCharset; 523 return charset.uCharset;
524 } else if (uCode < charset.uLang) { 524 }
525 if (uCode < charset.uLang) {
525 iEnd = iMid - 1; 526 iEnd = iMid - 1;
526 } else { 527 } else {
527 iStart = iMid + 1; 528 iStart = iMid + 1;
528 } 529 }
529 }; 530 };
530 return 0; 531 return 0;
531 } 532 }
532 static FX_WORD FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength) 533 static FX_WORD FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength)
533 { 534 {
534 FXSYS_assert(pLang); 535 FXSYS_assert(pLang);
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, const CFX_ByteStringC& nam e) 1174 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, const CFX_ByteStringC& nam e)
1174 { 1175 {
1175 if (pPageDict->KeyExist(name)) { 1176 if (pPageDict->KeyExist(name)) {
1176 return; 1177 return;
1177 } 1178 }
1178 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); 1179 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name);
1179 if (pObj) { 1180 if (pObj) {
1180 pPageDict->SetAt(name, pObj->Clone()); 1181 pPageDict->SetAt(name, pObj->Clone());
1181 } 1182 }
1182 } 1183 }
OLDNEW
« no previous file with comments | « core/include/fpdftext/fpdf_text.h ('k') | core/src/fpdfapi/fpdf_font/fpdf_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698