Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2536)

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_reference.cpp

Issue 2392603004: Move core/fpdfapi/fpdf_parser to core/fpdfapi/parser (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_reference.h ('k') | core/fpdfapi/fpdf_parser/cpdf_security_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_reference.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_reference.cpp b/core/fpdfapi/fpdf_parser/cpdf_reference.cpp
deleted file mode 100644
index 4f826dc86c137cd6f931ef37380b5df6a1acf68e..0000000000000000000000000000000000000000
--- a/core/fpdfapi/fpdf_parser/cpdf_reference.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2016 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_parser/cpdf_reference.h"
-
-#include "core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.h"
-#include "third_party/base/stl_util.h"
-
-CPDF_Reference::CPDF_Reference(CPDF_IndirectObjectHolder* pDoc, int objnum)
- : m_pObjList(pDoc), m_RefObjNum(objnum) {}
-
-CPDF_Reference::~CPDF_Reference() {}
-
-CPDF_Object::Type CPDF_Reference::GetType() const {
- return REFERENCE;
-}
-
-CFX_ByteString CPDF_Reference::GetString() const {
- CPDF_Object* obj = SafeGetDirect();
- return obj ? obj->GetString() : CFX_ByteString();
-}
-
-FX_FLOAT CPDF_Reference::GetNumber() const {
- CPDF_Object* obj = SafeGetDirect();
- return obj ? obj->GetNumber() : 0;
-}
-
-int CPDF_Reference::GetInteger() const {
- CPDF_Object* obj = SafeGetDirect();
- return obj ? obj->GetInteger() : 0;
-}
-
-CPDF_Dictionary* CPDF_Reference::GetDict() const {
- CPDF_Object* obj = SafeGetDirect();
- return obj ? obj->GetDict() : nullptr;
-}
-
-bool CPDF_Reference::IsReference() const {
- return true;
-}
-
-CPDF_Reference* CPDF_Reference::AsReference() {
- return this;
-}
-
-const CPDF_Reference* CPDF_Reference::AsReference() const {
- return this;
-}
-
-CPDF_Object* CPDF_Reference::Clone() const {
- return CloneObjectNonCyclic(false);
-}
-
-CPDF_Object* CPDF_Reference::CloneNonCyclic(
- bool bDirect,
- std::set<const CPDF_Object*>* pVisited) const {
- pVisited->insert(this);
- if (bDirect) {
- auto* pDirect = GetDirect();
- return pDirect && !pdfium::ContainsKey(*pVisited, pDirect)
- ? pDirect->CloneNonCyclic(true, pVisited)
- : nullptr;
- }
- return new CPDF_Reference(m_pObjList, m_RefObjNum);
-}
-
-CPDF_Object* CPDF_Reference::SafeGetDirect() const {
- CPDF_Object* obj = GetDirect();
- return (obj && !obj->IsReference()) ? obj : nullptr;
-}
-
-void CPDF_Reference::SetRef(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum) {
- m_pObjList = pDoc;
- m_RefObjNum = objnum;
-}
-
-CPDF_Object* CPDF_Reference::GetDirect() const {
- return m_pObjList ? m_pObjList->GetOrParseIndirectObject(m_RefObjNum)
- : nullptr;
-}
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_reference.h ('k') | core/fpdfapi/fpdf_parser/cpdf_security_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698