-rw-r--r-- | noncore/apps/opie-reader/FontControl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/FontControl.h b/noncore/apps/opie-reader/FontControl.h index ed6c33f..d427680 100644 --- a/noncore/apps/opie-reader/FontControl.h +++ b/noncore/apps/opie-reader/FontControl.h | |||
@@ -76,46 +76,46 @@ class FontControl | |||
76 | bool increasesize() | 76 | bool increasesize() |
77 | { | 77 | { |
78 | if (++m_size >= m_maxsize) | 78 | if (++m_size >= m_maxsize) |
79 | { | 79 | { |
80 | m_size = m_maxsize - 1; | 80 | m_size = m_maxsize - 1; |
81 | return false; | 81 | return false; |
82 | } | 82 | } |
83 | else return true; | 83 | else return true; |
84 | } | 84 | } |
85 | bool ChangeFont(QString& n) | 85 | bool ChangeFont(QString& n) |
86 | { | 86 | { |
87 | return ChangeFont(n, currentsize()); | 87 | return ChangeFont(n, currentsize()); |
88 | } | 88 | } |
89 | bool ChangeFont(QString& n, int tgt) | 89 | bool ChangeFont(QString& n, int tgt) |
90 | { | 90 | { |
91 | QValueList<int>::Iterator it; | 91 | QValueList<int>::Iterator it; |
92 | QFontDatabase fdb; | 92 | QFontDatabase fdb; |
93 | QValueList<int> sizes = fdb.pointSizes(n); | 93 | QValueList<int> sizes = fdb.pointSizes(n); |
94 | if (sizes.count() == 0) | 94 | if (sizes.count() == 0) |
95 | { | 95 | { |
96 | return false; | 96 | return false; |
97 | } | 97 | } |
98 | else | 98 | else |
99 | { | 99 | { |
100 | m_fontname = n; | 100 | m_fontname = n; |
101 | m_maxsize = sizes.count(); | 101 | m_maxsize = sizes.count(); |
102 | if (m_fontsizes != NULL) delete [] m_fontsizes; | 102 | if (m_fontsizes != NULL) delete [] m_fontsizes; |
103 | m_fontsizes = new int[m_maxsize]; | 103 | m_fontsizes = new int[m_maxsize]; |
104 | uint i = 0; | 104 | uint i = 0; |
105 | uint best = 0; | 105 | uint best = 0; |
106 | for (it = sizes.begin(); it != sizes.end(); it++) | 106 | for (it = sizes.begin(); it != sizes.end(); it++) |
107 | { | 107 | { |
108 | m_fontsizes[i] = (*it)/10; | 108 | m_fontsizes[i] = (*it); |
109 | if (abs(tgt-m_fontsizes[i]) < abs(tgt-m_fontsizes[best])) | 109 | if (abs(tgt-m_fontsizes[i]) < abs(tgt-m_fontsizes[best])) |
110 | { | 110 | { |
111 | best = i; | 111 | best = i; |
112 | } | 112 | } |
113 | i++; | 113 | i++; |
114 | } | 114 | } |
115 | m_size = best; | 115 | m_size = best; |
116 | } | 116 | } |
117 | return true; | 117 | return true; |
118 | } | 118 | } |
119 | }; | 119 | }; |
120 | 120 | ||
121 | #endif | 121 | #endif |