Diffstat (limited to 'noncore/apps/opie-reader/striphtml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/striphtml.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/striphtml.cpp b/noncore/apps/opie-reader/striphtml.cpp index 9cd6a0d..e86402b 100644 --- a/noncore/apps/opie-reader/striphtml.cpp +++ b/noncore/apps/opie-reader/striphtml.cpp | |||
@@ -1,53 +1,52 @@ | |||
1 | #include <qmap.h> | 1 | #include <qmap.h> |
2 | #include <qfileinfo.h> | 2 | #include <qfileinfo.h> |
3 | #include <qtextstream.h> | 3 | #include <qtextstream.h> |
4 | #include <qdir.h> | 4 | #include <qdir.h> |
5 | #include "useqpe.h" | ||
6 | #ifdef USEQPE | 5 | #ifdef USEQPE |
7 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
8 | #endif | 7 | #endif |
9 | #include "CDrawBuffer.h" | 8 | #include "CDrawBuffer.h" |
10 | #include "striphtml.h" | 9 | #include "striphtml.h" |
11 | #include "hrule.h" | 10 | #include "hrule.h" |
12 | #include "util.h" | 11 | #include "util.h" |
13 | 12 | ||
14 | #include <qregexp.h> | 13 | #include <qregexp.h> |
15 | #include <qimage.h> | 14 | #include <qimage.h> |
16 | #include <qpixmap.h> | 15 | #include <qpixmap.h> |
17 | //#include <qprogressdialog.h> | 16 | //#include <qprogressdialog.h> |
18 | //#include <qapplication.h> | 17 | //#include <qapplication.h> |
19 | 18 | ||
20 | static unsigned char h2i(unsigned char c) | 19 | static unsigned char h2i(unsigned char c) |
21 | { | 20 | { |
22 | unsigned char ret = 0; | 21 | unsigned char ret = 0; |
23 | if ('0' <= c && c <= '9') | 22 | if ('0' <= c && c <= '9') |
24 | { | 23 | { |
25 | ret = c - '0'; | 24 | ret = c - '0'; |
26 | } | 25 | } |
27 | else if ('a' <= c && c <= 'f') | 26 | else if ('a' <= c && c <= 'f') |
28 | { | 27 | { |
29 | ret = c - 'a' + 10; | 28 | ret = c - 'a' + 10; |
30 | } | 29 | } |
31 | return ret; | 30 | return ret; |
32 | } | 31 | } |
33 | 32 | ||
34 | static void parse_color(const QString& attr, unsigned char& r, unsigned char& g, unsigned char& b) | 33 | static void parse_color(const QString& attr, unsigned char& r, unsigned char& g, unsigned char& b) |
35 | { | 34 | { |
36 | r = g = b = 0; | 35 | r = g = b = 0; |
37 | if (attr.length() >= 7 && attr[0] == '#') | 36 | if (attr.length() >= 7 && attr[0] == '#') |
38 | { | 37 | { |
39 | r = h2i(attr[1].unicode()); | 38 | r = h2i(attr[1].unicode()); |
40 | r = 16*r + h2i(attr[2].unicode()); | 39 | r = 16*r + h2i(attr[2].unicode()); |
41 | g = h2i(attr[3].unicode()); | 40 | g = h2i(attr[3].unicode()); |
42 | g = 16*g + h2i(attr[4].unicode()); | 41 | g = 16*g + h2i(attr[4].unicode()); |
43 | b = h2i(attr[5].unicode()); | 42 | b = h2i(attr[5].unicode()); |
44 | b = 16*b + h2i(attr[6].unicode()); | 43 | b = 16*b + h2i(attr[6].unicode()); |
45 | } | 44 | } |
46 | else if (attr == "red") | 45 | else if (attr == "red") |
47 | { | 46 | { |
48 | r = 255; | 47 | r = 255; |
49 | } | 48 | } |
50 | else if (attr == "green") | 49 | else if (attr == "green") |
51 | { | 50 | { |
52 | g = 255; | 51 | g = 255; |
53 | } | 52 | } |