From bef955a971d52fa0adc1c080376e5201c28927ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 19 Mar 2008 22:28:28 +0000 Subject: [PATCH] save a few more cycles git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23841 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiSymbols.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/frontends/qt4/GuiSymbols.cpp b/src/frontends/qt4/GuiSymbols.cpp index 099dd35d05..192b4db3c6 100644 --- a/src/frontends/qt4/GuiSymbols.cpp +++ b/src/frontends/qt4/GuiSymbols.cpp @@ -146,13 +146,6 @@ UnicodeBlocks unicode_blocks[] = { const int no_blocks = sizeof(unicode_blocks) / sizeof(UnicodeBlocks); -QLatin1String getCodePoint(char_type c) -{ - static char buf[10]; - sprintf(buf, "0x%04x", c); - return QLatin1String(buf); -} - } // namespace anon @@ -302,6 +295,10 @@ void GuiSymbols::updateSymbolList(bool update_combo) } } + static char codeName[10]; + static QString const strCharacter = qt_("Character: "); + static QString const strCodePoint = qt_("Code Point: "); + SymbolsList::const_iterator const end = symbols_.end(); for (SymbolsList::const_iterator it = symbols_.begin(); it != end; ++it) { char_type c = *it; @@ -318,11 +315,10 @@ void GuiSymbols::updateSymbolList(bool update_combo) continue; QListWidgetItem * lwi = new QListWidgetItem(toqstr(c)); if (show_all || c >= range_start && c <= range_end) { + sprintf(codeName, "0x%04x", c); lwi->setTextAlignment(Qt::AlignCenter); - lwi->setToolTip( - qt_("Character: ") + toqstr(c) + '\n' + - qt_("Code Point: ") + getCodePoint(c) - ); + lwi->setToolTip(strCharacter + toqstr(c) + '\n' + + strCodePoint + QLatin1String(codeName)); symbolsLW->addItem(lwi); } if (update_combo) {