From ab3909796cf2e9fa192040bcd7cb9da7bb3328a5 Mon Sep 17 00:00:00 2001 From: Diana Gage Date: Fri, 28 Jul 2017 17:07:39 -0700 Subject: Add FORM_ReplaceSelection() and embedder tests. This method replaces the selected text in a user-editable form text area with another text string (which can be empty or non-empty). If there is no selected text, FORM_ReplaceSelection() will append the replacement text after the current caret position. BUG=chromium:59266 Change-Id: I76448ef757d107888c33ebd5656457ebac93b952 Reviewed-on: https://pdfium-review.googlesource.com/8812 Reviewed-by: Lei Zhang Commit-Queue: Diana Gage --- testing/resources/text_form_multiple.in | 16 +++++++++++-- testing/resources/text_form_multiple.pdf | 39 +++++++++++++++++++++----------- 2 files changed, 40 insertions(+), 15 deletions(-) (limited to 'testing/resources') diff --git a/testing/resources/text_form_multiple.in b/testing/resources/text_form_multiple.in index 43919eb200..576e15597c 100644 --- a/testing/resources/text_form_multiple.in +++ b/testing/resources/text_form_multiple.in @@ -3,7 +3,7 @@ << /Type /Catalog /Pages 2 0 R - /AcroForm << /Fields [ 4 0 R 9 0 R ] /DR 5 0 R >> + /AcroForm << /Fields [ 4 0 R 9 0 R 10 0 R ] /DR 5 0 R >> >> endobj {{object 2 0}} @@ -16,7 +16,7 @@ endobj /Resources 5 0 R /MediaBox [ 0 0 300 300 ] /Contents 8 0 R - /Annots [ 4 0 R 9 0 R ] + /Annots [ 4 0 R 9 0 R 10 0 R ] >> endobj {{object 4 0}} @@ -63,6 +63,18 @@ endobj /Subtype /Widget >> endobj +{{object 10 0}} +<< + /Type /Annot + /FT /Tx + /T (CharLimit) + /MaxLen 10 + /DA (0 0 0 rg /F1 12 Tf) + /V (Elephant) + /Rect [ 100 50 200 75 ] + /Subtype /Widget +>> +endobj {{xref}} {{trailer}} {{startxref}} diff --git a/testing/resources/text_form_multiple.pdf b/testing/resources/text_form_multiple.pdf index 6b14cefa82..172ab5e864 100644 --- a/testing/resources/text_form_multiple.pdf +++ b/testing/resources/text_form_multiple.pdf @@ -4,7 +4,7 @@ << /Type /Catalog /Pages 2 0 R - /AcroForm << /Fields [ 4 0 R 9 0 R ] /DR 5 0 R >> + /AcroForm << /Fields [ 4 0 R 9 0 R 10 0 R ] /DR 5 0 R >> >> endobj 2 0 obj @@ -17,7 +17,7 @@ endobj /Resources 5 0 R /MediaBox [ 0 0 300 300 ] /Contents 8 0 R - /Annots [ 4 0 R 9 0 R ] + /Annots [ 4 0 R 9 0 R 10 0 R ] >> endobj 4 0 obj @@ -64,19 +64,32 @@ endobj /Subtype /Widget >> endobj +10 0 obj +<< + /Type /Annot + /FT /Tx + /T (CharLimit) + /MaxLen 10 + /DA (0 0 0 rg /F1 12 Tf) + /V (Elephant) + /Rect [ 100 50 200 75 ] + /Subtype /Widget +>> +endobj xref -0 10 +0 11 0000000000 65535 f 0000000015 00000 n -0000000120 00000 n -0000000179 00000 n -0000000321 00000 n -0000000457 00000 n -0000000490 00000 n -0000000521 00000 n -0000000597 00000 n -0000000697 00000 n -trailer<< /Root 1 0 R /Size 10 >> +0000000127 00000 n +0000000186 00000 n +0000000335 00000 n +0000000471 00000 n +0000000504 00000 n +0000000535 00000 n +0000000611 00000 n +0000000711 00000 n +0000000855 00000 n +trailer<< /Root 1 0 R /Size 11 >> startxref -841 +1020 %%EOF -- cgit v1.2.3