Ignore:
Timestamp:
Jun 3, 2006, 4:37:09 PM (15 years ago)
Author:
Eugene Romanenko
Message:

implemented 'select all', fixes for crash in libc memanager

File:
1 edited

Legend:

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

    r36 r40  
    2222 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    2323 * in which case the provisions of the LGPL are applicable instead of those
    24  * above. If you wish to allow use of your version of this file only under the 
     24 * above. If you wish to allow use of your version of this file only under the
    2525 * terms of the LGPL, and not to allow others to use your version of this file
    2626 * under the terms of the CDDL, indicate your decision by deleting the
    2727 * provisions above and replace them with the notice and other provisions
    2828 * required by the LGPL. If you do not delete the provisions above, a recipient
    29  * may use your version of this file under the terms of any one of the CDDL 
     29 * may use your version of this file under the terms of any one of the CDDL
    3030 * or the LGPL.
    3131 *
     
    339339}
    340340
     341// select all text (continuous view) or current page (single page view)
     342void DocumentViewer::selectAll()
     343{
     344    if ( continuous )
     345    {
     346        for ( long i = 0; i < totalpages; i++ )
     347        {
     348            selection[ i ].x1 = 0;
     349            selection[ i ].y1 = 0;
     350            selection[ i ].x2 = pagesizes[ i ].x;
     351            selection[ i ].y2 = pagesizes[ i ].y;
     352            LuDocument::freeRectangles( ev, selrects[ i ] );
     353            selrects[ i ] = doc->getSelectionRectangles( ev, i, realzoom, &(selection[i]) );
     354        }
     355    }
     356    else
     357    {
     358        selection[ currentpage ].x1 = 0;
     359        selection[ currentpage ].y1 = 0;
     360        selection[ currentpage ].x2 = pagesizes[ currentpage ].x;
     361        selection[ currentpage ].y2 = pagesizes[ currentpage ].y;
     362        LuDocument::freeRectangles( ev, selrects[ currentpage ] );
     363        selrects[ currentpage ] = doc->getSelectionRectangles( ev, currentpage, realzoom, &(selection[currentpage]) );
     364    }
     365
     366    Lucide::enableCopy( true );
     367    WinInvalidateRect( hWndDoc, NULL, FALSE );
     368}
     369
    341370// perform search in document
    342371void DocumentViewer::searchDocument( const char *_searchString, bool _caseSensitive,
     
    455484void DocumentViewer::drawPage()
    456485{
    457     if ( continuous )
    458     {
    459         WinSendMsg( hWndDoc, WM_SIZE, MPFROM2SHORT( cxClient, cyClient ),
    460                     MPFROM2SHORT( cxClient, cyClient ) );
    461         WinInvalidateRect( hWndDoc, NULL, FALSE );
    462     }
    463     else
     486    if ( !continuous )
    464487    {
    465488        LuDocument::freeRectangles( ev, selrects[ currentpage ] );
     
    473496
    474497        Lucide::enableCopy( false );
    475         WinSendMsg( hWndDoc, WM_SIZE, MPFROM2SHORT( cxClient, cyClient ),
    476                     MPFROM2SHORT( cxClient, cyClient ) );
    477         WinInvalidateRect( hWndDoc, NULL, FALSE );
    478     }
     498    }
     499    WinSendMsg( hWndDoc, WM_SIZE, MPFROM2SHORT( cxClient, cyClient ),
     500                MPFROM2SHORT( cxClient, cyClient ) );
     501    WinInvalidateRect( hWndDoc, NULL, FALSE );
    479502}
    480503
Note: See TracChangeset for help on using the changeset viewer.