From c8a17e550d4d4a6f68598f8eed70eb6f8f301442 Mon Sep 17 00:00:00 2001 From: Jane Liu Date: Thu, 13 Jul 2017 10:37:59 -0400 Subject: 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 Commit-Queue: dsinclair Reviewed-by: dsinclair Reviewed-by: Lei Zhang --- fpdfsdk/fpdfattachment.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'fpdfsdk') 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; } -- cgit v1.2.3