diff options
author | Lei Zhang <thestig@chromium.org> | 2017-03-15 17:35:47 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-16 18:34:55 +0000 |
commit | cbd8957f6c74a6fd5c3cf2bb656b9a4c80deaa71 (patch) | |
tree | d68b7df5e2e8c6fb505c2e7056ca0cf14a6a5c82 /fpdfsdk/fpdfeditimg.cpp | |
parent | fba16517cf0f4f46fca56c90fdc04653e0890d50 (diff) | |
download | pdfium-cbd8957f6c74a6fd5c3cf2bb656b9a4c80deaa71.tar.xz |
Move FPDFImageObj_LoadJpegHelper() into an anonymous namespace.
Add public FPDFPageObj_NewImageObj() call to replace
FPDFPageObj_NewImgeObj() which is missing a letter.
Change-Id: I5355ee5e5bf7e6e161e2004ec7e9257c85a463f7
Reviewed-on: https://pdfium-review.googlesource.com/2840
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfeditimg.cpp')
-rw-r--r-- | fpdfsdk/fpdfeditimg.cpp | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp index ad5605011c..69151d1999 100644 --- a/fpdfsdk/fpdfeditimg.cpp +++ b/fpdfsdk/fpdfeditimg.cpp @@ -13,22 +13,13 @@ #include "fpdfsdk/fsdk_define.h" #include "third_party/base/ptr_util.h" -DLLEXPORT FPDF_PAGEOBJECT STDCALL -FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) { - CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); - if (!pDoc) - return nullptr; +namespace { - CPDF_ImageObject* pImageObj = new CPDF_ImageObject; - pImageObj->SetOwnedImage(pdfium::MakeUnique<CPDF_Image>(pDoc)); - return pImageObj; -} - -FPDF_BOOL FPDFImageObj_LoadJpegHelper(FPDF_PAGE* pages, - int nCount, - FPDF_PAGEOBJECT image_object, - FPDF_FILEACCESS* fileAccess, - bool inlineJpeg) { +bool LoadJpegHelper(FPDF_PAGE* pages, + int nCount, + FPDF_PAGEOBJECT image_object, + FPDF_FILEACCESS* fileAccess, + bool inlineJpeg) { if (!image_object || !fileAccess || !pages) return false; @@ -49,13 +40,30 @@ FPDF_BOOL FPDFImageObj_LoadJpegHelper(FPDF_PAGE* pages, return true; } +} // namespace + +DLLEXPORT FPDF_PAGEOBJECT STDCALL +FPDFPageObj_NewImageObj(FPDF_DOCUMENT document) { + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); + if (!pDoc) + return nullptr; + + CPDF_ImageObject* pImageObj = new CPDF_ImageObject; + pImageObj->SetOwnedImage(pdfium::MakeUnique<CPDF_Image>(pDoc)); + return pImageObj; +} + +DLLEXPORT FPDF_PAGEOBJECT STDCALL +FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) { + return FPDFPageObj_NewImageObj(document); +} + DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount, FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess) { - return FPDFImageObj_LoadJpegHelper(pages, nCount, image_object, fileAccess, - false); + return LoadJpegHelper(pages, nCount, image_object, fileAccess, false); } DLLEXPORT FPDF_BOOL STDCALL @@ -63,8 +71,7 @@ FPDFImageObj_LoadJpegFileInline(FPDF_PAGE* pages, int nCount, FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess) { - return FPDFImageObj_LoadJpegHelper(pages, nCount, image_object, fileAccess, - true); + return LoadJpegHelper(pages, nCount, image_object, fileAccess, true); } DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, |