summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_contentmark.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-11-22 20:04:13 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-22 20:04:13 +0000
commite6dba0dcc2c399e92b2ed7029a5241726f38938f (patch)
tree995af506b01db9595c2a3ac3bd1a4cf1d914ab77 /core/fpdfapi/page/cpdf_contentmark.cpp
parentfe2cd4d914205f2da91286e7270209e2016d51a1 (diff)
downloadpdfium-e6dba0dcc2c399e92b2ed7029a5241726f38938f.tar.xz
Remove dead CPDF_ContentMark code.
Change-Id: Ic552a652856ca231f3d2077c76a20d5916adb3c1 Reviewed-on: https://pdfium-review.googlesource.com/19170 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_contentmark.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_contentmark.cpp59
1 files changed, 3 insertions, 56 deletions
diff --git a/core/fpdfapi/page/cpdf_contentmark.cpp b/core/fpdfapi/page/cpdf_contentmark.cpp
index cf8e37ec75..b28d4eaada 100644
--- a/core/fpdfapi/page/cpdf_contentmark.cpp
+++ b/core/fpdfapi/page/cpdf_contentmark.cpp
@@ -6,7 +6,6 @@
#include "core/fpdfapi/page/cpdf_contentmark.h"
-#include <memory>
#include <utility>
#include "core/fpdfapi/parser/cpdf_dictionary.h"
@@ -19,10 +18,6 @@ CPDF_ContentMark::CPDF_ContentMark(const CPDF_ContentMark& that)
CPDF_ContentMark::~CPDF_ContentMark() {}
-void CPDF_ContentMark::SetNull() {
- m_Ref.SetNull();
-}
-
int CPDF_ContentMark::CountItems() const {
return m_Ref.GetObject()->CountItems();
}
@@ -31,11 +26,6 @@ const CPDF_ContentMarkItem& CPDF_ContentMark::GetItem(int i) const {
return m_Ref.GetObject()->GetItem(i);
}
-int CPDF_ContentMark::GetMCID() const {
- const MarkData* pData = m_Ref.GetObject();
- return pData ? pData->GetMCID() : -1;
-}
-
void CPDF_ContentMark::AddMark(const ByteString& name,
CPDF_Dictionary* pDict,
bool bDirect) {
@@ -48,34 +38,6 @@ void CPDF_ContentMark::DeleteLastMark() {
m_Ref.SetNull();
}
-bool CPDF_ContentMark::HasMark(const ByteStringView& mark) const {
- const MarkData* pData = m_Ref.GetObject();
- if (!pData)
- return false;
-
- for (int i = 0; i < pData->CountItems(); i++) {
- if (pData->GetItem(i).GetName() == mark)
- return true;
- }
- return false;
-}
-
-bool CPDF_ContentMark::LookupMark(const ByteStringView& mark,
- CPDF_Dictionary** pDict) const {
- const MarkData* pData = m_Ref.GetObject();
- if (!pData)
- return false;
-
- for (int i = 0; i < pData->CountItems(); i++) {
- const CPDF_ContentMarkItem& item = pData->GetItem(i);
- if (item.GetName() == mark) {
- *pDict = item.GetParam();
- return true;
- }
- }
- return false;
-}
-
CPDF_ContentMark::MarkData::MarkData() {}
CPDF_ContentMark::MarkData::MarkData(const MarkData& src)
@@ -87,36 +49,21 @@ int CPDF_ContentMark::MarkData::CountItems() const {
return pdfium::CollectionSize<int>(m_Marks);
}
-CPDF_ContentMarkItem& CPDF_ContentMark::MarkData::GetItem(int index) {
- return m_Marks[index];
-}
-
const CPDF_ContentMarkItem& CPDF_ContentMark::MarkData::GetItem(
int index) const {
return m_Marks[index];
}
-int CPDF_ContentMark::MarkData::GetMCID() const {
- for (const auto& mark : m_Marks) {
- CPDF_Dictionary* pDict = mark.GetParam();
- if (pDict && pDict->KeyExist("MCID"))
- return pDict->GetIntegerFor("MCID");
- }
- return -1;
-}
-
void CPDF_ContentMark::MarkData::AddMark(const ByteString& name,
CPDF_Dictionary* pDict,
bool bDirect) {
CPDF_ContentMarkItem item;
item.SetName(name);
if (pDict) {
- if (bDirect) {
- item.SetDirectDict(
- std::unique_ptr<CPDF_Dictionary>(ToDictionary(pDict->Clone())));
- } else {
+ if (bDirect)
+ item.SetDirectDict(ToDictionary(pDict->Clone()));
+ else
item.SetPropertiesDict(pDict);
- }
}
m_Marks.push_back(std::move(item));
}