Changeset 40 for trunk


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

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/BIN/Lucide.lng

    r34 r40  
    1818MENU_EDIT=~Edit
    1919MENU_COPY=Copy\tCtrl+Insert
    20 MENU_SELECT_ALL=Select all
     20MENU_SELECT_ALL=Select all\tCtrl+/
    2121MENU_FIND=Find...\tCtrl+F
    2222MENU_FINDAGAIN=Find again\tCtrl+G
  • trunk/Lucide/SOURCE/gui/Lucide.rc

    r34 r40  
    8585    "C", CM_COPY, CONTROL
    8686    "c", CM_COPY, CONTROL
     87    "/", CM_SELECTALL, CONTROL
     88    "A", CM_SELECTALL, CONTROL
    8789    VK_INSERT, CM_COPY, VIRTUALKEY, CONTROL
    8890    "F", CM_FIND, CONTROL
  • 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
  • trunk/Lucide/SOURCE/gui/docViewer.h

    r35 r40  
    7171        double getZoom() { return zoom; }
    7272        double getRealZoom() { return realzoom; }
     73        void selectAll();
    7374        void copyToClipbrd();
    7475        void searchDocument( const char *_searchString, bool _caseSensitive,
  • trunk/Lucide/SOURCE/gui/lucide.cpp

    r35 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 *
     
    244244        WinEnableMenuItem( hWndMenu, CM_ROTATE90CW, FALSE );
    245245        WinEnableMenuItem( hWndMenu, CM_ROTATE90CCW, FALSE );
    246         //WinEnableMenuItem( hWndMenu, CM_NAVPANE, FALSE );
    247         //WinSendMsg( hToolBar, TBM_ENABLEITEM, MPFROMSHORT(CM_NAVPANE), (MPARAM)FALSE );
    248246        WinEnableMenuItem( hWndMenu, CM_SINGLEPAGE, FALSE );
    249247        WinEnableMenuItem( hWndMenu, CM_CONTINUOUS, FALSE );
     
    265263    WinEnableMenuItem( hWndMenu, CM_FIND, haveText );
    266264    WinSendMsg( hToolBar, TBM_ENABLEITEM, MPFROMSHORT(CM_FIND), (MPARAM)haveText );
     265    WinEnableMenuItem( hWndMenu, CM_SELECTALL, haveText );
    267266
    268267    WinEnableMenuItem( hWndMenu, CM_SINGLEPAGE, TRUE );
     
    582581                    return (MRESULT)FALSE;
    583582
     583                case CM_SELECTALL:
     584                    docViewer->selectAll();
     585                    return (MRESULT)FALSE;
     586
    584587                case CM_FIND:
    585588                    if ( findDlg->showDialog() == DID_OK ) {
  • trunk/Lucide/SOURCE/plugins/ludoc/cpconv.cpp

    r37 r40  
    3333
    3434
     35#define INCL_DOS
    3536#include <os2.h>
    3637
     
    182183
    183184    sl =  *in_left;
    184     ucs = new UniChar[ sl ];
     185    //ucs = new UniChar[ sl ];
     186    // have crashes in libc memmanager due to frequent alloc/free
     187    // use system malloc routines as workaround
     188    DosAllocMem( (PPVOID)&ucs, sl * sizeof( UniChar ), fALLOC );
    185189    orig_ucs = ucs;
    186190
    187191    rc = UniUconvToUcs( objtoucs, (void **)in, in_left, &ucs, &sl, &retval );
    188192    if ( rc != 0 ) {
    189         delete ucs;
     193        //delete ucs;
     194        DosFreeMem( ucs );
    190195        err = 1;
    191196        return -1;
     
    195200    ucs = orig_ucs;
    196201    rc = UniUconvFromUcs( objfromucs, &ucs, &sl, (void **)out, out_left, &nonid );
    197     delete ucs;
     202    //delete ucs;
     203    DosFreeMem( ucs );
    198204
    199205    if ( rc != 0 ) {
  • trunk/poppler/mypoppler/poppler/Makefile

    r31 r40  
    1818OBJS4 = TextOutputDev.obj PageLabelInfo.obj SecurityHandler.obj \
    1919        XpdfPluginAPI.obj UGooString.obj DCTStream.obj
     20       
     21# DCTStream.obj
    2022
    2123all: $(LIBS)
Note: See TracChangeset for help on using the changeset viewer.