diff options
Diffstat (limited to 'core/fpdfapi/page/cpdf_contentmark.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_contentmark.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_contentmark.cpp b/core/fpdfapi/page/cpdf_contentmark.cpp index 4932ee6231..615d31f3eb 100644 --- a/core/fpdfapi/page/cpdf_contentmark.cpp +++ b/core/fpdfapi/page/cpdf_contentmark.cpp @@ -73,6 +73,10 @@ void CPDF_ContentMark::AddMarkWithPropertiesDict( m_pMarkData->AddMarkWithPropertiesDict(std::move(name), pDict, property_name); } +bool CPDF_ContentMark::RemoveMark(CPDF_ContentMarkItem* pMarkItem) { + return m_pMarkData && m_pMarkData->RemoveMark(pMarkItem); +} + void CPDF_ContentMark::EnsureMarkDataExists() { if (!m_pMarkData) m_pMarkData = pdfium::MakeRetain<MarkData>(); @@ -160,6 +164,16 @@ void CPDF_ContentMark::MarkData::AddMarkWithPropertiesDict( m_Marks.push_back(pItem); } +bool CPDF_ContentMark::MarkData::RemoveMark(CPDF_ContentMarkItem* pMarkItem) { + for (auto it = m_Marks.begin(); it != m_Marks.end(); ++it) { + if (it->Get() == pMarkItem) { + m_Marks.erase(it); + return true; + } + } + return false; +} + void CPDF_ContentMark::MarkData::DeleteLastMark() { if (!m_Marks.empty()) m_Marks.pop_back(); |