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

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

Issue 2136683002: Use smart pointers for class owned member variables (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 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/fpdfdoc/cpvt_wordinfo.h ('k') | core/fpdfdoc/doc_annot.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "core/fpdfdoc/cpvt_wordinfo.h"
8
9 CPVT_WordInfo::CPVT_WordInfo()
10 : Word(0),
11 nCharset(FXFONT_ANSI_CHARSET),
12 fWordX(0.0f),
13 fWordY(0.0f),
14 fWordTail(0.0f),
15 nFontIndex(-1) {}
16
17 CPVT_WordInfo::CPVT_WordInfo(uint16_t word,
18 int32_t charset,
19 int32_t fontIndex,
20 CPVT_WordProps* pProps)
21 : Word(word),
22 nCharset(charset),
23 fWordX(0.0f),
24 fWordY(0.0f),
25 fWordTail(0.0f),
26 nFontIndex(fontIndex) {}
27
28 CPVT_WordInfo::CPVT_WordInfo(const CPVT_WordInfo& word)
29 : Word(0),
30 nCharset(FXFONT_ANSI_CHARSET),
31 fWordX(0.0f),
32 fWordY(0.0f),
33 fWordTail(0.0f),
34 nFontIndex(-1) {
35 operator=(word);
36 }
37
38 CPVT_WordInfo::~CPVT_WordInfo() {}
39
40 void CPVT_WordInfo::operator=(const CPVT_WordInfo& word) {
41 if (this == &word)
42 return;
43
44 Word = word.Word;
45 nCharset = word.nCharset;
46 nFontIndex = word.nFontIndex;
47 fWordX = word.fWordX;
48 fWordY = word.fWordY;
49 fWordTail = word.fWordTail;
50 if (word.pWordProps)
51 pWordProps.reset(new CPVT_WordProps(*word.pWordProps));
52 else
53 pWordProps.reset();
54 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/cpvt_wordinfo.h ('k') | core/fpdfdoc/doc_annot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698