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

Side by Side Diff: core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp

Issue 1265503005: clang-format all pdfium code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: sigh Created 5 years, 4 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 "JBig2_SymbolDict.h" 7 #include "JBig2_SymbolDict.h"
8 CJBig2_SymbolDict::CJBig2_SymbolDict() 8 CJBig2_SymbolDict::CJBig2_SymbolDict() {
9 { 9 SDNUMEXSYMS = 0;
10 SDNUMEXSYMS = 0; 10 SDEXSYMS = NULL;
11 SDEXSYMS = NULL; 11 m_bContextRetained = FALSE;
12 m_bContextRetained = FALSE; 12 m_gbContext = m_grContext = NULL;
13 m_gbContext = m_grContext = NULL;
14 } 13 }
15 14
16 CJBig2_SymbolDict *CJBig2_SymbolDict::DeepCopy() 15 CJBig2_SymbolDict* CJBig2_SymbolDict::DeepCopy() {
17 { 16 CJBig2_SymbolDict* dst = NULL;
18 CJBig2_SymbolDict *dst = NULL; 17 CJBig2_SymbolDict* src = this;
19 CJBig2_SymbolDict *src = this; 18 if (src->m_bContextRetained || src->m_gbContext || src->m_grContext) {
20 if (src->m_bContextRetained || 19 return NULL;
21 src->m_gbContext || 20 }
22 src->m_grContext) { 21 JBIG2_ALLOC(dst, CJBig2_SymbolDict());
23 return NULL; 22 dst->SDNUMEXSYMS = src->SDNUMEXSYMS;
23 dst->SDEXSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(
24 sizeof(CJBig2_Image*), src->SDNUMEXSYMS);
25 for (FX_DWORD i = 0; i < src->SDNUMEXSYMS; i++) {
26 if (src->SDEXSYMS[i]) {
27 JBIG2_ALLOC(dst->SDEXSYMS[i], CJBig2_Image(*(src->SDEXSYMS[i])));
28 } else {
29 dst->SDEXSYMS[i] = NULL;
24 } 30 }
25 JBIG2_ALLOC(dst, CJBig2_SymbolDict()); 31 }
26 dst->SDNUMEXSYMS = src->SDNUMEXSYMS; 32 return dst;
27 dst->SDEXSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(
28 sizeof(CJBig2_Image*), src->SDNUMEXSYMS);
29 for(FX_DWORD i = 0; i < src->SDNUMEXSYMS; i++) {
30 if (src->SDEXSYMS[i]) {
31 JBIG2_ALLOC(dst->SDEXSYMS[i],
32 CJBig2_Image(*(src->SDEXSYMS[i])));
33 } else {
34 dst->SDEXSYMS[i] = NULL;
35 }
36 }
37 return dst;
38 } 33 }
39 34
40 CJBig2_SymbolDict::~CJBig2_SymbolDict() 35 CJBig2_SymbolDict::~CJBig2_SymbolDict() {
41 { 36 if (SDEXSYMS) {
42 if(SDEXSYMS) { 37 for (FX_DWORD i = 0; i < SDNUMEXSYMS; i++) {
43 for(FX_DWORD i = 0; i < SDNUMEXSYMS; i++) { 38 delete SDEXSYMS[i];
44 delete SDEXSYMS[i];
45 }
46 m_pModule->JBig2_Free(SDEXSYMS);
47 } 39 }
48 if(m_bContextRetained) { 40 m_pModule->JBig2_Free(SDEXSYMS);
49 if(m_gbContext) { 41 }
50 m_pModule->JBig2_Free(m_gbContext); 42 if (m_bContextRetained) {
51 } 43 if (m_gbContext) {
52 if(m_grContext) { 44 m_pModule->JBig2_Free(m_gbContext);
53 m_pModule->JBig2_Free(m_grContext);
54 }
55 } 45 }
46 if (m_grContext) {
47 m_pModule->JBig2_Free(m_grContext);
48 }
49 }
56 } 50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698