diff options
-rw-r--r-- | core/fpdfdoc/cpdf_annotlist.cpp | 2 | ||||
-rw-r--r-- | testing/resources/pixel/bug_733528.in | 72 | ||||
-rw-r--r-- | testing/resources/pixel/bug_733528_expected.pdf.0.png | bin | 0 -> 3492 bytes | |||
-rw-r--r-- | testing/resources/pixel/bug_733528_expected_mac.pdf.0.png | bin | 0 -> 3349 bytes |
4 files changed, 73 insertions, 1 deletions
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp index 1427c85616..1f94779c15 100644 --- a/core/fpdfdoc/cpdf_annotlist.cpp +++ b/core/fpdfdoc/cpdf_annotlist.cpp @@ -86,7 +86,7 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage) pAnnots->ConvertToIndirectObjectAt(i, m_pDocument); m_AnnotList.push_back(pdfium::MakeUnique<CPDF_Annot>(pDict, m_pDocument)); if (bRegenerateAP && subtype == "Widget" && - CPDF_InterForm::IsUpdateAPEnabled()) { + CPDF_InterForm::IsUpdateAPEnabled() && !pDict->GetDictFor("AP")) { FPDF_GenerateAP(m_pDocument, pDict); } } diff --git a/testing/resources/pixel/bug_733528.in b/testing/resources/pixel/bug_733528.in new file mode 100644 index 0000000000..3602c3f2b5 --- /dev/null +++ b/testing/resources/pixel/bug_733528.in @@ -0,0 +1,72 @@ +{{header}} +{{object 1 0}} << + /Type /Catalog + /Pages 2 0 R + /AcroForm << + /Fields [ 4 0 R 9 0 R ] + /DR 5 0 R + /NeedAppearances true + >> +>> +endobj +{{object 2 0}} << + /Count 1 + /Kids [ 3 0 R ] + /Type /Pages +>> +endobj +{{object 3 0}} << + /Type /Page + /Parent 2 0 R + /Resources 5 0 R + /MediaBox [ 0 0 300 200 ] + /Contents 8 0 R + /Annots [ 4 0 R 9 0 R ] +>> +endobj +{{object 4 0}} << + /Type /Annot + /FT /Tx + /T (SharedField) + /DA (0 0 0 rg /F1 12 Tf) + /Rect [ 100 100 200 130 ] + /Subtype /Widget + /V (Hello, world) +>> +endobj +{{object 5 0}} << + /Font 6 0 R +>> +endobj +{{object 6 0}} << + /F1 7 0 R +>> +endobj +{{object 7 0}} << + /Type /Font + /Subtype /Type1 + /BaseFont /Helvetica +>> +endobj +{{object 8 0}} << +>> +stream +endstream +endobj +{{object 9 0}} << + /Type /Annot + /FT /Tx + /T (SharedField) + /DA (0 0 0 rg /F1 12 Tf) + /Rect [ 100 40 200 70 ] + /Subtype /Widget + /V () +>> +endobj +{{xref}} +trailer << + /Root 1 0 R + /Size 10 +>> +{{startxref}} +%%EOF diff --git a/testing/resources/pixel/bug_733528_expected.pdf.0.png b/testing/resources/pixel/bug_733528_expected.pdf.0.png Binary files differnew file mode 100644 index 0000000000..cdd39c1434 --- /dev/null +++ b/testing/resources/pixel/bug_733528_expected.pdf.0.png diff --git a/testing/resources/pixel/bug_733528_expected_mac.pdf.0.png b/testing/resources/pixel/bug_733528_expected_mac.pdf.0.png Binary files differnew file mode 100644 index 0000000000..f7c8302b1e --- /dev/null +++ b/testing/resources/pixel/bug_733528_expected_mac.pdf.0.png |