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

Side by Side Diff: core/fpdfdoc/cpvt_wordinfo.cpp

Issue 2571913002: Avoid the ptr.reset(new XXX()) anti-pattern (Closed)
Patch Set: rebase Created 4 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 | « core/fpdfdoc/cpvt_sectioninfo.cpp ('k') | core/fxcodec/codec/fx_codec_jbig.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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/fpdfdoc/cpvt_wordinfo.h" 7 #include "core/fpdfdoc/cpvt_wordinfo.h"
8 #include "third_party/base/ptr_util.h"
8 9
9 CPVT_WordInfo::CPVT_WordInfo() 10 CPVT_WordInfo::CPVT_WordInfo()
10 : Word(0), 11 : Word(0),
11 nCharset(FXFONT_ANSI_CHARSET), 12 nCharset(FXFONT_ANSI_CHARSET),
12 fWordX(0.0f), 13 fWordX(0.0f),
13 fWordY(0.0f), 14 fWordY(0.0f),
14 fWordTail(0.0f), 15 fWordTail(0.0f),
15 nFontIndex(-1) {} 16 nFontIndex(-1) {}
16 17
17 CPVT_WordInfo::CPVT_WordInfo(uint16_t word, 18 CPVT_WordInfo::CPVT_WordInfo(uint16_t word,
(...skipping 23 matching lines...) Expand all
41 if (this == &word) 42 if (this == &word)
42 return; 43 return;
43 44
44 Word = word.Word; 45 Word = word.Word;
45 nCharset = word.nCharset; 46 nCharset = word.nCharset;
46 nFontIndex = word.nFontIndex; 47 nFontIndex = word.nFontIndex;
47 fWordX = word.fWordX; 48 fWordX = word.fWordX;
48 fWordY = word.fWordY; 49 fWordY = word.fWordY;
49 fWordTail = word.fWordTail; 50 fWordTail = word.fWordTail;
50 if (word.pWordProps) 51 if (word.pWordProps)
51 pWordProps.reset(new CPVT_WordProps(*word.pWordProps)); 52 pWordProps = pdfium::MakeUnique<CPVT_WordProps>(*word.pWordProps);
52 else 53 else
53 pWordProps.reset(); 54 pWordProps.reset();
54 } 55 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/cpvt_sectioninfo.cpp ('k') | core/fxcodec/codec/fx_codec_jbig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698