summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_action.cpp
diff options
context:
space:
mode:
authorJane Liu <janeliulwq@google.com>2017-07-13 10:37:59 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-13 15:18:44 +0000
commitc8a17e550d4d4a6f68598f8eed70eb6f8f301442 (patch)
tree9b6820db32d532689d086608233b9587216b0197 /core/fpdfdoc/cpdf_action.cpp
parentc3eca649ce2213b06551e8de8793e24ec6f9cef5 (diff)
downloadpdfium-c8a17e550d4d4a6f68598f8eed70eb6f8f301442.tar.xz
Changed CPDF_FileSpec::GetFileName() to directly return CFX_WideString
Changed CPDF_FileSpec::GetFileName() to directly return CFX_WideString, instead of taking in a CFX_WideString* and returning a bool. Also fixed test calls in the unit test. Bug=pdfium:808 Change-Id: Ie081fc9f4f1c15d23c86d7222d8480ab9cb56056 Reviewed-on: https://pdfium-review.googlesource.com/7671 Commit-Queue: Jane Liu <janeliulwq@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_action.cpp')
-rw-r--r--core/fpdfdoc/cpdf_action.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/core/fpdfdoc/cpdf_action.cpp b/core/fpdfdoc/cpdf_action.cpp
index b40fdcd225..88d0781e80 100644
--- a/core/fpdfdoc/cpdf_action.cpp
+++ b/core/fpdfdoc/cpdf_action.cpp
@@ -73,21 +73,16 @@ CFX_WideString CPDF_Action::GetFilePath() const {
}
CPDF_Object* pFile = m_pDict->GetDirectObjectFor("F");
- CFX_WideString path;
- if (!pFile) {
- if (type == "Launch") {
- CPDF_Dictionary* pWinDict = m_pDict->GetDictFor("Win");
- if (pWinDict) {
- return CFX_WideString::FromLocal(
- pWinDict->GetStringFor("F").AsStringC());
- }
+ if (pFile)
+ return CPDF_FileSpec(pFile).GetFileName();
+
+ if (type == "Launch") {
+ CPDF_Dictionary* pWinDict = m_pDict->GetDictFor("Win");
+ if (pWinDict) {
+ return CFX_WideString::FromLocal(pWinDict->GetStringFor("F").AsStringC());
}
- return path;
}
-
- CPDF_FileSpec filespec(pFile);
- filespec.GetFileName(&path);
- return path;
+ return CFX_WideString();
}
CFX_ByteString CPDF_Action::GetURI(CPDF_Document* pDoc) const {