summaryrefslogtreecommitdiff
path: root/core/fpdfdoc
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r--core/fpdfdoc/cpdf_action.cpp6
-rw-r--r--core/fpdfdoc/cpdf_filespec.cpp8
-rw-r--r--core/fpdfdoc/cpdf_interform.cpp3
3 files changed, 11 insertions, 6 deletions
diff --git a/core/fpdfdoc/cpdf_action.cpp b/core/fpdfdoc/cpdf_action.cpp
index 383f328b9f..4ac86fe104 100644
--- a/core/fpdfdoc/cpdf_action.cpp
+++ b/core/fpdfdoc/cpdf_action.cpp
@@ -6,6 +6,7 @@
#include "core/fpdfdoc/cpdf_action.h"
+#include "constants/stream_dict_common.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfdoc/cpdf_filespec.h"
@@ -70,14 +71,15 @@ WideString CPDF_Action::GetFilePath() const {
return WideString();
}
- CPDF_Object* pFile = m_pDict->GetDirectObjectFor("F");
+ CPDF_Object* pFile = m_pDict->GetDirectObjectFor(pdfium::stream::kF);
if (pFile)
return CPDF_FileSpec(pFile).GetFileName();
if (type == "Launch") {
CPDF_Dictionary* pWinDict = m_pDict->GetDictFor("Win");
if (pWinDict) {
- return WideString::FromLocal(pWinDict->GetStringFor("F").AsStringView());
+ return WideString::FromLocal(
+ pWinDict->GetStringFor(pdfium::stream::kF).AsStringView());
}
}
return WideString();
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);
}
}
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index 6c53c971d8..6bf72fd5ef 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -9,6 +9,7 @@
#include <utility>
#include <vector>
+#include "constants/stream_dict_common.h"
#include "core/fpdfapi/font/cpdf_font.h"
#include "core/fpdfapi/font/cpdf_fontencoding.h"
#include "core/fpdfapi/page/cpdf_page.h"
@@ -1117,7 +1118,7 @@ std::unique_ptr<CFDF_Document> CPDF_InterForm::ExportToFDF(
if (bSimpleFileSpec) {
WideString wsFilePath = CPDF_FileSpec::EncodeFileName(pdf_path);
pMainDict->SetNewFor<CPDF_String>(
- "F", ByteString::FromUnicode(wsFilePath), false);
+ pdfium::stream::kF, ByteString::FromUnicode(wsFilePath), false);
pMainDict->SetNewFor<CPDF_String>("UF", PDF_EncodeText(wsFilePath),
false);
} else {