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/fpdfdoc/cpdf_filespec.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 'core/fpdfdoc/cpdf_filespec.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_filespec.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/fpdfdoc/cpdf_filespec.cpp b/core/fpdfdoc/cpdf_filespec.cpp index 2f999bcf4e..e741ac61ce 100644 --- a/core/fpdfdoc/cpdf_filespec.cpp +++ b/core/fpdfdoc/cpdf_filespec.cpp @@ -8,6 +8,7 @@ #include <vector> +#include "constants/stream_dict_common.h" #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_name.h" #include "core/fpdfapi/parser/cpdf_object.h" @@ -94,8 +95,8 @@ WideString CPDF_FileSpec::GetFileName() const { if (CPDF_Dictionary* pDict = m_pObj->AsDictionary()) { csFileName = pDict->GetUnicodeTextFor("UF"); if (csFileName.IsEmpty()) { - csFileName = - WideString::FromLocal(pDict->GetStringFor("F").AsStringView()); + csFileName = WideString::FromLocal( + pDict->GetStringFor(pdfium::stream::kF).AsStringView()); } if (pDict->GetStringFor("FS") == "URL") return csFileName; @@ -187,7 +188,8 @@ void CPDF_FileSpec::SetFileName(const WideString& wsFileName) { if (m_pObj->IsString()) { m_pObj->SetString(ByteString::FromUnicode(wsStr)); } else if (CPDF_Dictionary* pDict = m_pObj->AsDictionary()) { - pDict->SetNewFor<CPDF_String>("F", ByteString::FromUnicode(wsStr), false); + pDict->SetNewFor<CPDF_String>(pdfium::stream::kF, + ByteString::FromUnicode(wsStr), false); pDict->SetNewFor<CPDF_String>("UF", PDF_EncodeText(wsStr), false); } } |