Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisplayCapabilities ImageFields parameter is of type TextField #1

Closed
mikeburke106 opened this issue Oct 9, 2014 · 1 comment
Closed
Labels
bug A defect in the library

Comments

@mikeburke106
Copy link
Contributor

Appears to be a copy/paste error.

getImageFields() should return a list of ImageField objects, not TextField objects. Similarly, setImageFields() should take a list of ImageField objects, not TextField objects.

public Vector<TextField> getImageFields() {
    if (store.get(Names.imageFields) instanceof Vector<?>) {
        Vector<?> list = (Vector<?>)store.get(Names.imageFields);
        if (list != null && list.size() > 0) {
            Object obj = list.get(0);
            if (obj instanceof TextField) {
                return (Vector<TextField>) list;
            } else if (obj instanceof Hashtable) {
                Vector<TextField> newList = new Vector<TextField>();
                for (Object hashObj : list) {
                    newList.add(new TextField((Hashtable)hashObj));
                }
                return newList;
            }
        }
    }
    return null;
}

public void setImageFields( Vector<TextField> imageFields ) {
    if (imageFields != null) {
        store.put(Names.imageFields, imageFields );
    }
    else
    {
        store.remove(Names.imageFields);
    }
}
@joeygrover joeygrover added the bug A defect in the library label Oct 9, 2014
mikeburke106 pushed a commit to mikeburke106/sdl_android that referenced this issue Oct 9, 2014
Signed-off-by: Mike Burke <mike@livioconnect.com>
This was referenced Oct 9, 2014
@mikeburke106
Copy link
Contributor Author

Fixed as part of the Hotfix pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants