Changeset 330


Ignore:
Timestamp:
Mar 31, 2010, 12:12:48 PM (12 years ago)
Author:
dmik
Message:

branches/kmk: Poppler: LuDocument::getInputFields: Return an empty sequence if there are no input fields to keep the old approach (originally used for links) working.

Location:
branches/kmk/Lucide/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/kmk/Lucide/plugins/ludoc/ludoc.cpp

    r321 r330  
    473473                                                                   long pagenum)
    474474{
    475     return NULL;
     475    // Abstract method, returns empty sequence
     476    LuDocument_LuInputFieldSequence *fields = NULL;
     477    fields = (LuDocument_LuInputFieldSequence *)SOMMalloc( sizeof( LuDocument_LuInputFieldSequence ) );
     478    fields->_maximum = 0;
     479    fields->_length = 0;
     480    fields->_buffer = NULL;
     481    return fields;
    476482}
    477483
  • branches/kmk/Lucide/plugins/lupoppler/lupoppler.cpp

    r329 r330  
    15061506    FormPageWidgets *widgets = page->getPageWidgets();
    15071507
    1508     int count;
    1509     if (widgets == NULL || (count = widgets->getNumWidgets()) <= 0)
    1510         return NULL;
    1511 
    15121508    LuDocument_LuInputFieldSequence *fields = (LuDocument_LuInputFieldSequence *)
    15131509        SOMMalloc( sizeof( LuDocument_LuInputFieldSequence ) );
     1510
     1511    int count;
     1512    if (widgets == NULL || (count = widgets->getNumWidgets()) <= 0) {
     1513        fields->_maximum = 0;
     1514        fields->_length = 0;
     1515        fields->_buffer = NULL;
     1516        return fields;
     1517    }
     1518
    15141519    fields->_maximum = count;
    15151520    fields->_length = count;
Note: See TracChangeset for help on using the changeset viewer.