Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: core/fpdfdoc/cpvt_generateap.cpp

Issue 2347993002: Clean up CPDF_Stream. (Closed)
Patch Set: ctor Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/fpdfdoc/cpvt_generateap.cpp
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index d37aaf3acbc514d5723b809766a1992363a960a3..1e531799e86d6174cc2758667d917adfa6e06771 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -166,7 +166,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
}
CPDF_Stream* pNormalStream = pAPDict->GetStreamFor("N");
if (!pNormalStream) {
- pNormalStream = new CPDF_Stream(nullptr, 0, nullptr);
+ pNormalStream = new CPDF_Stream;
int32_t objnum = pDoc->AddIndirectObject(pNormalStream);
pAnnotDict->GetDictFor("AP")->SetReferenceFor("N", pDoc, objnum);
}
@@ -418,8 +418,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
} break;
}
if (pNormalStream) {
- pNormalStream->SetData(sAppStream.GetBuffer(), sAppStream.GetSize(), FALSE,
- FALSE);
+ pNormalStream->SetData(sAppStream.GetBuffer(), sAppStream.GetSize());
pStreamDict = pNormalStream->GetDict();
if (pStreamDict) {
pStreamDict->SetMatrixFor("Matrix", matrix);
@@ -591,12 +590,10 @@ void GenerateAndSetAPDict(CPDF_Document* pDoc,
CPDF_Dictionary* pAPDict = new CPDF_Dictionary;
pAnnotDict->SetFor("AP", pAPDict);
- CPDF_Stream* pNormalStream = new CPDF_Stream(nullptr, 0, nullptr);
+ CPDF_Stream* pNormalStream = new CPDF_Stream;
int32_t objnum = pDoc->AddIndirectObject(pNormalStream);
pAnnotDict->GetDictFor("AP")->SetReferenceFor("N", pDoc, objnum);
-
- pNormalStream->SetData(sAppStream.GetBuffer(), sAppStream.GetSize(), FALSE,
- FALSE);
+ pNormalStream->SetData(sAppStream.GetBuffer(), sAppStream.GetSize());
CPDF_Dictionary* pStreamDict = pNormalStream->GetDict();
pStreamDict->SetIntegerFor("FormType", 1);
@@ -607,7 +604,6 @@ void GenerateAndSetAPDict(CPDF_Document* pDoc,
? CPDF_Annot::RectFromQuadPoints(pAnnotDict)
: pAnnotDict->GetRectFor("Rect");
pStreamDict->SetRectFor("BBox", rect);
-
pStreamDict->SetFor("Resources", pResourceDict);
}

Powered by Google App Engine
This is Rietveld 408576698