a/src/qtgui/preview_w.cpp b/src/qtgui/preview_w.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.11 2006-12-19 08:40:50 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.12 2006-12-20 13:55:46 dockes Exp $ (C) 2005 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
205
// false, the search string has been modified, we search for the new string, 
205
// false, the search string has been modified, we search for the new string, 
206
// starting from the current position
206
// starting from the current position
207
void Preview::doSearch(const QString &text, bool next, bool reverse, 
207
void Preview::doSearch(const QString &text, bool next, bool reverse, 
208
               bool wordOnly)
208
               bool wordOnly)
209
{
209
{
210
    LOGDEB1(("Preview::doSearch: next %d rev %d\n", int(next), int(reverse)));
210
    LOGDEB1(("Preview::doSearch: [%s] next %d rev %d\n", 
211
      (const char *)text.utf8(), int(next), int(reverse)));
212
    if (text.isEmpty())
213
  return;
211
    QTextEdit *edit = getCurrentEditor();
214
    QTextEdit *edit = getCurrentEditor();
212
    if (edit == 0) {
215
    if (edit == 0) {
213
    // ??
216
    // ??
214
    return;
217
    return;
215
    }
218
    }
...
...
682
    LOGDEB2(("Calling scrolltoanchor [%s]\n", (const char *)aname.utf8()));
685
    LOGDEB2(("Calling scrolltoanchor [%s]\n", (const char *)aname.utf8()));
683
    editor->scrollToAnchor(aname);
686
    editor->scrollToAnchor(aname);
684
#ifdef QT_SCROLL_TO_ANCHOR_BUG
687
#ifdef QT_SCROLL_TO_ANCHOR_BUG
685
    bool wasC = matchCheck->isChecked();
688
    bool wasC = matchCheck->isChecked();
686
    matchCheck->setChecked(false);
689
    matchCheck->setChecked(false);
690
  bool ocanbeep = canBeep;
691
  canBeep = false;
687
    doSearch(QString::fromUtf8(firstTermBeacon), 0, false, false);
692
    doSearch(QString::fromUtf8(firstTermBeacon), 0, false, false);
693
  canBeep = ocanbeep;
688
    editor->del();
694
    editor->del();
689
    matchCheck->setChecked(wasC);
695
    matchCheck->setChecked(wasC);
690
#endif
696
#endif
691
    }
697
    }
692
    emit(previewExposed(m_searchId, docnum));
698
    emit(previewExposed(m_searchId, docnum));