summaryrefslogtreecommitdiff
path: root/fpdfsdk/include
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-06-22 15:13:36 -0700
committerLei Zhang <thestig@chromium.org>2015-06-22 15:13:36 -0700
commit5ab3fc60fc44aca144607416d18e7efdc1203fe6 (patch)
treea87fb76fff5cbb9865cddb6b593afc347b02c381 /fpdfsdk/include
parent06864f7992891d555f9f86efcf4feb06a2856b36 (diff)
downloadpdfium-5ab3fc60fc44aca144607416d18e7efdc1203fe6.tar.xz
Cleanup: Remove more checks for new returning NULL.
R=jam@chromium.org Review URL: https://codereview.chromium.org/1198903002.
Diffstat (limited to 'fpdfsdk/include')
-rw-r--r--fpdfsdk/include/fsdk_mgr.h54
1 files changed, 2 insertions, 52 deletions
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 4f2a87d974..167d0d6fcd 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -170,59 +170,9 @@ public:
}
}
- CFX_WideString JS_fieldBrowse()
- {
- if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Field_browse)
- {
- int nRequiredLen = m_pInfo->m_pJsPlatform->Field_browse(m_pInfo->m_pJsPlatform, NULL, 0);
- if (nRequiredLen <= 0)
- return L"";
-
- char* pbuff = new char[nRequiredLen];
- if (!pbuff)
- return L"";
-
- memset(pbuff, 0, nRequiredLen);
- int nActualLen = m_pInfo->m_pJsPlatform->Field_browse(m_pInfo->m_pJsPlatform, pbuff, nRequiredLen);
- if (nActualLen <= 0 || nActualLen > nRequiredLen)
- {
- delete[] pbuff;
- return L"";
- }
- CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen);
- CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet);
- delete[] pbuff;
- return wsRet;
- }
- return L"";
- }
+ CFX_WideString JS_fieldBrowse();
- CFX_WideString JS_docGetFilePath()
- {
- if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_getFilePath)
- {
- int nRequiredLen = m_pInfo->m_pJsPlatform->Doc_getFilePath(m_pInfo->m_pJsPlatform, NULL, 0);
- if (nRequiredLen <= 0)
- return L"";
-
- char* pbuff = new char[nRequiredLen];
- if (!pbuff)
- return L"";
-
- memset(pbuff, 0, nRequiredLen);
- int nActualLen = m_pInfo->m_pJsPlatform->Doc_getFilePath(m_pInfo->m_pJsPlatform, pbuff, nRequiredLen);
- if (nActualLen <= 0 || nActualLen > nRequiredLen)
- {
- delete[] pbuff;
- return L"";
- }
- CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen);
- CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet);
- delete[] pbuff;
- return wsRet;
- }
- return L"";
- }
+ CFX_WideString JS_docGetFilePath();
void JS_docSubmitForm(void* formData, int length, const FX_WCHAR* URL)
{