diff options
author | tsepez <tsepez@chromium.org> | 2016-12-14 11:30:46 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-14 11:30:47 -0800 |
commit | 0d73909e89a5c93917b9cb73fe5c03c484f2793d (patch) | |
tree | 6b3dc490bed3fb2e62bb0bc6c09bcf9fb28f0dfc /core/fxcodec/jbig2/JBig2_SddProc.cpp | |
parent | 603f57b85c0643f0598f03b97c4525501f3e1221 (diff) | |
download | pdfium-0d73909e89a5c93917b9cb73fe5c03c484f2793d.tar.xz |
Remove CJBig2_List in favor of std::vector<std::unique_ptr<>>
Review-Url: https://codereview.chromium.org/2578663002
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_SddProc.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_SddProc.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/fxcodec/jbig2/JBig2_SddProc.cpp b/core/fxcodec/jbig2/JBig2_SddProc.cpp index d27ff680d5..5f23fcf4e1 100644 --- a/core/fxcodec/jbig2/JBig2_SddProc.cpp +++ b/core/fxcodec/jbig2/JBig2_SddProc.cpp @@ -264,9 +264,11 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith( for (I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) { if (EXFLAGS[I] && J < SDNUMEXSYMS) { if (I < SDNUMINSYMS) { - pDict->AddImage(SDINSYMS[I] ? new CJBig2_Image(*SDINSYMS[I]) : nullptr); + pDict->AddImage(SDINSYMS[I] + ? pdfium::MakeUnique<CJBig2_Image>(*SDINSYMS[I]) + : nullptr); } else { - pDict->AddImage(SDNEWSYMS[I - SDNUMINSYMS]); + pDict->AddImage(pdfium::WrapUnique(SDNEWSYMS[I - SDNUMINSYMS])); } ++J; } else if (!EXFLAGS[I] && I >= SDNUMINSYMS) { @@ -596,9 +598,11 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Huffman( for (I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) { if (EXFLAGS[I] && J < SDNUMEXSYMS) { if (I < SDNUMINSYMS) { - pDict->AddImage(SDINSYMS[I] ? new CJBig2_Image(*SDINSYMS[I]) : nullptr); + pDict->AddImage(SDINSYMS[I] + ? pdfium::MakeUnique<CJBig2_Image>(*SDINSYMS[I]) + : nullptr); } else { - pDict->AddImage(SDNEWSYMS[I - SDNUMINSYMS]); + pDict->AddImage(pdfium::WrapUnique(SDNEWSYMS[I - SDNUMINSYMS])); } ++J; } else if (!EXFLAGS[I] && I >= SDNUMINSYMS) { |