Changeset 357


Ignore:
Timestamp:
Apr 3, 2010, 10:43:48 PM (12 years ago)
Author:
dmik
Message:

branches/kmk: Poppler plugin: Fixed: Crash on switching the PDF with no input fields to Continuous mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/kmk/Lucide/gui/docViewer.cpp

    r355 r357  
    12261226
    12271227            // load links for page if not loaded before
    1228             if ( links[ pda->pagenum ] == NULL ) {
    1229                 links[ pda->pagenum ] = doc->getLinkMapping( ev, pda->pagenum );
     1228            if ( links != NULL ) {
     1229                if ( links[ pda->pagenum ] == NULL ) {
     1230                    links[ pda->pagenum ] = doc->getLinkMapping( ev, pda->pagenum );
     1231                }
    12301232            }
    12311233
    12321234            // load input fields for page if not loaded before
    1233             if ( inputFields[ pda->pagenum ].fields == NULL ) {
    1234                 inputFields[ pda->pagenum ].fields = doc->getInputFields( ev, pda->pagenum );
    1235                 unsigned long len = inputFields[ pda->pagenum ].fields->_length;
    1236                 inputFields[ pda->pagenum ].cache = new PageInputFields::Cache[ len ];
    1237                 memset( inputFields[ pda->pagenum ].cache, 0, sizeof( PageInputFields::Cache ) * len );
     1235            if ( inputFields != NULL ) {
     1236                if ( inputFields[ pda->pagenum ].fields == NULL ) {
     1237                    inputFields[ pda->pagenum ].fields = doc->getInputFields( ev, pda->pagenum );
     1238                    unsigned long len = inputFields[ pda->pagenum ].fields->_length;
     1239                    inputFields[ pda->pagenum ].cache = new PageInputFields::Cache[ len ];
     1240                    memset( inputFields[ pda->pagenum ].cache, 0, sizeof( PageInputFields::Cache ) * len );
     1241                }
    12381242            }
    12391243        }
     
    15691573
    15701574            // load links for page if not loaded before
    1571             if ( links[ pda->pagenum ] == NULL ) {
    1572                 links[ pda->pagenum ] = doc->getLinkMapping( ev, pda->pagenum );
     1575            if ( links != NULL ) {
     1576                if ( links[ pda->pagenum ] == NULL ) {
     1577                    links[ pda->pagenum ] = doc->getLinkMapping( ev, pda->pagenum );
     1578                }
    15731579            }
    15741580
    15751581            // load input fields for page if not loaded before
    1576             if ( inputFields[ pda->pagenum ].fields == NULL ) {
    1577                 inputFields[ pda->pagenum ].fields = doc->getInputFields( ev, pda->pagenum );
    1578                 unsigned long len = inputFields[ pda->pagenum ].fields->_length;
    1579                 inputFields[ pda->pagenum ].cache = new PageInputFields::Cache[ len ];
    1580                 memset( inputFields[ pda->pagenum ].cache, 0, sizeof( PageInputFields::Cache ) * len );
     1582            if ( inputFields != NULL ) {
     1583                if ( inputFields[ pda->pagenum ].fields == NULL ) {
     1584                    inputFields[ pda->pagenum ].fields = doc->getInputFields( ev, pda->pagenum );
     1585                    unsigned long len = inputFields[ pda->pagenum ].fields->_length;
     1586                    inputFields[ pda->pagenum ].cache = new PageInputFields::Cache[ len ];
     1587                    memset( inputFields[ pda->pagenum ].cache, 0, sizeof( PageInputFields::Cache ) * len );
     1588                }
    15811589            }
    15821590
Note: See TracChangeset for help on using the changeset viewer.