From a36c3bf87b987ca6d56a4a8f4d7a2f33a01a1d36 Mon Sep 17 00:00:00 2001 From: Stefan Kebekus Date: Fri, 20 Dec 2002 23:52:16 +0000 Subject: [PATCH] bugfix: crash on backward search svn path=/trunk/kdegraphics/kdvi/; revision=195097 --- dviwin_textsearch.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dviwin_textsearch.cpp b/dviwin_textsearch.cpp index 2285051d4..92a35668b 100644 --- a/dviwin_textsearch.cpp +++ b/dviwin_textsearch.cpp @@ -90,7 +90,7 @@ void dviWindow::findNextText(void) // Go trough the text of the current page and search for the // string. - for(int i=DVIselection.selectedTextStart+1; i= 0) { // Restore the previous settings, including the current // page. Otherwise, the program is "smart enough" not to @@ -208,7 +208,6 @@ void dviWindow::findPrevText(void) } } - progress.setProgress( lastPageOfSearch - current_page ); qApp->processEvents(); if ( progress.wasCancelled() ) @@ -218,8 +217,8 @@ void dviWindow::findPrevText(void) // string. int i=DVIselection.selectedTextStart-1; if (i < 0) - i = textLinkList.size(); - do{ + i = textLinkList.size()-1; + while(i >= 0) { if (textLinkList[i].linkText.find(searchText, 0, case_sensitive) >= 0) { // Restore the previous settings, including the current // page. Otherwise, the program is "smart enough" not to @@ -233,7 +232,7 @@ void dviWindow::findPrevText(void) return; } i--; - }while(i >= 0); + } current_page--; DVIselection.clear(); foreGroundPaint.begin( &pixie );