Chromium Code Reviews| Index: core/fpdfapi/fpdf_page/fpdf_page_func.cpp |
| diff --git a/core/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/fpdfapi/fpdf_page/fpdf_page_func.cpp |
| index bb1d631576b70f6035a9b6fe1c815a41f8596580..8ff239f0d45cc07004bfe3479c0d813fe2d32aaf 100644 |
| --- a/core/fpdfapi/fpdf_page/fpdf_page_func.cpp |
| +++ b/core/fpdfapi/fpdf_page/fpdf_page_func.cpp |
| @@ -792,9 +792,10 @@ FX_BOOL CPDF_StitchFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* outputs) const { |
| } |
| // static |
| -CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj) { |
| +std::unique_ptr<CPDF_Function> CPDF_Function::Load(CPDF_Object* pFuncObj) { |
| + std::unique_ptr<CPDF_Function> pFunc; |
| if (!pFuncObj) |
| - return nullptr; |
| + return pFunc; |
| int iType = -1; |
| if (CPDF_Stream* pStream = pFuncObj->AsStream()) |
| @@ -803,7 +804,6 @@ CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj) { |
| iType = pDict->GetIntegerBy("FunctionType"); |
| Type type = IntegerToFunctionType(iType); |
| - std::unique_ptr<CPDF_Function> pFunc; |
| if (type == Type::kType0Sampled) |
| pFunc.reset(new CPDF_SampledFunc()); |
| else if (type == Type::kType2ExpotentialInterpolation) |
| @@ -814,8 +814,8 @@ CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj) { |
| pFunc.reset(new CPDF_PSFunc()); |
| if (!pFunc || !pFunc->Init(pFuncObj)) |
| - return nullptr; |
| - return pFunc.release(); |
| + pFunc.reset(); |
|
Tom Sepez
2016/05/23 19:09:33
Ok, seems a shame to reset pFunc rather than just
Lei Zhang
2016/05/23 19:26:20
Done.
|
| + return pFunc; |
| } |
| // static |