| 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_generateap.h" | 7 #include "core/fpdfdoc/cpvt_generateap.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
| 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" |
| 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" |
| 14 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" | 14 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" |
| 15 #include "core/fpdfdoc/cpvt_color.h" | 15 #include "core/fpdfdoc/cpvt_color.h" |
| 16 #include "core/fpdfdoc/cpvt_fontmap.h" | 16 #include "core/fpdfdoc/cpvt_fontmap.h" |
| 17 #include "core/fpdfdoc/include/cpdf_formfield.h" | 17 #include "core/fpdfdoc/include/cpdf_formfield.h" |
| 18 #include "core/fpdfdoc/include/cpvt_word.h" | 18 #include "core/fpdfdoc/include/cpvt_word.h" |
| 19 #include "core/fpdfdoc/pdf_vt.h" | |
| 20 | 19 |
| 21 namespace { | 20 namespace { |
| 22 | 21 |
| 23 bool GenerateWidgetAP(CPDF_Document* pDoc, | 22 bool GenerateWidgetAP(CPDF_Document* pDoc, |
| 24 CPDF_Dictionary* pAnnotDict, | 23 CPDF_Dictionary* pAnnotDict, |
| 25 const int32_t& nWidgetType) { | 24 const int32_t& nWidgetType) { |
| 26 CPDF_Dictionary* pFormDict = nullptr; | 25 CPDF_Dictionary* pFormDict = nullptr; |
| 27 if (CPDF_Dictionary* pRootDict = pDoc->GetRoot()) | 26 if (CPDF_Dictionary* pRootDict = pDoc->GetRoot()) |
| 28 pFormDict = pRootDict->GetDictBy("AcroForm"); | 27 pFormDict = pRootDict->GetDictBy("AcroForm"); |
| 29 if (!pFormDict) | 28 if (!pFormDict) |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 int32_t nFontIndex, | 813 int32_t nFontIndex, |
| 815 FX_FLOAT fFontSize) { | 814 FX_FLOAT fFontSize) { |
| 816 CFX_ByteTextBuf sRet; | 815 CFX_ByteTextBuf sRet; |
| 817 if (pFontMap) { | 816 if (pFontMap) { |
| 818 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); | 817 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); |
| 819 if (sFontAlias.GetLength() > 0 && fFontSize > 0) | 818 if (sFontAlias.GetLength() > 0 && fFontSize > 0) |
| 820 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; | 819 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; |
| 821 } | 820 } |
| 822 return sRet.MakeString(); | 821 return sRet.MakeString(); |
| 823 } | 822 } |
| OLD | NEW |