Ignore:
Timestamp:
Nov 11, 2006, 9:39:04 AM (15 years ago)
Author:
Eugene Romanenko
Message:

Writes into EA thumbnail of first page of document

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/lucide.cpp

    r152 r153  
    109109bool         Lucide::docLoaded                     = false;;
    110110char        *Lucide::loadError                     = NULL;
     111void        *Lucide::thumbnailData                 = NULL;
     112int          Lucide::thumbnailDataLen              = 0;
     113
    111114
    112115HMODULE _hmod = NULLHANDLE;
     
    337340
    338341
     342void Lucide::closeDocument()
     343{
     344    docViewer->close();
     345    delete doc;
     346    doc = NULL;
     347    WinSetWindowText( hWndFrame, title );
     348
     349    if ( thumbnailData != NULL ) {
     350        writeThumbnail( docFullName );
     351        delete thumbnailData;
     352        thumbnailData = NULL;
     353        thumbnailDataLen = 0;
     354    }
     355}
     356
    339357void Lucide::loadthread( void *p )
    340358{
     
    343361
    344362    docLoaded = doc->loadFile( ev, docFullName, NULL, &loadError );
     363    if ( docLoaded ) {
     364        if ( doc->isCreateFileThumbnail( ev ) && isThumbNeeded( docFullName ) ) {
     365            loadProgressDlg->setText( getLocalizedString( MSGS_CREATING_THUMBNAIL ).c_str() );
     366            createThumbnail( doc );
     367        }
     368    }
    345369    loadProgressDlg->hide();
    346370
     
    370394        else
    371395        {
    372             docViewer->close();
    373             delete doc;
    374             doc = NULL;
    375             WinSetWindowText( hWndFrame, title );
     396            closeDocument();
    376397
    377398            doc = pluginMan->createDocumentForExt( ext + 1, false );
     
    953974    WinDestroyWindow( hWndFrame );
    954975
     976    Lucide::closeDocument();
    955977    delete docViewer;
    956978    delete indexWin;
    957     // must be freed _before_ plugin manager
    958     delete doc;
     979
    959980    // must be freed _after_ document
    960981    delete pluginMan;
Note: See TracChangeset for help on using the changeset viewer.