From kde-commits Thu Sep 30 22:17:05 2004 From: Nicolas Goutte Date: Thu, 30 Sep 2004 22:17:05 +0000 To: kde-commits Subject: kdelibs/kdeui [POSSIBLY UNSAFE] Message-Id: <20040930221705.651D49961 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109658263514916 CVS commit by goutte: - use the technically correct term "Unicode code point" (Well, I still do not really know, it would be so easy if in Unicode "code value" would have not be a totally different meaning.) - show in the tooltip not only the code point in hexadecimal but also in decimal (can be useful sometimes) and the character of the codepoint (useful for fonts covering the code point but not defining it, so at least the user can see what that code point is supposed to be.) M +5 -4 kcharselect.cpp 1.37 [POSSIBLY UNSAFE: printf] --- kdelibs/kdeui/kcharselect.cpp #1.36:1.37 @@ -347,9 +347,10 @@ void KCharSelectTable::setToolTips() for( int j=0; j< numCols(); j++ ) { - QRect r( cellWidth()*j, cellHeight()*i, cellWidth(), cellHeight() ); + const QRect r( cellWidth()*j, cellHeight()*i, cellWidth(), cellHeight() ); QToolTip::remove(this,r); + const ushort uni = vTableNum * 256 + numCols()*i + j; QString s; - s.sprintf("%04X", vTableNum * 256 + numCols()*i + j); - QToolTip::add(this, r, i18n("Character code","Unicode code: U+%1").arg(s)); + s.sprintf( "%04X", uint( uni ) ); + QToolTip::add(this, r, i18n( "Character","Unicode code point: U+%1
(In decimal: %2)
(Character: %3)
" ).arg( s ).arg( uni ).arg( QChar( uni ) ) ); } } @@ -390,5 +391,5 @@ KCharSelect::KCharSelect( QWidget *paren connect( tableSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( tableChanged( int ) ) ); - QLabel *lUnicode = new QLabel( i18n( "&Unicode code:" ), bar ); + QLabel *lUnicode = new QLabel( i18n( "&Unicode code point:" ), bar ); lUnicode->resize( lUnicode->sizeHint() ); lUnicode->setAlignment( Qt::AlignRight | Qt::AlignVCenter );