summaryrefslogtreecommitdiff
path: root/core/fxcodec
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-05-25 22:58:39 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-25 22:58:39 +0000
commitdf93cd35530e7b8dd67abde8d199c36c3fae76be (patch)
treecc760bdcc560f0ad448db5a2d01de01d6ba8d1c7 /core/fxcodec
parent2aa4b2f3928ccd8393f60db8f7b740c75f4e8a8d (diff)
downloadpdfium-df93cd35530e7b8dd67abde8d199c36c3fae76be.tar.xz
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 <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec')
-rw-r--r--core/fxcodec/codec/ccodec_jpegmodule.h4
-rw-r--r--core/fxcodec/codec/fx_codec_jpeg.cpp9
2 files changed, 2 insertions, 11 deletions
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<Context> 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<CJpegContext*>(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<CJpegContext*>(pContext);