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/fpdfapi/fpdf_page/include/cpdf_textstatedata.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_textstatedata.h" |
8 | 8 |
| 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
9 #include "core/fpdfapi/fpdf_page/pageint.h" | 10 #include "core/fpdfapi/fpdf_page/pageint.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
11 #include "core/include/fpdfapi/fpdf_resource.h" | |
12 | 12 |
13 CPDF_TextStateData::CPDF_TextStateData() | 13 CPDF_TextStateData::CPDF_TextStateData() |
14 : m_pFont(nullptr), | 14 : m_pFont(nullptr), |
15 m_pDocument(nullptr), | 15 m_pDocument(nullptr), |
16 m_FontSize(1.0f), | 16 m_FontSize(1.0f), |
17 m_CharSpace(0), | 17 m_CharSpace(0), |
18 m_WordSpace(0), | 18 m_WordSpace(0), |
19 m_TextMode(0) { | 19 m_TextMode(0) { |
20 m_Matrix[0] = m_Matrix[3] = 1.0f; | 20 m_Matrix[0] = m_Matrix[3] = 1.0f; |
21 m_Matrix[1] = m_Matrix[2] = 0; | 21 m_Matrix[1] = m_Matrix[2] = 0; |
(...skipping 12 matching lines...) Expand all Loading... |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 CPDF_TextStateData::~CPDF_TextStateData() { | 37 CPDF_TextStateData::~CPDF_TextStateData() { |
38 if (m_pDocument && m_pFont) { | 38 if (m_pDocument && m_pFont) { |
39 CPDF_DocPageData* pPageData = m_pDocument->GetPageData(); | 39 CPDF_DocPageData* pPageData = m_pDocument->GetPageData(); |
40 if (pPageData && !pPageData->IsForceClear()) | 40 if (pPageData && !pPageData->IsForceClear()) |
41 pPageData->ReleaseFont(m_pFont->GetFontDict()); | 41 pPageData->ReleaseFont(m_pFont->GetFontDict()); |
42 } | 42 } |
43 } | 43 } |
OLD | NEW |