[ 
https://issues.apache.org/jira/browse/PDFBOX-2459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14545202#comment-14545202
 ] 

Tilman Hausherr commented on PDFBOX-2459:
-----------------------------------------

This fixes the first regression. However this code
{code}
public List<PDAnnotationWidget> getWidgets()
    {
        List<PDAnnotationWidget> widgets = new ArrayList<PDAnnotationWidget>();
        COSArray kids = (COSArray)dictionary.getDictionaryObject(COSName.KIDS);
        if (kids == null)
        {
            // the field itself is a widget
            widgets.add(new PDAnnotationWidget(dictionary));
        }
        else if (kids.size() > 0)
        {
            // there are multiple widgets
            for (int i = 0; i < kids.size(); i++)
            {
                COSBase kid = kids.getObject(i);
                if (kid instanceof COSDictionary)
                {
                    widgets.add(new PDAnnotationWidget((COSDictionary)kid));
                }
            }
        }
        return widgets;
    }
{code}
would still return an empty list if the kids are not dictionaries.

> Share functionality between Page Tree and Field Tree
> ----------------------------------------------------
>
>                 Key: PDFBOX-2459
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2459
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>    Affects Versions: 2.0.0
>            Reporter: Maruan Sahyoun
>            Assignee: John Hewson
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: 001511.pdf, 004324.pdf
>
>
> The PDFs page tree and AcroForms field tree share some common functionality 
> e.g. resolving inheritable attributes, iterating through leafs and such which 
> could be combined into a PDTree class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to