mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-02 14:14:10 +00:00
Fix crash when searching backwards
When searching backwards end is not actually words.end but words.begin (since the loop goes backwards) hence we can't pass end to stringLengthAdaptedWithHyphen I've now renamed end to loop_end to make it a bit more clear. BUGS: 309030 FIXED-IN: 4.9.4
This commit is contained in:
parent
84be046806
commit
d59ffb4a7a
|
@ -953,7 +953,7 @@ RegularAreaRect* TextPagePrivate::findTextInternalBackward( int searchID, const
|
|||
Qt::CaseSensitivity caseSensitivity,
|
||||
TextComparisonFunction comparer,
|
||||
const TextList::ConstIterator &start,
|
||||
const TextList::ConstIterator &end )
|
||||
const TextList::ConstIterator &loop_end )
|
||||
{
|
||||
const QMatrix matrix = m_page ? m_page->rotationMatrix() : QMatrix();
|
||||
|
||||
|
@ -992,7 +992,7 @@ RegularAreaRect* TextPagePrivate::findTextInternalBackward( int searchID, const
|
|||
}
|
||||
else
|
||||
{
|
||||
len = stringLengthAdaptedWithHyphen(str, it, end, m_page);
|
||||
len = stringLengthAdaptedWithHyphen(str, it, m_words.constEnd(), m_page);
|
||||
int min=qMin(queryLeft,len);
|
||||
#ifdef DEBUG_TEXTPAGE
|
||||
kDebug(OkularDebug) << str.right(min) << " : " << _query.mid(j-min+1,min);
|
||||
|
@ -1057,7 +1057,7 @@ RegularAreaRect* TextPagePrivate::findTextInternalBackward( int searchID, const
|
|||
ret->simplify();
|
||||
return ret;
|
||||
}
|
||||
if ( it == end )
|
||||
if ( it == loop_end )
|
||||
break;
|
||||
else
|
||||
--it;
|
||||
|
|
Loading…
Reference in a new issue