Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/odtframe/KoOdtFrameReportCheckBox.cpp
Show All 29 Lines | |||||
30 | 30 | | |||
31 | #include <QPainter> | 31 | #include <QPainter> | ||
32 | #include <QPen> | 32 | #include <QPen> | ||
33 | #include <QImage> | 33 | #include <QImage> | ||
34 | #include "kreport_debug.h" | 34 | #include "kreport_debug.h" | ||
35 | #include <QMimeDatabase> | 35 | #include <QMimeDatabase> | ||
36 | #include <QMimeType> | 36 | #include <QMimeType> | ||
37 | 37 | | |||
38 | KoOdtFrameReportCheckBox::KoOdtFrameReportCheckBox(OROCheck *primitive) | 38 | KoOdtFrameReportCheckBox::KoOdtFrameReportCheckBox(OROCheckBox *primitive) | ||
39 | : KoOdtFrameReportPrimitive(primitive) | 39 | : KoOdtFrameReportPrimitive(primitive) | ||
40 | { | 40 | { | ||
41 | } | 41 | } | ||
42 | 42 | | |||
43 | KoOdtFrameReportCheckBox::~KoOdtFrameReportCheckBox() | 43 | KoOdtFrameReportCheckBox::~KoOdtFrameReportCheckBox() | ||
44 | { | 44 | { | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | OROCheck *KoOdtFrameReportCheckBox::checkBox() const | 47 | OROCheckBox *KoOdtFrameReportCheckBox::checkBox() const | ||
48 | { | 48 | { | ||
49 | return static_cast<OROCheck*>(m_primitive); | 49 | return static_cast<OROCheckBox*>(m_primitive); | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | void KoOdtFrameReportCheckBox::createStyle(KoGenStyles *coll) | 52 | void KoOdtFrameReportCheckBox::createStyle(KoGenStyles *coll) | ||
53 | { | 53 | { | ||
54 | KoGenStyle gs(KoGenStyle::GraphicStyle, "graphic"); | 54 | KoGenStyle gs(KoGenStyle::GraphicStyle, "graphic"); | ||
55 | gs.addProperty("draw:fill", "none"); | 55 | gs.addProperty("draw:fill", "none"); | ||
56 | gs.addPropertyPt("fo:margin", 0); | 56 | gs.addPropertyPt("fo:margin", 0); | ||
57 | gs.addProperty("style:horizontal-pos", "from-left"); | 57 | gs.addProperty("style:horizontal-pos", "from-left"); | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
102 | } | 102 | } | ||
103 | 103 | | |||
104 | bool KoOdtFrameReportCheckBox::saveData(KoStore* store, KoXmlWriter* manifestWriter) const | 104 | bool KoOdtFrameReportCheckBox::saveData(KoStore* store, KoXmlWriter* manifestWriter) const | ||
105 | { | 105 | { | ||
106 | QString name = "Pictures/" + imageName(); | 106 | QString name = "Pictures/" + imageName(); | ||
107 | if (!store->open(name)) { | 107 | if (!store->open(name)) { | ||
108 | return false; | 108 | return false; | ||
109 | } | 109 | } | ||
110 | OROCheck * chk = checkBox(); | 110 | OROCheckBox * chk = checkBox(); | ||
111 | QSizeF sz = chk->size(); | 111 | QSizeF sz = chk->size(); | ||
112 | QPen fpen; // frame pen | 112 | QPen fpen; // frame pen | ||
113 | if (chk->lineStyle().style == Qt::NoPen || chk->lineStyle().weight <= 0) { | 113 | if (chk->lineStyle().style == Qt::NoPen || chk->lineStyle().weight <= 0) { | ||
114 | fpen = QPen(Qt::lightGray); | 114 | fpen = QPen(Qt::lightGray); | ||
115 | } else { | 115 | } else { | ||
116 | fpen = QPen(chk->lineStyle().lineColor, chk->lineStyle().weight, chk->lineStyle().style); | 116 | fpen = QPen(chk->lineStyle().lineColor, chk->lineStyle().weight, chk->lineStyle().style); | ||
117 | } | 117 | } | ||
118 | QPointF ps(fpen.widthF(), fpen.widthF()); | 118 | QPointF ps(fpen.widthF(), fpen.widthF()); | ||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |