Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 374450 Details for
Bug 507002
kde-base/kdelibs-4.11.5: KLineEdit with squeezed text enabled can cause endless loop
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
upstream patch to fix the problem
changeset_red9aa998c439a086ed82b925dc4bfcbf009cdcf2.diff (text/plain), 2.01 KB, created by
Israel G. Lugo
on 2014-04-07 03:26:53 UTC
(
hide
)
Description:
upstream patch to fix the problem
Filename:
MIME Type:
Creator:
Israel G. Lugo
Created:
2014-04-07 03:26:53 UTC
Size:
2.01 KB
patch
obsolete
>commit ed9aa998c439a086ed82b925dc4bfcbf009cdcf2 >Author: Axel Arnold <arnolda747@gmail.com> >Date: Sat Dec 21 01:34:11 2013 +0100 > > fix endless loop in KLineEdit->setSqueezedText() > > If KLineEdit has squeezed text enabled, but the widget has still zero width, KLineEdit::setSqueezedText() can go into an endless loop trying to remove more than all letters from the string. This patch fixes both this underrun and the corresponding possible overrun if the squeezed text is too small. The underrun is responsible for endless loops in digikam, see the corresponding bug report. > > REVIEW: 114519 > BUG: 328263 > >diff --git a/src/klineedit.cpp b/src/klineedit.cpp >index ab9369d..73e91df 100644 >--- a/src/klineedit.cpp >+++ b/src/klineedit.cpp >@@ -566,6 +566,7 @@ void KLineEdit::setSqueezedText() > d->squeezedStart = 0; > d->squeezedEnd = 0; > const QString fullText = d->squeezedText; >+ const int fullLength = fullText.length(); > const QFontMetrics fm(fontMetrics()); > const int labelWidth = size().width() - 2 * style()->pixelMetric(QStyle::PM_DefaultFrameWidth) - 2; > const int textWidth = fm.width(fullText); >@@ -587,7 +588,7 @@ void KLineEdit::setSqueezedText() > letters++; > squeezedText = fullText.left(letters) + "..." + fullText.right(letters); > squeezedWidth = fm.width(squeezedText); >- } while (squeezedWidth < labelWidth); >+ } while (squeezedWidth < labelWidth && letters <= fullLength / 2); > letters--; > squeezedText = fullText.left(letters) + "..." + fullText.right(letters); > } else if (squeezedWidth > labelWidth) { >@@ -597,7 +598,7 @@ void KLineEdit::setSqueezedText() > letters--; > squeezedText = fullText.left(letters) + "..." + fullText.right(letters); > squeezedWidth = fm.width(squeezedText); >- } while (squeezedWidth > labelWidth); >+ } while (squeezedWidth > labelWidth && letters >= 5); > } > > if (letters < 5) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 507002
: 374450