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 #include "core/fxcrt/fx_codepage.h"
10
CPVT_WordInfo()11 CPVT_WordInfo::CPVT_WordInfo()
12 : Word(0),
13 nCharset(FX_CHARSET_ANSI),
14 fWordX(0.0f),
15 fWordY(0.0f),
16 fWordTail(0.0f),
17 nFontIndex(-1) {}
18
CPVT_WordInfo(uint16_t word,int32_t charset,int32_t fontIndex)19 CPVT_WordInfo::CPVT_WordInfo(uint16_t word, int32_t charset, int32_t fontIndex)
20 : Word(word),
21 nCharset(charset),
22 fWordX(0.0f),
23 fWordY(0.0f),
24 fWordTail(0.0f),
25 nFontIndex(fontIndex) {}
26
CPVT_WordInfo(const CPVT_WordInfo & word)27 CPVT_WordInfo::CPVT_WordInfo(const CPVT_WordInfo& word)
28 : Word(0),
29 nCharset(FX_CHARSET_ANSI),
30 fWordX(0.0f),
31 fWordY(0.0f),
32 fWordTail(0.0f),
33 nFontIndex(-1) {
34 operator=(word);
35 }
36
~CPVT_WordInfo()37 CPVT_WordInfo::~CPVT_WordInfo() {}
38
operator =(const CPVT_WordInfo & word)39 CPVT_WordInfo& CPVT_WordInfo::operator=(const CPVT_WordInfo& word) {
40 if (this == &word)
41 return *this;
42
43 Word = word.Word;
44 nCharset = word.nCharset;
45 nFontIndex = word.nFontIndex;
46 fWordX = word.fWordX;
47 fWordY = word.fWordY;
48 fWordTail = word.fWordTail;
49 return *this;
50 }
51