D21202: Added basic JavaScript functions to support animated PDF
Pino Toscano
noreply at phabricator.kde.org
Thu May 16 07:27:18 BST 2019
pino added inline comments.
INLINE COMMENTS
> kjs_document.cpp:275-286
> + for ( Page * pIt : doc->m_pagesVector )
> + {
> + const QLinkedList< Okular::FormField * > pageFields = pIt->formFields();
> + for( Okular::FormField *ffIt : pageFields )
> + {
> + if(numField == 0)
> + {
This convoluted for loop basically get the i-th element of a QLinkedList, which is not designed for index accessing (and that is why there is no at(int) method).
IMHO a better way is:
- get the list of form fields
- compare the wanted index with the count of the form fields: if it is out of boundaries, return KJSUndefined directly
- otherwise, create an iterator fromthe begin, and increment it by the wanted index to get to the wanted element
REPOSITORY
R223 Okular
REVISION DETAIL
https://phabricator.kde.org/D21202
To: joaonetto, aacid, #okular
Cc: pino, anthonyfieroni, sander, okular-devel, joaonetto, tfella, ngraham, darcyshen, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20190516/8b7bcc2b/attachment.html>
More information about the Okular-devel
mailing list