diff options
author | Lei Zhang <thestig@chromium.org> | 2015-11-10 10:28:56 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-11-10 10:28:56 -0800 |
commit | 61aad4fbb6fb1081a40b2e144106f57cf443846c (patch) | |
tree | b15ec4b3f7af763a7cf55d19a8b9a409afc6d479 /core/src/fpdfdoc/doc_ap.cpp | |
parent | 5044cab9c228ecd39e0ba07f0f5cced0a1cf6dd4 (diff) | |
download | pdfium-61aad4fbb6fb1081a40b2e144106f57cf443846c.tar.xz |
Merge to XFA: Cleanup CPDF_Stream:
- Remove CPDF_Stream::Create() and checks that it might fail.
- Remove m_pCryptoHandler that's always a nullptr.
- Remove m_FileOffset that's always 0.
- Rename file version of InitStream() to InitStreamFromFile().
- Use IsMemoryBased() in more places.
TBR=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1415163009 .
(cherry picked from commit e6e16954f0cdc324849fca9da883be8f131b3834)
Review URL: https://codereview.chromium.org/1418493006 .
Diffstat (limited to 'core/src/fpdfdoc/doc_ap.cpp')
-rw-r--r-- | core/src/fpdfdoc/doc_ap.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp index d6c25f31e3..7fc9407c73 100644 --- a/core/src/fpdfdoc/doc_ap.cpp +++ b/core/src/fpdfdoc/doc_ap.cpp @@ -427,11 +427,8 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, pAnnotDict->SetAt("AP", pAPDict); } CPDF_Stream* pNormalStream = pAPDict->GetStream("N"); - if (pNormalStream == NULL) { - pNormalStream = CPDF_Stream::Create(NULL, 0, NULL); - if (pNormalStream == NULL) { - return FALSE; - } + if (!pNormalStream) { + pNormalStream = new CPDF_Stream(nullptr, 0, nullptr); int32_t objnum = pDoc->AddIndirectObject(pNormalStream); pAnnotDict->GetDict("AP")->SetAtReference("N", pDoc, objnum); } |