diff options
author | Nico Weber <thakis@chromium.org> | 2015-08-04 13:00:21 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2015-08-04 13:00:21 -0700 |
commit | 9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f (patch) | |
tree | c97037f398d714665aefccb6eb54d0969ad7030c /fpdfsdk/src/fpdfeditimg.cpp | |
parent | 780cee82236d1b3b0f9b01a22424e4b8ec9a6f12 (diff) | |
download | pdfium-9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f.tar.xz |
XFA: clang-format all pdfium code.
No behavior change.
Generated by:
find . -name '*.cpp' -o -name '*.h' | \
grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \
xargs ../../buildtools/mac/clang-format -i
Then manually merged https://codereview.chromium.org/1269223002/
See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion.
BUG=none
Diffstat (limited to 'fpdfsdk/src/fpdfeditimg.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfeditimg.cpp | 121 |
1 files changed, 64 insertions, 57 deletions
diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp index a6951d20d3..bfd9adea36 100644 --- a/fpdfsdk/src/fpdfeditimg.cpp +++ b/fpdfsdk/src/fpdfeditimg.cpp @@ -9,70 +9,77 @@ #include "../include/fpdfxfa/fpdfxfa_doc.h" #include "../include/fpdfxfa/fpdfxfa_page.h" -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) -{ - if (!document) - return NULL; - CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject; - CPDF_Image* pImg = FX_NEW CPDF_Image(((CPDFXFA_Document *)document)->GetPDFDoc()); - pImageObj->m_pImage = pImg; - return pImageObj; +DLLEXPORT FPDF_PAGEOBJECT STDCALL +FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) { + if (!document) + return NULL; + CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject; + CPDF_Image* pImg = + FX_NEW CPDF_Image(((CPDFXFA_Document*)document)->GetPDFDoc()); + pImageObj->m_pImage = pImg; + return pImageObj; } -DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount,FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess) -{ - if (!image_object || !fileAccess || !pages) - return FALSE; +DLLEXPORT FPDF_BOOL STDCALL +FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, + int nCount, + FPDF_PAGEOBJECT image_object, + FPDF_FILEACCESS* fileAccess) { + if (!image_object || !fileAccess || !pages) + return FALSE; - IFX_FileRead* pFile = FX_NEW CPDF_CustomAccess(fileAccess); + IFX_FileRead* pFile = FX_NEW CPDF_CustomAccess(fileAccess); - CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object; - pImgObj->m_GeneralState.GetModify(); - for (int index=0;index<nCount;index++) - { - CPDF_Page* pPage = ((CPDFXFA_Page*)pages[index])->GetPDFPage(); - if (!pPage) - continue; - pImgObj->m_pImage->ResetCache(pPage,NULL); - } - pImgObj->m_pImage->SetJpegImage(pFile); + CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object; + pImgObj->m_GeneralState.GetModify(); + for (int index = 0; index < nCount; index++) { + CPDF_Page* pPage = ((CPDFXFA_Page*)pages[index])->GetPDFPage(); + if (!pPage) + continue; + pImgObj->m_pImage->ResetCache(pPage, NULL); + } + pImgObj->m_pImage->SetJpegImage(pFile); - return TRUE; + return TRUE; } - -DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix (FPDF_PAGEOBJECT image_object, - double a, double b, double c, double d, double e, double f) -{ - if (!image_object) - return FALSE; - CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object; - pImgObj->m_Matrix.a = (FX_FLOAT)a; - pImgObj->m_Matrix.b = (FX_FLOAT)b; - pImgObj->m_Matrix.c = (FX_FLOAT)c; - pImgObj->m_Matrix.d = (FX_FLOAT)d; - pImgObj->m_Matrix.e = (FX_FLOAT)e; - pImgObj->m_Matrix.f = (FX_FLOAT)f; - pImgObj->CalcBoundingBox(); - return TRUE; +DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, + double a, + double b, + double c, + double d, + double e, + double f) { + if (!image_object) + return FALSE; + CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object; + pImgObj->m_Matrix.a = (FX_FLOAT)a; + pImgObj->m_Matrix.b = (FX_FLOAT)b; + pImgObj->m_Matrix.c = (FX_FLOAT)c; + pImgObj->m_Matrix.d = (FX_FLOAT)d; + pImgObj->m_Matrix.e = (FX_FLOAT)e; + pImgObj->m_Matrix.f = (FX_FLOAT)f; + pImgObj->CalcBoundingBox(); + return TRUE; } -DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,FPDF_PAGEOBJECT image_object,FPDF_BITMAP bitmap) -{ - if (!image_object || !bitmap || !pages) - return FALSE; - CFX_DIBitmap* pBmp = NULL; - pBmp = (CFX_DIBitmap*)bitmap; - CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object; - pImgObj->m_GeneralState.GetModify(); - for (int index=0;index<nCount;index++) - { - CPDF_Page* pPage = ((CPDFXFA_Page*)pages[index])->GetPDFPage(); - if (!pPage) continue; - pImgObj->m_pImage->ResetCache(pPage,NULL); - } - pImgObj->m_pImage->SetImage(pBmp,FALSE); - pImgObj->CalcBoundingBox(); - return TRUE; +DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages, + int nCount, + FPDF_PAGEOBJECT image_object, + FPDF_BITMAP bitmap) { + if (!image_object || !bitmap || !pages) + return FALSE; + CFX_DIBitmap* pBmp = NULL; + pBmp = (CFX_DIBitmap*)bitmap; + CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object; + pImgObj->m_GeneralState.GetModify(); + for (int index = 0; index < nCount; index++) { + CPDF_Page* pPage = ((CPDFXFA_Page*)pages[index])->GetPDFPage(); + if (!pPage) + continue; + pImgObj->m_pImage->ResetCache(pPage, NULL); + } + pImgObj->m_pImage->SetImage(pBmp, FALSE); + pImgObj->CalcBoundingBox(); + return TRUE; } - |