From df93cd35530e7b8dd67abde8d199c36c3fae76be Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 25 May 2018 22:58:39 +0000 Subject: Replace some #ifdef PDF_ENABLE_XFA with runtime checks. Abstract GetUserPermissions() differences via new virtual method. Abstract GetPageCount() differences via existing virtual method. Remove unused ReadHeader() form for non-xfa. Remove unused FindSubstFontByUnicode() for xfa. Remove unused FXFONT_EXACTMATCH Change-Id: I0a3de01a9841db86fcbc96991d3fa2682393b9ad Reviewed-on: https://pdfium-review.googlesource.com/32831 Commit-Queue: Tom Sepez Reviewed-by: dsinclair Reviewed-by: Lei Zhang --- core/fxcodec/codec/ccodec_jpegmodule.h | 4 +--- core/fxcodec/codec/fx_codec_jpeg.cpp | 9 +-------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'core/fxcodec') diff --git a/core/fxcodec/codec/ccodec_jpegmodule.h b/core/fxcodec/codec/ccodec_jpegmodule.h index aed01bda9b..06cd2242c2 100644 --- a/core/fxcodec/codec/ccodec_jpegmodule.h +++ b/core/fxcodec/codec/ccodec_jpegmodule.h @@ -45,9 +45,7 @@ class CCodec_JpegModule { std::unique_ptr Start(); void Input(Context* pContext, const uint8_t* src_buf, uint32_t src_size); -#ifndef PDF_ENABLE_XFA - int ReadHeader(Context* pContext, int* width, int* height, int* nComps); -#else // PDF_ENABLE_XFA +#ifdef PDF_ENABLE_XFA int ReadHeader(Context* pContext, int* width, int* height, diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp index 7a73f4e55e..f0b8d66d3a 100644 --- a/core/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/fxcodec/codec/fx_codec_jpeg.cpp @@ -451,12 +451,6 @@ int CCodec_JpegModule::ReadHeader(Context* pContext, int* height, int* nComps, CFX_DIBAttribute* pAttribute) { -#else // PDF_ENABLE_XFA -int CCodec_JpegModule::ReadHeader(Context* pContext, - int* width, - int* height, - int* nComps) { -#endif // PDF_ENABLE_XFA auto* ctx = static_cast(pContext); int ret = jpeg_read_header(&ctx->m_Info, true); if (ret == JPEG_SUSPENDED) @@ -467,11 +461,10 @@ int CCodec_JpegModule::ReadHeader(Context* pContext, *width = ctx->m_Info.image_width; *height = ctx->m_Info.image_height; *nComps = ctx->m_Info.num_components; -#ifdef PDF_ENABLE_XFA JpegLoadAttribute(&ctx->m_Info, pAttribute); -#endif return 0; } +#endif // PDF_ENABLE_XFA bool CCodec_JpegModule::StartScanline(Context* pContext, int down_scale) { auto* ctx = static_cast(pContext); -- cgit v1.2.3