summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/StyleConsts.cpp
authorllornkcor <llornkcor>2002-12-20 01:35:01 (UTC)
committer llornkcor <llornkcor>2002-12-20 01:35:01 (UTC)
commit876e1a4724a7bd75dc642e295de354241096e028 (patch) (unidiff)
treea37c5dcc9d78e04bb6b859ab89d8cf81e6745087 /noncore/apps/opie-reader/StyleConsts.cpp
parent5fd6636ba3d94b48dd543887316c47c5388a43c2 (diff)
downloadopie-876e1a4724a7bd75dc642e295de354241096e028.zip
opie-876e1a4724a7bd75dc642e295de354241096e028.tar.gz
opie-876e1a4724a7bd75dc642e295de354241096e028.tar.bz2
update - sorry it took so long. hope this works correctly
Diffstat (limited to 'noncore/apps/opie-reader/StyleConsts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/StyleConsts.cpp99
1 files changed, 99 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/StyleConsts.cpp b/noncore/apps/opie-reader/StyleConsts.cpp
new file mode 100644
index 0000000..e111dbd
--- a/dev/null
+++ b/noncore/apps/opie-reader/StyleConsts.cpp
@@ -0,0 +1,99 @@
1
2#include <qpixmap.h>
3#include "StyleConsts.h"
4
5GraphicLink::~GraphicLink() { delete graphic; }
6
7pmstore::~pmstore()
8{
9// qDebug("Deleting image");
10 delete graphic;
11}
12
13CStyle::~CStyle()
14{
15 if (graphic != NULL)
16 {
17 if (--(graphic->count) == 0)
18 {
19 delete graphic;
20 }
21 }
22}
23
24CStyle::CStyle(CStyle& rhs) : graphic(NULL)
25{
26 *this = rhs;
27}
28
29CStyle::CStyle(const CStyle& rhs) : graphic(NULL)
30{
31 *this = rhs;
32}
33
34CStyle& CStyle::operator=(const CStyle& rhs)
35{
36 if (rhs.graphic != NULL)
37 {
38 (rhs.graphic->count)++;
39 if (graphic != NULL)
40 {
41 if (--(graphic->count) == 0)
42 {
43 delete graphic;
44 }
45 }
46 graphic = rhs.graphic;
47 }
48 else
49 {
50 if (graphic != NULL)
51 {
52 if (--(graphic->count) == 0)
53 {
54 delete graphic;
55 }
56 graphic = NULL;
57 }
58 }
59 sty = rhs.sty;
60 return *this;
61}
62
63void CStyle::clearPicture()
64{
65 if (graphic != NULL)
66 {
67 if (--(graphic->count) == 0)
68 {
69 delete graphic;
70 }
71 graphic = NULL;
72 }
73}
74
75void CStyle::unset()
76{
77 sty.unset();
78 if (graphic != NULL)
79 {
80 if (--(graphic->count) == 0)
81 {
82 delete graphic;
83 }
84 graphic = NULL;
85 }
86}
87
88void CStyle::setPicture(QPixmap* _g, bool il, unsigned long tgt)
89{
90 if (graphic != NULL)
91 {
92 if (--(graphic->count) == 0)
93 {
94 delete graphic;
95 }
96 graphic = NULL;
97 }
98 if (_g != NULL) graphic = new pmstore(_g, il, tgt);
99}