summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-10-12 09:38:41 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-12 09:38:41 -0700
commit74b8c6ed314cfcc83aea13f028b4231db26e6ff8 (patch)
treee417f5d3ec4286aa9709354d9418f06eb1b8887b /core/fpdfapi/parser/cpdf_parser.cpp
parent47cbc06ef6f528e4d30a869ec533d010ee79b064 (diff)
downloadpdfium-74b8c6ed314cfcc83aea13f028b4231db26e6ff8.tar.xz
Get rid of CFX_ArrayTemplate<CPDF_Object*>
They won't work with std::unique_ptr down the road, so replace with std::vector. Review-Url: https://codereview.chromium.org/2411703003
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index f4cde0c198..c29ae18da2 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -72,9 +72,8 @@ CPDF_Parser::~CPDF_Parser() {
m_pSyntax->m_pFileAccess = nullptr;
}
- int32_t iLen = m_Trailers.GetSize();
- for (int32_t i = 0; i < iLen; ++i) {
- if (CPDF_Dictionary* trailer = m_Trailers.GetAt(i))
+ for (CPDF_Dictionary* trailer : m_Trailers) {
+ if (trailer)
trailer->Release();
}
@@ -368,7 +367,7 @@ FX_BOOL CPDF_Parser::LoadAllCrossRefV4(FX_FILESIZE xrefpos) {
// SLOW ...
XRefStreamList.insert(XRefStreamList.begin(),
pDict->GetIntegerFor("XRefStm"));
- m_Trailers.Add(pDict.release());
+ m_Trailers.push_back(pDict.release());
}
for (size_t i = 0; i < CrossRefList.size(); ++i) {
@@ -423,7 +422,7 @@ FX_BOOL CPDF_Parser::LoadLinearizedAllCrossRefV4(FX_FILESIZE xrefpos,
// SLOW ...
XRefStreamList.insert(XRefStreamList.begin(),
pDict->GetIntegerFor("XRefStm"));
- m_Trailers.Add(pDict.release());
+ m_Trailers.push_back(pDict.release());
}
for (size_t i = 1; i < CrossRefList.size(); ++i) {
@@ -992,7 +991,7 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE* pos, FX_BOOL bMainXRef) {
for (auto& it : m_ObjectInfo)
it.second.type = 0;
} else {
- m_Trailers.Add(pNewTrailer);
+ m_Trailers.push_back(pNewTrailer);
}
std::vector<std::pair<int32_t, int32_t>> arrIndex;