Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > cc8f970be8f3f9d917634bf75d52343e > files > 21

qt3-3.3.4-23mdk.src.rpm

qt-bugs@ issue : 
bugs.kde.org number :
applied: yes
author: Waldo Bastian <bastian@kde.org>

QTextEdit::zoomIn /QTextEdit::zoomOut does not work if the original
font had its size specified in pixels instead of points.
pointSize() returns 0 in such case.

Index: widgets/qtextedit.cpp
===================================================================
RCS file: /home/kde/qt-copy/src/widgets/qtextedit.cpp,v
retrieving revision 1.47
diff -u -p -r1.47 qtextedit.cpp
--- src/widgets/qtextedit.cpp	11 Aug 2004 14:21:18 -0000	1.47
+++ src/widgets/qtextedit.cpp	14 Oct 2004 14:10:12 -0000
@@ -5591,7 +5591,11 @@ void QTextEdit::setFont( const QFont &f 
 void QTextEdit::zoomIn( int range )
 {
     QFont f( QScrollView::font() );
-    f.setPointSize( QFontInfo(f).pointSize() + range );
+    QFontInfo fi(f);
+    if (fi.pointSize() <= 0)
+       f.setPixelSize( fi.pixelSize() + range );
+    else
+       f.setPointSize( fi.pointSize() + range );
     setFont( f );
 }
 
@@ -5606,7 +5610,11 @@ void QTextEdit::zoomIn( int range )
 void QTextEdit::zoomOut( int range )
 {
     QFont f( QScrollView::font() );
-    f.setPointSize( QMAX( 1, QFontInfo(f).pointSize() - range ) );
+    QFontInfo fi(f);
+    if (fi.pointSize() <= 0)
+       f.setPixelSize( QMAX( 1, fi.pixelSize() - range ) );
+    else
+       f.setPointSize( QMAX( 1, fi.pointSize() - range ) );
     setFont( f );
 }