diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-04-17 21:23:58 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-17 21:23:58 +0000 |
commit | 35939f83e45b67de4ccc8c3e70e5e00be40326b6 (patch) | |
tree | 9f9745d8f9202be75498690968391b39c04da9a6 /fpdfsdk/cpdfsdk_interform.cpp | |
parent | aed62531a9b08deb236cc423dc27dbe0810d6d1a (diff) | |
download | pdfium-35939f83e45b67de4ccc8c3e70e5e00be40326b6.tar.xz |
Avoid some string -> ptr -> string duplicate allocations in FF Environment
Change-Id: I4bd89b64cd77a4e2fe0ffc2dcc415cc8fe34667a
Reviewed-on: https://pdfium-review.googlesource.com/30871
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_interform.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_interform.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp index e83e59938c..5ebf683b36 100644 --- a/fpdfsdk/cpdfsdk_interform.cpp +++ b/fpdfsdk/cpdfsdk_interform.cpp @@ -472,7 +472,6 @@ bool CPDFSDK_InterForm::SubmitFields(const WideString& csDestination, bool bIncludeOrExclude, bool bUrlEncoded) { ByteString textBuf = ExportFieldsToFDFTextBuf(fields, bIncludeOrExclude); - size_t nBufSize = textBuf.GetLength(); if (nBufSize == 0) return false; @@ -486,7 +485,7 @@ bool CPDFSDK_InterForm::SubmitFields(const WideString& csDestination, return false; } - m_pFormFillEnv->JS_docSubmitForm(pBuffer, nBufSize, csDestination.c_str()); + m_pFormFillEnv->JS_docSubmitForm(pBuffer, nBufSize, csDestination); if (pBuffer != pLocalBuffer) FX_Free(pBuffer); @@ -564,15 +563,15 @@ bool CPDFSDK_InterForm::SubmitForm(const WideString& sDestination, uint8_t* pLocalBuffer = FX_Alloc(uint8_t, fdfBuffer.GetLength()); memcpy(pLocalBuffer, fdfBuffer.c_str(), fdfBuffer.GetLength()); - uint8_t* pBuffer = pLocalBuffer; + uint8_t* pBuffer = pLocalBuffer; size_t nBufSize = fdfBuffer.GetLength(); if (bUrlEncoded && !FDFToURLEncodedData(pBuffer, nBufSize)) { FX_Free(pLocalBuffer); return false; } - m_pFormFillEnv->JS_docSubmitForm(pBuffer, nBufSize, sDestination.c_str()); + m_pFormFillEnv->JS_docSubmitForm(pBuffer, nBufSize, sDestination); if (pBuffer != pLocalBuffer) FX_Free(pBuffer); |