summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfattachment.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 /fpdfsdk/fpdfattachment.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 'fpdfsdk/fpdfattachment.cpp')
-rw-r--r--fpdfsdk/fpdfattachment.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/fpdfsdk/fpdfattachment.cpp b/fpdfsdk/fpdfattachment.cpp
index d8713bb2e1..e07d15b0c8 100644
--- a/fpdfsdk/fpdfattachment.cpp
+++ b/fpdfsdk/fpdfattachment.cpp
@@ -35,13 +35,10 @@ FPDFDoc_GetAttachmentName(FPDF_DOCUMENT document,
if (!pFile)
return 0;
- CFX_WideString name;
- CPDF_FileSpec filespec(pFile);
- filespec.GetFileName(&name);
- CFX_ByteString encodedName = name.UTF16LE_Encode();
- unsigned long len = encodedName.GetLength();
+ CFX_ByteString name = CPDF_FileSpec(pFile).GetFileName().UTF16LE_Encode();
+ unsigned long len = name.GetLength();
if (buffer && buflen >= len)
- memcpy(buffer, encodedName.c_str(), len);
+ memcpy(buffer, name.c_str(), len);
return len;
}