From b048f791a15f2da781a01eba5b09eb9d389f9c11 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 4 Aug 2015 12:19:10 -0700 Subject: clang-format all pdfium code. No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163' | \ xargs ../../buildtools/mac/clang-format -i See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1265503005 . --- fpdfsdk/src/fpdfeditimg.cpp | 114 +++++++++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 55 deletions(-) (limited to 'fpdfsdk/src/fpdfeditimg.cpp') diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp index 96cfba4194..3b5272cace 100644 --- a/fpdfsdk/src/fpdfeditimg.cpp +++ b/fpdfsdk/src/fpdfeditimg.cpp @@ -7,67 +7,71 @@ #include "../../public/fpdf_edit.h" #include "../include/fsdk_define.h" - -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) -{ - if (!document) - return NULL; - CPDF_ImageObject* pImageObj = new CPDF_ImageObject; - CPDF_Image* pImg = new CPDF_Image((CPDF_Document *)document); - pImageObj->m_pImage = pImg; - return pImageObj; +DLLEXPORT FPDF_PAGEOBJECT STDCALL +FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) { + if (!document) + return NULL; + CPDF_ImageObject* pImageObj = new CPDF_ImageObject; + CPDF_Image* pImg = new CPDF_Image((CPDF_Document*)document); + 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) - return FALSE; +DLLEXPORT FPDF_BOOL STDCALL +FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, + int nCount, + FPDF_PAGEOBJECT image_object, + FPDF_FILEACCESS* fileAccess) { + if (!image_object || !fileAccess) + return FALSE; - IFX_FileRead* pFile = new CPDF_CustomAccess(fileAccess); - CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object; - pImgObj->m_GeneralState.GetModify(); - for (int index=0;indexm_pImage->ResetCache(pPage,NULL); - } - pImgObj->m_pImage->SetJpegImage(pFile); + IFX_FileRead* pFile = 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 = (CPDF_Page*)pages[index]; + 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) - 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;indexm_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) + 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 = (CPDF_Page*)pages[index]; + pImgObj->m_pImage->ResetCache(pPage, NULL); + } + pImgObj->m_pImage->SetImage(pBmp, FALSE); + pImgObj->CalcBoundingBox(); + return TRUE; } - -- cgit v1.2.3