summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_contentmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page/cpdf_contentmark.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_contentmark.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_contentmark.cpp b/core/fpdfapi/page/cpdf_contentmark.cpp
index 1ff567d9e6..4932ee6231 100644
--- a/core/fpdfapi/page/cpdf_contentmark.cpp
+++ b/core/fpdfapi/page/cpdf_contentmark.cpp
@@ -30,6 +30,13 @@ size_t CPDF_ContentMark::CountItems() const {
return m_pMarkData->CountItems();
}
+bool CPDF_ContentMark::ContainsItem(const CPDF_ContentMarkItem* pItem) const {
+ if (!m_pMarkData)
+ return false;
+
+ return m_pMarkData->ContainsItem(pItem);
+}
+
CPDF_ContentMarkItem* CPDF_ContentMark::GetItem(size_t i) {
ASSERT(i < CountItems());
return m_pMarkData->GetItem(i);
@@ -105,6 +112,15 @@ size_t CPDF_ContentMark::MarkData::CountItems() const {
return m_Marks.size();
}
+bool CPDF_ContentMark::MarkData::ContainsItem(
+ const CPDF_ContentMarkItem* pItem) const {
+ for (const auto pMark : m_Marks) {
+ if (pMark.Get() == pItem)
+ return true;
+ }
+ return false;
+}
+
CPDF_ContentMarkItem* CPDF_ContentMark::MarkData::GetItem(size_t index) {
return m_Marks[index].Get();
}