Summary: | HTML composing disables bold and italic depending on font | ||
---|---|---|---|
Product: | [Applications] kmail | Reporter: | mi+kde |
Component: | composer | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.7.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | FreeBSD | ||
Latest Commit: | Version Fixed In: |
Description
mi+kde
2004-12-16 17:59:11 UTC
Kmail Version : 1.9.1 (KDE 3.5.2, Kubuntu Package 4:3.5.2-0ubuntu0 breezy) Operating System : Linux (i686) release 2.6.12-10-k7 Compiler : Target: i486-linux-gnu Bug n°105340 is an example of this bug. I have no problem with Arial font, but if I use the standard font "Bitstream Vera", I only can use the italic button one time, after it's grayed, and then, if I use "Ctrl+i" instead of the grayed italic button, kmail delete the text selected... If I use other fonts, sometimes exotic (Comic Sans MS, Balzano, Baskerville, Footlight, Amaze...) some button are grayed since the beginning (often italic and bold button). SVN commit 571724 by winterz: Fix detection of bold and italics in fonts. BUGS: 105340,95276 M +9 -7 kmcomposewin.cpp --- branches/KDE/3.5/kdepim/kmail/kmcomposewin.cpp #571723:571724 @@ -4614,18 +4614,21 @@ void KMComposeWin::fontChanged( const QFont &f ) { - QFontDatabase *fontdb = new QFontDatabase(); + QFont fontTemp = f; + fontTemp.setBold( true ); + fontTemp.setItalic( true ); + QFontInfo fontInfo( fontTemp ); - if ( fontdb->bold( f.family(), "Bold" ) ) { - textBoldAction->setChecked( f.bold() ); // if the user has the default font with bold, then show it in the buttonstate - textBoldAction->setEnabled( true ); + if ( fontInfo.bold() ) { + textBoldAction->setChecked( f.bold() ); + textBoldAction->setEnabled( true ) ; } else { textBoldAction->setEnabled( false ); } - if ( fontdb->italic( f.family(), "Italic" ) ) { + if ( fontInfo.italic() ) { textItalicAction->setChecked( f.italic() ); - textItalicAction->setEnabled( true ); + textItalicAction->setEnabled( true ) ; } else { textItalicAction->setEnabled( false ); } @@ -4634,7 +4637,6 @@ fontAction->setFont( f.family() ); fontSizeAction->setFontSize( f.pointSize() ); - delete fontdb; } void KMComposeWin::alignmentChanged( int a ) |