diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-17 17:01:52 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-17 17:01:52 +0000 |
commit | 2617056df6d6e1d0f17031f0c9db09f9192cb0fa (patch) | |
tree | 3e286a9d2f7c754ca8521ea878d7a1c795bea82f /core/fpdfapi/page | |
parent | b7973bb5a0ad2f83a71362d601a928964559004a (diff) | |
download | pdfium-2617056df6d6e1d0f17031f0c9db09f9192cb0fa.tar.xz |
Add constants for PDF 1.7 spec, table 3.4.
Add constants/stream_dict_common.h. The header lists all the constants
in the table in the same order. Constants that are not used at all are
commented out.
BUG=pdfium:1049
Change-Id: I6539090e0ad56319ea628883e388aeacef044e52
Reviewed-on: https://pdfium-review.googlesource.com/29090
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r-- | core/fpdfapi/page/cpdf_image.cpp | 4 | ||||
-rw-r--r-- | core/fpdfapi/page/cpdf_streamparser.cpp | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp index ec826dc5ed..68a6a3243c 100644 --- a/core/fpdfapi/page/cpdf_image.cpp +++ b/core/fpdfapi/page/cpdf_image.cpp @@ -11,6 +11,7 @@ #include <utility> #include <vector> +#include "constants/stream_dict_common.h" #include "core/fpdfapi/cpdf_modulemgr.h" #include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfapi/parser/cpdf_array.h" @@ -105,7 +106,8 @@ std::unique_ptr<CPDF_Dictionary> CPDF_Image::InitJPEG(uint8_t* pData, pDict->SetNewFor<CPDF_Number>("BitsPerComponent", bits); pDict->SetNewFor<CPDF_Name>("Filter", "DCTDecode"); if (!color_trans) { - CPDF_Dictionary* pParms = pDict->SetNewFor<CPDF_Dictionary>("DecodeParms"); + CPDF_Dictionary* pParms = + pDict->SetNewFor<CPDF_Dictionary>(pdfium::stream::kDecodeParms); pParms->SetNewFor<CPDF_Number>("ColorTransform", 0); } m_bIsMask = false; diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp index 82f31dd007..b6658ee5fb 100644 --- a/core/fpdfapi/page/cpdf_streamparser.cpp +++ b/core/fpdfapi/page/cpdf_streamparser.cpp @@ -13,6 +13,7 @@ #include <sstream> #include <utility> +#include "constants/stream_dict_common.h" #include "core/fpdfapi/cpdf_modulemgr.h" #include "core/fpdfapi/page/cpdf_docpagedata.h" #include "core/fpdfapi/parser/cpdf_array.h" @@ -126,12 +127,12 @@ std::unique_ptr<CPDF_Stream> CPDF_StreamParser::ReadInlineStream( if (pFilter) { if (CPDF_Array* pArray = pFilter->AsArray()) { Decoder = pArray->GetStringAt(0); - CPDF_Array* pParams = pDict->GetArrayFor("DecodeParms"); + CPDF_Array* pParams = pDict->GetArrayFor(pdfium::stream::kDecodeParms); if (pParams) pParam = pParams->GetDictAt(0); } else { Decoder = pFilter->GetString(); - pParam = pDict->GetDictFor("DecodeParms"); + pParam = pDict->GetDictFor(pdfium::stream::kDecodeParms); } } uint32_t width = pDict->GetIntegerFor("Width"); |