summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/doc_ap.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-05 12:01:42 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-05 12:01:42 -0700
commitc7a7349cf316af37d4ad4b71c5742159deccbf33 (patch)
tree5006913b93a6d498e3df158bc644400e3a1a0c7c /core/fpdfdoc/doc_ap.cpp
parent179bebb9a14dfd3ba91e9e068d4d436657a7c780 (diff)
downloadpdfium-c7a7349cf316af37d4ad4b71c5742159deccbf33.tar.xz
Remove core/include/fpdfdoc/fpdf_vt.h
This CL removes the core/include/fpdfdoc/fpdf_vt.h file. The IPDF_VariableText class was removed in favour of the only concrete class of CPD_VariableText. CPVT_Provider was moved to CPDF_VariableText::Provider and CPDF_VariableText_Iterator was moved to CPDF_VariableText::Iterator. The IFX_Edit_FontMap interface was merged into the IPVT_FontMap interface so there is only one. Other classes were split out as needed in order to keep things compiling. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1860063002
Diffstat (limited to 'core/fpdfdoc/doc_ap.cpp')
-rw-r--r--core/fpdfdoc/doc_ap.cpp70
1 files changed, 0 insertions, 70 deletions
diff --git a/core/fpdfdoc/doc_ap.cpp b/core/fpdfdoc/doc_ap.cpp
deleted file mode 100644
index 440979e229..0000000000
--- a/core/fpdfdoc/doc_ap.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
-#include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
-#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
-#include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h"
-#include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h"
-#include "core/fpdfdoc/cpvt_provider.h"
-#include "core/fpdfdoc/doc_utils.h"
-#include "core/fpdfdoc/pdf_vt.h"
-#include "core/include/fpdfdoc/fpdf_doc.h"
-#include "core/include/fpdfdoc/fpdf_vt.h"
-
-CPVT_Provider::CPVT_Provider(IPVT_FontMap* pFontMap) : m_pFontMap(pFontMap) {
- ASSERT(m_pFontMap);
-}
-CPVT_Provider::~CPVT_Provider() {}
-int32_t CPVT_Provider::GetCharWidth(int32_t nFontIndex,
- uint16_t word,
- int32_t nWordStyle) {
- if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
- uint32_t charcode = pPDFFont->CharCodeFromUnicode(word);
- if (charcode != CPDF_Font::kInvalidCharCode) {
- return pPDFFont->GetCharWidthF(charcode);
- }
- }
- return 0;
-}
-int32_t CPVT_Provider::GetTypeAscent(int32_t nFontIndex) {
- if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
- return pPDFFont->GetTypeAscent();
- }
- return 0;
-}
-int32_t CPVT_Provider::GetTypeDescent(int32_t nFontIndex) {
- if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
- return pPDFFont->GetTypeDescent();
- }
- return 0;
-}
-int32_t CPVT_Provider::GetWordFontIndex(uint16_t word,
- int32_t charset,
- int32_t nFontIndex) {
- if (CPDF_Font* pDefFont = m_pFontMap->GetPDFFont(0)) {
- if (pDefFont->CharCodeFromUnicode(word) != CPDF_Font::kInvalidCharCode) {
- return 0;
- }
- }
- if (CPDF_Font* pSysFont = m_pFontMap->GetPDFFont(1)) {
- if (pSysFont->CharCodeFromUnicode(word) != CPDF_Font::kInvalidCharCode) {
- return 1;
- }
- }
- return -1;
-}
-FX_BOOL CPVT_Provider::IsLatinWord(uint16_t word) {
- if ((word >= 0x61 && word <= 0x7A) || (word >= 0x41 && word <= 0x5A) ||
- word == 0x2D || word == 0x27) {
- return TRUE;
- }
- return FALSE;
-}
-int32_t CPVT_Provider::GetDefaultFontIndex() {
- return 0;
-}
-