Changeset View
Changeset View
Standalone View
Standalone View
src/items/image/KReportItemImage.cpp
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | 12 | * Lesser General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | 14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "KReportItemImage.h" | 18 | #include "KReportItemImage.h" | ||
19 | #include "KReportUtils.h" | ||||
19 | #include "KReportRenderObjects.h" | 20 | #include "KReportRenderObjects.h" | ||
20 | #include "kreportplugin_debug.h" | 21 | #include "kreportplugin_debug.h" | ||
21 | 22 | | |||
22 | #include <KPropertyListData> | 23 | #include <KPropertyListData> | ||
23 | #include <KPropertySet> | 24 | #include <KPropertySet> | ||
24 | 25 | | |||
25 | #include <QBuffer> | 26 | #include <QBuffer> | ||
26 | #include <QDomNodeList> | 27 | #include <QDomNodeList> | ||
27 | 28 | | |||
28 | 29 | | |||
29 | KReportItemImage::KReportItemImage() | 30 | KReportItemImage::KReportItemImage() | ||
30 | { | 31 | { | ||
31 | createProperties(); | 32 | createProperties(); | ||
32 | } | 33 | } | ||
33 | 34 | | |||
34 | KReportItemImage::KReportItemImage(const QDomNode & element) | 35 | KReportItemImage::KReportItemImage(const QDomNode & element) | ||
35 | : KReportItemImage() | 36 | : KReportItemImage() | ||
36 | { | 37 | { | ||
37 | nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); | 38 | nameProperty()->setValue(KReportUtils::readNameAttribute(element.toElement())); | ||
38 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | 39 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | ||
39 | m_resizeMode->setValue(element.toElement().attribute(QLatin1String("report:resize-mode"), QLatin1String("stretch"))); | 40 | m_resizeMode->setValue(element.toElement().attribute(QLatin1String("report:resize-mode"), QLatin1String("stretch"))); | ||
40 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | 41 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | ||
41 | 42 | | |||
42 | parseReportRect(element.toElement()); | 43 | parseReportRect(element.toElement()); | ||
43 | 44 | | |||
44 | QDomNodeList nl = element.childNodes(); | 45 | QDomNodeList nl = element.childNodes(); | ||
45 | QString n; | 46 | QString n; | ||
46 | QDomNode node; | 47 | QDomNode node; | ||
47 | for (int i = 0; i < nl.count(); i++) { | 48 | for (int i = 0; i < nl.count(); i++) { | ||
48 | node = nl.item(i); | 49 | node = nl.item(i); | ||
49 | n = node.nodeName(); | 50 | n = node.nodeName(); | ||
50 | 51 | | |||
51 | if (n == QLatin1String("report:inline-image-data")) { | 52 | if (n == QLatin1String("report:inline-image-data")) { | ||
52 | 53 | | |||
53 | setInlineImageData(node.firstChild().nodeValue().toLatin1()); | 54 | setInlineImageData(node.firstChild().nodeValue().toLatin1()); | ||
54 | } else { | 55 | } else { | ||
55 | kreportpluginWarning() << "while parsing image element encountered unknown element: " << n; | 56 | kreportpluginWarning() << "while parsing image element encountered unknown element: " << n; | ||
56 | } | 57 | } | ||
57 | } | 58 | } | ||
58 | | ||||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | KReportItemImage::~KReportItemImage() | 61 | KReportItemImage::~KReportItemImage() | ||
62 | { | 62 | { | ||
63 | } | 63 | } | ||
64 | 64 | | |||
65 | bool KReportItemImage::isInline() const | 65 | bool KReportItemImage::isInline() const | ||
66 | { | 66 | { | ||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |