Bug 152349 - "Select font" dialog window wrong max size value
Summary: "Select font" dialog window wrong max size value
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-15 12:16 UTC by FiNeX
Modified: 2007-11-16 20:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
"font select" dialog size value problem (115.50 KB, image/jpeg)
2007-11-15 12:17 UTC, FiNeX
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FiNeX 2007-11-15 12:16:39 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

The "select font" dialog show a slider with max value 128, and the list below is max 64. Them should have the same value instead!
Comment 1 FiNeX 2007-11-15 12:17:18 UTC
Created attachment 22072 [details]
"font select" dialog size value problem
Comment 2 Anne-Marie Mahfouf 2007-11-15 14:35:52 UTC
possible patch

Index: kfontchooser.cpp
===================================================================
--- kfontchooser.cpp	(revision 736512)
+++ kfontchooser.cpp	(working copy)
@@ -426,7 +426,7 @@
             16, 17, 18, 19,
             20, 22, 24, 26,
             28, 32, 48, 64,
-            0
+            128
         };
     for(int i = 0; c[i]; ++i)
     {
Comment 3 David Faure 2007-11-15 14:42:49 UTC
>      for(int i = 0; c[i]; ++i)

The end condition c[i] indicates that the array should end with a zero, otherwise
the loop will go into unknown territories (out of the array)...
Comment 4 Anne-Marie Mahfouf 2007-11-15 15:02:48 UTC
Ok for the 0, my bad. In fact it would be better to have:

static const int c[] =
        {
            4,  5,  6,  7,
            8,  9,  10, 11,
            12, 13, 14, 15,
            16, 17, 18, 19,
            20, 22, 24, 26,
            28, 32, 48, 64,
            72, 80, 96, 128,
            0
        };
Comment 5 FiNeX 2007-11-15 15:11:58 UTC
Ok, this work. :-)
Comment 6 Anne-Marie Mahfouf 2007-11-16 20:55:00 UTC
SVN commit 737628 by annma:

the list should have the same maximum as the slider
BUG:152349


 M  +2 -1      kfontchooser.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=737628