Summary: | replace fails in block select mode depending on how selection was made | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Raphael <raphha2> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | opensource |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Raphael
2005-07-16 20:13:16 UTC
duplicate of bug #97140 ??? still present in KDE 3.5alpha on kubuntu hoary SVN commit 467566 by cullmann: next block selection search&replace bug BUG: 109183 M +26 -4 katesearch.cpp --- branches/KDE/3.5/kdelibs/kate/part/katesearch.cpp #467565:467566 @@ -274,7 +274,17 @@ { if( s.flags.selected ) { - s.cursor = s.flags.backward ? s.selEnd : s.selBegin; + KateTextCursor start (s.selBegin); + KateTextCursor end (s.selEnd); + + // recalc for block sel, to have start with lowest col, end with highest + if (m_view->blockSelectionMode()) + { + start.setCol (QMIN(s.selBegin.col(), s.selEnd.col())); + end.setCol (QMAX(s.selBegin.col(), s.selEnd.col())); + } + + s.cursor = s.flags.backward ? end : start; } else { @@ -591,12 +601,24 @@ if ( found && s.flags.selected ) { - if ( !s.flags.backward && KateTextCursor( foundLine, foundCol ) >= s.selEnd - || s.flags.backward && KateTextCursor( foundLine, foundCol ) < s.selBegin ) + KateTextCursor start (s.selBegin); + KateTextCursor end (s.selEnd); + + // recalc for block sel, to have start with lowest col, end with highest + if (m_view->blockSelectionMode()) + { + start.setCol (QMIN(s.selBegin.col(), s.selEnd.col())); + end.setCol (QMAX(s.selBegin.col(), s.selEnd.col())); + } + + if ( !s.flags.backward && KateTextCursor( foundLine, foundCol ) >= end + || s.flags.backward && KateTextCursor( foundLine, foundCol ) < start ) + { found = false; + } else if (m_view->blockSelectionMode()) { - if ((int)foundCol < QMAX(s.selEnd.col(), s.selBegin.col()) && (int)foundCol >= QMIN(s.selEnd.col(), s.selBegin.col())) + if ((int)foundCol >= start.col() && (int)foundCol < end.col()) break; } } |