diff options
Diffstat (limited to 'core/fpdfapi/page/cpdf_contentmark.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_contentmark.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/fpdfapi/page/cpdf_contentmark.cpp b/core/fpdfapi/page/cpdf_contentmark.cpp index 0b17c2bc35..6021dc893d 100644 --- a/core/fpdfapi/page/cpdf_contentmark.cpp +++ b/core/fpdfapi/page/cpdf_contentmark.cpp @@ -72,12 +72,12 @@ size_t CPDF_ContentMark::MarkData::CountItems() const { const CPDF_ContentMarkItem& CPDF_ContentMark::MarkData::GetItem( size_t index) const { - return m_Marks[index]; + return *m_Marks[index]; } int CPDF_ContentMark::MarkData::GetMarkedContentID() const { - for (const auto& mark : m_Marks) { - const CPDF_Dictionary* pDict = mark.GetParam(); + for (const auto pMark : m_Marks) { + const CPDF_Dictionary* pDict = pMark->GetParam(); if (pDict && pDict->KeyExist("MCID")) return pDict->GetIntegerFor("MCID"); } @@ -87,15 +87,15 @@ int CPDF_ContentMark::MarkData::GetMarkedContentID() const { void CPDF_ContentMark::MarkData::AddMark(ByteString name, const CPDF_Dictionary* pDict, bool bDirect) { - CPDF_ContentMarkItem item; - item.SetName(std::move(name)); + auto pItem = pdfium::MakeRetain<CPDF_ContentMarkItem>(); + pItem->SetName(std::move(name)); if (pDict) { if (bDirect) - item.SetDirectDict(ToDictionary(pDict->Clone())); + pItem->SetDirectDict(ToDictionary(pDict->Clone())); else - item.SetPropertiesDict(pDict); + pItem->SetPropertiesDict(pDict); } - m_Marks.push_back(std::move(item)); + m_Marks.push_back(pItem); } void CPDF_ContentMark::MarkData::DeleteLastMark() { |