| OLD | NEW |
| 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_sectioninfo.h" | 7 #include "core/fpdfdoc/cpvt_sectioninfo.h" |
| 8 #include "third_party/base/ptr_util.h" |
| 8 | 9 |
| 9 CPVT_SectionInfo::CPVT_SectionInfo() : rcSection(), nTotalLine(0) {} | 10 CPVT_SectionInfo::CPVT_SectionInfo() : rcSection(), nTotalLine(0) {} |
| 10 | 11 |
| 11 CPVT_SectionInfo::~CPVT_SectionInfo() {} | 12 CPVT_SectionInfo::~CPVT_SectionInfo() {} |
| 12 | 13 |
| 13 CPVT_SectionInfo::CPVT_SectionInfo(const CPVT_SectionInfo& other) { | 14 CPVT_SectionInfo::CPVT_SectionInfo(const CPVT_SectionInfo& other) { |
| 14 operator=(other); | 15 operator=(other); |
| 15 } | 16 } |
| 16 | 17 |
| 17 void CPVT_SectionInfo::operator=(const CPVT_SectionInfo& other) { | 18 void CPVT_SectionInfo::operator=(const CPVT_SectionInfo& other) { |
| 18 if (this == &other) | 19 if (this == &other) |
| 19 return; | 20 return; |
| 20 | 21 |
| 21 rcSection = other.rcSection; | 22 rcSection = other.rcSection; |
| 22 nTotalLine = other.nTotalLine; | 23 nTotalLine = other.nTotalLine; |
| 23 if (other.pSecProps) | 24 if (other.pSecProps) |
| 24 pSecProps.reset(new CPVT_SecProps(*other.pSecProps)); | 25 pSecProps = pdfium::MakeUnique<CPVT_SecProps>(*other.pSecProps); |
| 25 else | 26 else |
| 26 pSecProps.reset(); | 27 pSecProps.reset(); |
| 28 |
| 27 if (other.pWordProps) | 29 if (other.pWordProps) |
| 28 pWordProps.reset(new CPVT_WordProps(*other.pWordProps)); | 30 pWordProps = pdfium::MakeUnique<CPVT_WordProps>(*other.pWordProps); |
| 29 else | 31 else |
| 30 pWordProps.reset(); | 32 pWordProps.reset(); |
| 31 } | 33 } |
| OLD | NEW |