summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_interform.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-18 11:42:46 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-18 19:22:52 +0000
commit690d456ad54f021063dcc17fde27c7ba4d910717 (patch)
tree75ff5c3a11aa2f1cfc739e20179a8640bd0baae9 /fpdfsdk/cpdfsdk_interform.cpp
parente6792f9901267b2b65611e94713462bc9d0b5191 (diff)
downloadpdfium-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 'fpdfsdk/cpdfsdk_interform.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index 2d02a7ab93..76cb6fdabf 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -502,9 +502,8 @@ bool CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(
const std::vector<CPDF_FormField*>& fields,
bool bIncludeOrExclude,
CFX_ByteTextBuf& textBuf) {
- std::unique_ptr<CFDF_Document> pFDF =
- m_pInterForm->ExportToFDF(m_pFormFillEnv->JS_docGetFilePath().AsStringC(),
- fields, bIncludeOrExclude, false);
+ std::unique_ptr<CFDF_Document> pFDF = m_pInterForm->ExportToFDF(
+ m_pFormFillEnv->JS_docGetFilePath(), fields, bIncludeOrExclude, false);
return pFDF ? pFDF->WriteBuf(textBuf) : false;
}
@@ -521,8 +520,8 @@ bool CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination,
if (!m_pFormFillEnv || !m_pInterForm)
return false;
- std::unique_ptr<CFDF_Document> pFDFDoc = m_pInterForm->ExportToFDF(
- m_pFormFillEnv->JS_docGetFilePath().AsStringC(), false);
+ std::unique_ptr<CFDF_Document> pFDFDoc =
+ m_pInterForm->ExportToFDF(m_pFormFillEnv->JS_docGetFilePath(), false);
if (!pFDFDoc)
return false;
@@ -543,8 +542,8 @@ bool CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination,
}
bool CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf) {
- std::unique_ptr<CFDF_Document> pFDF = m_pInterForm->ExportToFDF(
- m_pFormFillEnv->JS_docGetFilePath().AsStringC(), false);
+ std::unique_ptr<CFDF_Document> pFDF =
+ m_pInterForm->ExportToFDF(m_pFormFillEnv->JS_docGetFilePath(), false);
return pFDF && pFDF->WriteBuf(textBuf);
}