walking the search terms hits backwards would go forward

This commit is contained in:
dockes 2008-04-18 11:38:56 +00:00
parent c0abff1421
commit 7c8df638cb

View File

@ -1,5 +1,5 @@
#ifndef lint #ifndef lint
static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.31 2007-11-15 18:44:51 dockes Exp $ (C) 2005 J.F.Dockes"; static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.32 2008-04-18 11:38:56 dockes Exp $ (C) 2005 J.F.Dockes";
#endif #endif
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -342,10 +342,17 @@ void Preview::doSearch(const QString &_text, bool next, bool reverse,
if (text.isEmpty()) { if (text.isEmpty()) {
if (m_haveAnchors == false) if (m_haveAnchors == false)
return; return;
if (m_curAnchor == m_lastAnchor) if (reverse) {
m_curAnchor = 1; if (m_curAnchor == 1)
else m_curAnchor = m_lastAnchor;
m_curAnchor++; else
m_curAnchor--;
} else {
if (m_curAnchor == m_lastAnchor)
m_curAnchor = 1;
else
m_curAnchor++;
}
QString aname = QString aname =
QString::fromUtf8(termAnchorName(m_curAnchor).c_str()); QString::fromUtf8(termAnchorName(m_curAnchor).c_str());
edit->moveToAnchor(aname); edit->moveToAnchor(aname);