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