Ignore:
Timestamp:
May 3, 2010, 10:34:50 PM (11 years ago)
Author:
Silvan Scherrer
Message:

fixes ticket:190

File:
1 edited

Legend:

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

    r439 r450  
    658658// perform search in document
    659659void DocumentViewer::searchDocument( const char *_searchString, bool _caseSensitive,
    660                                      bool _continueSearch )
     660                                     bool _continueSearch, bool _findBack )
    661661{
    662662    abortSearch = false;
     
    669669    caseSensitive = _caseSensitive;
    670670    continueSearch = _continueSearch;
     671    findBack = _findBack;
    671672
    672673    progressDlg->setBreakFunc( searchabort, this );
     
    691692
    692693    long i = _this->currentpage;
     694if (!_this->findBack) {
    693695    if ( _this->continueSearch && ( _this->currentpage < ( _this->totalpages - 1 ) ) ) {
    694696        i = _this->currentpage + 1;
    695697    }
     698} else {
     699    if ( _this->continueSearch && ( _this->currentpage >= 1 ) ) {
     700        i = _this->currentpage - 1;
     701    }
     702}
    696703
    697704    bool found = false;
    698     for ( ; i < _this->totalpages; i++ )
     705    for ( ; _this->findBack ? i >=0 : i < _this->totalpages; _this->findBack ? i-- : i++ )
    699706    {
    700707        char *fmt = newstrdupL( FIND_SEARCH_PAGE_OF );
     
    706713
    707714        _this->foundrects[ i ] = _this->doc->searchText( ev, i,
    708                                         (char *)_this->searchString, _this->caseSensitive );
     715                                        (char *)_this->searchString, _this->caseSensitive, _this->findBack );
    709716        if ( _this->foundrects[ i ] != NULL )
    710717        {
Note: See TracChangeset for help on using the changeset viewer.