Chromium Code Reviews| Index: fpdfsdk/fpdf_transformpage.cpp |
| diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp |
| index 5fe6e4ebccf99a46578f8bdfc560f6641903b367..3f48607ea4b4b8a4e8f1deaff730dcdaac290e7a 100644 |
| --- a/fpdfsdk/fpdf_transformpage.cpp |
| +++ b/fpdfsdk/fpdf_transformpage.cpp |
| @@ -138,7 +138,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, |
| pDoc->AddIndirectObject(pEndStream); |
| CPDF_Array* pContentArray = nullptr; |
| - if (CPDF_Array* pArray = ToArray(pContentObj)) { |
| + CPDF_Array* pArray = ToArray(pContentObj); |
| + if (pArray) { |
| pContentArray = pArray; |
| CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); |
| pContentArray->InsertAt(0, pRef); |
| @@ -146,7 +147,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, |
| } else if (CPDF_Reference* pReference = ToReference(pContentObj)) { |
| CPDF_Object* pDirectObj = pReference->GetDirect(); |
| if (pDirectObj) { |
| - if (CPDF_Array* pArray = pDirectObj->AsArray()) { |
| + pArray = pDirectObj->AsArray(); |
|
Tom Sepez
2016/06/01 22:49:21
nit: can we use a new variable name here for clari
Wei Li
2016/06/01 23:40:13
Done.
|
| + if (pArray) { |
| pContentArray = pArray; |
| CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); |
| pContentArray->InsertAt(0, pRef); |
| @@ -175,8 +177,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, |
| CPDF_Dictionary* pDict = nullptr; |
| if (pObj->IsDictionary()) |
| pDict = pObj->AsDictionary(); |
| - else if (CPDF_Stream* pStream = pObj->AsStream()) |
| - pDict = pStream->GetDict(); |
| + else if (CPDF_Stream* pObjStream = pObj->AsStream()) |
| + pDict = pObjStream->GetDict(); |
| else |
| continue; |
| @@ -307,14 +309,16 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page, |
| pDoc->AddIndirectObject(pStream); |
| CPDF_Array* pContentArray = nullptr; |
| - if (CPDF_Array* pArray = ToArray(pContentObj)) { |
| + CPDF_Array* pArray = ToArray(pContentObj); |
| + if (pArray) { |
| pContentArray = pArray; |
| CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); |
| pContentArray->InsertAt(0, pRef); |
| } else if (CPDF_Reference* pReference = ToReference(pContentObj)) { |
| CPDF_Object* pDirectObj = pReference->GetDirect(); |
| if (pDirectObj) { |
| - if (CPDF_Array* pArray = pDirectObj->AsArray()) { |
| + pArray = pDirectObj->AsArray(); |
|
Tom Sepez
2016/06/01 22:49:21
same here.
Wei Li
2016/06/01 23:40:13
Done.
|
| + if (pArray) { |
| pContentArray = pArray; |
| CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); |
| pContentArray->InsertAt(0, pRef); |