diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2018-06-11 18:19:57 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-11 18:19:57 +0000 |
commit | fb72726e51bfd0c7bfc61c9b354e2b60f46adac5 (patch) | |
tree | b2a763c74a07b081a4b176c18c42569e377d6fc8 /core/fpdfapi/parser/cpdf_object.cpp | |
parent | 5e873f5ce8e407c97e966b9708d2560e908112d3 (diff) | |
download | pdfium-fb72726e51bfd0c7bfc61c9b354e2b60f46adac5.tar.xz |
Implement CPDF_Object::MakeReference method.chromium/3456
Change-Id: I153747ef587a184eaef58ff09dbf8f214c9ddfb3
Reviewed-on: https://pdfium-review.googlesource.com/17230
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_object.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_object.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/cpdf_object.cpp b/core/fpdfapi/parser/cpdf_object.cpp index 8190d3429f..6fedd25242 100644 --- a/core/fpdfapi/parser/cpdf_object.cpp +++ b/core/fpdfapi/parser/cpdf_object.cpp @@ -12,6 +12,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_indirect_object_holder.h" #include "core/fpdfapi/parser/cpdf_parser.h" +#include "core/fpdfapi/parser/cpdf_reference.h" #include "core/fpdfapi/parser/fpdf_parser_decode.h" #include "core/fxcrt/fx_string.h" #include "third_party/base/logging.h" @@ -170,3 +171,12 @@ CPDF_String* CPDF_Object::AsString() { const CPDF_String* CPDF_Object::AsString() const { return nullptr; } + +std::unique_ptr<CPDF_Object> CPDF_Object::MakeReference( + CPDF_IndirectObjectHolder* holder) const { + if (IsInline()) { + NOTREACHED(); + return nullptr; + } + return pdfium::MakeUnique<CPDF_Reference>(holder, GetObjNum()); +} |