summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cfdf_document.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-07 13:49:17 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-07 13:49:17 -0800
commit5ab31ef3ed4c86211f1ebb3686abb4f5a66472ec (patch)
tree87c1fda94151528b7fcfa3a18cfda87a78cd3b4f /core/fpdfapi/parser/cfdf_document.cpp
parentc09625ca59701fabeb49dc59edcf33031b2c6672 (diff)
downloadpdfium-5ab31ef3ed4c86211f1ebb3686abb4f5a66472ec.tar.xz
Use unique_ptr return from CPDF_Parser::ParseIndirectObject()
In turn, propgate to callers. This introduces a few release() calls that will go away as more code is converted. It also removes a couple of WrapUnique calls that are no longer needed as ownership of the object flows along. Review-Url: https://codereview.chromium.org/2479303002
Diffstat (limited to 'core/fpdfapi/parser/cfdf_document.cpp')
-rw-r--r--core/fpdfapi/parser/cfdf_document.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp
index a0f3e1490d..f54e598506 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -69,8 +69,8 @@ void CFDF_Document::ParseStream(IFX_SeekableReadStream* pFile, bool bOwnFile) {
if (word != "obj")
break;
- auto pObj = pdfium::WrapUnique<CPDF_Object>(
- parser.GetObject(this, objnum, 0, true));
+ std::unique_ptr<CPDF_Object> pObj =
+ parser.GetObject(this, objnum, 0, true);
if (!pObj)
break;
@@ -82,11 +82,11 @@ void CFDF_Document::ParseStream(IFX_SeekableReadStream* pFile, bool bOwnFile) {
if (word != "trailer")
break;
- if (CPDF_Dictionary* pMainDict =
- ToDictionary(parser.GetObject(this, 0, 0, true))) {
+ std::unique_ptr<CPDF_Dictionary> pMainDict =
+ ToDictionary(parser.GetObject(this, 0, 0, true));
+ if (pMainDict)
m_pRootDict = pMainDict->GetDictFor("Root");
- delete pMainDict;
- }
+
break;
}
}