diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-05-18 11:42:46 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-18 19:22:52 +0000 |
commit | 690d456ad54f021063dcc17fde27c7ba4d910717 (patch) | |
tree | 75ff5c3a11aa2f1cfc739e20179a8640bd0baae9 /core/fpdfdoc/cpdf_filespec.cpp | |
parent | e6792f9901267b2b65611e94713462bc9d0b5191 (diff) | |
download | pdfium-690d456ad54f021063dcc17fde27c7ba4d910717.tar.xz |
Use UnownedPtr to check CFX_*StringC lifetimeschromium/3104
Change interform to avoid temp StringC with dangling ptr.
Change-Id: I8d8659973bcdf2cdbcaa6efa6012e4acce5f1604
Reviewed-on: https://pdfium-review.googlesource.com/5571
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: 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, 4 insertions, 4 deletions
diff --git a/core/fpdfdoc/cpdf_filespec.cpp b/core/fpdfdoc/cpdf_filespec.cpp index 7fe8ec8c03..59915eaa05 100644 --- a/core/fpdfdoc/cpdf_filespec.cpp +++ b/core/fpdfdoc/cpdf_filespec.cpp @@ -50,7 +50,7 @@ CFX_WideString ChangeSlashToPDF(const wchar_t* str) { } // namespace -CFX_WideString CPDF_FileSpec::DecodeFileName(const CFX_WideStringC& filepath) { +CFX_WideString CPDF_FileSpec::DecodeFileName(const CFX_WideString& filepath) { if (filepath.GetLength() <= 1) return CFX_WideString(); @@ -108,7 +108,7 @@ bool CPDF_FileSpec::GetFileName(CFX_WideString* csFileName) const { } else { return false; } - *csFileName = DecodeFileName(csFileName->AsStringC()); + *csFileName = DecodeFileName(*csFileName); return true; } @@ -116,7 +116,7 @@ CPDF_FileSpec::CPDF_FileSpec(CPDF_Object* pObj) : m_pObj(pObj) {} CPDF_FileSpec::~CPDF_FileSpec() {} -CFX_WideString CPDF_FileSpec::EncodeFileName(const CFX_WideStringC& filepath) { +CFX_WideString CPDF_FileSpec::EncodeFileName(const CFX_WideString& filepath) { if (filepath.GetLength() <= 1) return CFX_WideString(); @@ -145,7 +145,7 @@ CFX_WideString CPDF_FileSpec::EncodeFileName(const CFX_WideStringC& filepath) { #endif } -void CPDF_FileSpec::SetFileName(const CFX_WideStringC& wsFileName) { +void CPDF_FileSpec::SetFileName(const CFX_WideString& wsFileName) { if (!m_pObj) return; |