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 /fpdfsdk/fpdf_attachment.cpp | |
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 'fpdfsdk/fpdf_attachment.cpp')
-rw-r--r-- | fpdfsdk/fpdf_attachment.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fpdfsdk/fpdf_attachment.cpp b/fpdfsdk/fpdf_attachment.cpp index 0bb9364834..25957174bc 100644 --- a/fpdfsdk/fpdf_attachment.cpp +++ b/fpdfsdk/fpdf_attachment.cpp @@ -7,6 +7,7 @@ #include <memory> #include <utility> +#include "constants/stream_dict_common.h" #include "core/fdrm/crypto/fx_crypt.h" #include "core/fpdfapi/parser/cpdf_array.h" #include "core/fpdfapi/parser/cpdf_document.h" @@ -90,7 +91,7 @@ FPDFDoc_AddAttachment(FPDF_DOCUMENT document, FPDF_WIDESTRING name) { CPDF_Dictionary* pFile = pDoc->NewIndirect<CPDF_Dictionary>(); pFile->SetNewFor<CPDF_Name>("Type", "Filespec"); pFile->SetNewFor<CPDF_String>("UF", wsName); - pFile->SetNewFor<CPDF_String>("F", wsName); + pFile->SetNewFor<CPDF_String>(pdfium::stream::kF, wsName); // Add the new attachment name and filespec into the document's EmbeddedFiles. CPDF_NameTree nameTree(pDoc, "EmbeddedFiles"); @@ -230,7 +231,8 @@ FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, pFileStreamDict->SetNewFor<CPDF_Dictionary>("Params"); // Set the size of the new file in the dictionary. - pFileStreamDict->SetNewFor<CPDF_Number>("DL", static_cast<int>(len)); + pFileStreamDict->SetNewFor<CPDF_Number>(pdfium::stream::kDL, + static_cast<int>(len)); pParamsDict->SetNewFor<CPDF_Number>("Size", static_cast<int>(len)); // Set the creation date of the new attachment in the dictionary. |