diff options
author | Tom Sepez <tsepez@chromium.org> | 2014-07-29 14:01:21 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2014-07-29 14:01:21 -0700 |
commit | 621d4de9672bf8def81edba90b9a6d4fd83ea1da (patch) | |
tree | c9f2a6e3321f12120e7bb6df1db897fa4253a198 /fpdfsdk/include/fpdfformfill.h | |
parent | 6c55495fcaf634e7f788f4dfe77fa1a106c9cd55 (diff) | |
download | pdfium-621d4de9672bf8def81edba90b9a6d4fd83ea1da.tar.xz |
Tidy up app::response().
Follow-up from https://codereview.chromium.org/424883002/
- Remove some stray whitespace.
- Fix "else after return".
- Remove unused swResponse local.
- Treat unexpectedly large responses as errors.
BUG=
R=jun_fang@foxitsoftware.com
Review URL: https://codereview.chromium.org/423953002
Diffstat (limited to 'fpdfsdk/include/fpdfformfill.h')
-rw-r--r-- | fpdfsdk/include/fpdfformfill.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/fpdfsdk/include/fpdfformfill.h b/fpdfsdk/include/fpdfformfill.h index 50a2dff66e..b69a8f69b2 100644 --- a/fpdfsdk/include/fpdfformfill.h +++ b/fpdfsdk/include/fpdfformfill.h @@ -72,11 +72,10 @@ typedef struct _IPDF_JsPlatform * None */ void (*app_beep)(struct _IPDF_JsPlatform* pThis, int nType); - - + /** * Method: app_response - * Displays a dialog box containing a question and an entry field for the user to reply to the question. + * Displays a dialog box containing a question and an entry field for the user to reply to the question. * Interface Version: * 1 * Implementation Required: @@ -86,23 +85,20 @@ typedef struct _IPDF_JsPlatform * Question - The question to be posed to the user. * Title - The title of the dialog box. * Default - A default value for the answer to the question. If not specified, no default value is presented. - * cLabel - A short string to appear in front of and on the same line as the edit text field. - * bPassword - If true, indicates that the user's response should show as asterisks (*) or bullets (?) to mask the response, which might be sensitive information. The default is false. - * response - A string buffer allocated by SDK, to receive the user's response. + * cLabel - A short string to appear in front of and on the same line as the edit text field. + * bPassword - If true, indicates that the user's response should show as asterisks (*) or bullets (?) to mask the response, which might be sensitive information. The default is false. + * response - A string buffer allocated by SDK, to receive the user's response. * length - The length of the buffer, number of bytes. Currently, It's always be 2048. * Return Value: - * Number of bytes the user input text consumes, not including trailing zeros. If the text exceed 2048 bytes, - * the exceeded part will be ignored. + * Number of bytes the complete user input would actually require, not including trailing zeros, regardless of the value of the length + * parameter or the presence of the response buffer. * Comments: - * No matter on what platform, the response should be always input in UTF-16LE encoding. - * The return value always indicated number of bytes required for the buffer, even when there is - * no buffer specified, or the buffer size is less then required. In this case, the buffer will not - * be modified. + * No matter on what platform, the response buffer should be always written using UTF-16LE encoding. If a response buffer is + * present and the size of the user input exceeds the capacity of the buffer as specified by the length parameter, only the + * first "length" bytes of the user input are to be written to the buffer. */ int (*app_response)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Question, FPDF_WIDESTRING Title, FPDF_WIDESTRING Default, FPDF_WIDESTRING cLabel, FPDF_BOOL bPassword, void* response, int length); - - - + /* * Method: Doc_getFilePath * Get the file path of the current document. |