[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kdeui [POSSIBLY UNSAFE]
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2004-09-30 22:17:05
Message-ID: 20040930221705.651D49961 () office ! kde ! org
[Download RAW message or body]

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","<qt>Unicode code point: \
U+%1<br>(In decimal: %2)<br>(Character: %3)</qt>" ).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 );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic