summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontmetrics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qfontmetrics.cpp')
-rw-r--r--src/gui/text/qfontmetrics.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 3e074a787..b3d1a5f63 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -859,24 +859,23 @@ QRect QFontMetrics::tightBoundingRect(const QString &text) const
right-to-left layouts, and on the left side for right-to-left
layouts. Note that this behavior is independent of the text
language.
-
*/
-QString QFontMetrics::elidedText(const QString &_text, Qt::TextElideMode mode, int width, int flags) const
+QString QFontMetrics::elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags) const
{
- QString text = _text;
+ QString _text = text;
if (!(flags & Qt::TextLongestVariant)) {
int posA = 0;
- int posB = text.indexOf(QLatin1Char('\x9c'));
+ int posB = _text.indexOf(QLatin1Char('\x9c'));
while (posB >= 0) {
- QString portion = text.mid(posA, posB - posA);
+ QString portion = _text.mid(posA, posB - posA);
if (size(flags, portion).width() <= width)
return portion;
posA = posB + 1;
- posB = text.indexOf(QLatin1Char('\x9c'), posA);
+ posB = _text.indexOf(QLatin1Char('\x9c'), posA);
}
- text = text.mid(posA);
+ _text = _text.mid(posA);
}
- QStackTextEngine engine(text, QFont(d));
+ QStackTextEngine engine(_text, QFont(d));
return engine.elidedText(mode, width, flags);
}