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.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/core/fpdfapi/page/cpdf_contentmark.cpp b/core/fpdfapi/page/cpdf_contentmark.cpp
index 6021dc893d..912cc0ea03 100644
--- a/core/fpdfapi/page/cpdf_contentmark.cpp
+++ b/core/fpdfapi/page/cpdf_contentmark.cpp
@@ -29,7 +29,12 @@ size_t CPDF_ContentMark::CountItems() const {
return m_pMarkData->CountItems();
}
-const CPDF_ContentMarkItem& CPDF_ContentMark::GetItem(size_t i) const {
+CPDF_ContentMarkItem* CPDF_ContentMark::GetItem(size_t i) {
+ ASSERT(i < CountItems());
+ return m_pMarkData->GetItem(i);
+}
+
+const CPDF_ContentMarkItem* CPDF_ContentMark::GetItem(size_t i) const {
ASSERT(i < CountItems());
return m_pMarkData->GetItem(i);
}
@@ -42,7 +47,7 @@ int CPDF_ContentMark::GetMarkedContentID() const {
}
void CPDF_ContentMark::AddMark(ByteString name,
- const CPDF_Dictionary* pDict,
+ CPDF_Dictionary* pDict,
bool bDirect) {
if (!m_pMarkData)
m_pMarkData.Reset(new MarkData());
@@ -70,9 +75,13 @@ size_t CPDF_ContentMark::MarkData::CountItems() const {
return m_Marks.size();
}
-const CPDF_ContentMarkItem& CPDF_ContentMark::MarkData::GetItem(
+CPDF_ContentMarkItem* CPDF_ContentMark::MarkData::GetItem(size_t index) {
+ return m_Marks[index].Get();
+}
+
+const CPDF_ContentMarkItem* CPDF_ContentMark::MarkData::GetItem(
size_t index) const {
- return *m_Marks[index];
+ return m_Marks[index].Get();
}
int CPDF_ContentMark::MarkData::GetMarkedContentID() const {
@@ -85,7 +94,7 @@ int CPDF_ContentMark::MarkData::GetMarkedContentID() const {
}
void CPDF_ContentMark::MarkData::AddMark(ByteString name,
- const CPDF_Dictionary* pDict,
+ CPDF_Dictionary* pDict,
bool bDirect) {
auto pItem = pdfium::MakeRetain<CPDF_ContentMarkItem>();
pItem->SetName(std::move(name));