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 <KPropertySet> | 23 | #include <KPropertySet> | ||
23 | 24 | | |||
24 | #include <QBuffer> | 25 | #include <QBuffer> | ||
25 | #include <QDomNodeList> | 26 | #include <QDomNodeList> | ||
26 | 27 | | |||
27 | 28 | | |||
28 | KReportItemImage::KReportItemImage() | 29 | KReportItemImage::KReportItemImage() | ||
29 | { | 30 | { | ||
30 | createProperties(); | 31 | createProperties(); | ||
31 | } | 32 | } | ||
32 | 33 | | |||
33 | KReportItemImage::KReportItemImage(const QDomNode & element) | 34 | KReportItemImage::KReportItemImage(const QDomNode & element) | ||
34 | : KReportItemImage() | 35 | : KReportItemImage() | ||
35 | { | 36 | { | ||
36 | nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); | 37 | nameProperty()->setValue(KReportUtils::readNameAttribute(element.toElement())); | ||
37 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | 38 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | ||
38 | m_resizeMode->setValue(element.toElement().attribute(QLatin1String("report:resize-mode"), QLatin1String("stretch"))); | 39 | m_resizeMode->setValue(element.toElement().attribute(QLatin1String("report:resize-mode"), QLatin1String("stretch"))); | ||
39 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | 40 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | ||
40 | 41 | | |||
41 | parseReportRect(element.toElement()); | 42 | parseReportRect(element.toElement()); | ||
42 | 43 | | |||
43 | QDomNodeList nl = element.childNodes(); | 44 | QDomNodeList nl = element.childNodes(); | ||
44 | QString n; | 45 | QString n; | ||
45 | QDomNode node; | 46 | QDomNode node; | ||
46 | for (int i = 0; i < nl.count(); i++) { | 47 | for (int i = 0; i < nl.count(); i++) { | ||
47 | node = nl.item(i); | 48 | node = nl.item(i); | ||
48 | n = node.nodeName(); | 49 | n = node.nodeName(); | ||
49 | 50 | | |||
50 | if (n == QLatin1String("report:inline-image-data")) { | 51 | if (n == QLatin1String("report:inline-image-data")) { | ||
51 | 52 | | |||
52 | setInlineImageData(node.firstChild().nodeValue().toLatin1()); | 53 | setInlineImageData(node.firstChild().nodeValue().toLatin1()); | ||
53 | } else { | 54 | } else { | ||
54 | kreportpluginWarning() << "while parsing image element encountered unknown element: " << n; | 55 | kreportpluginWarning() << "while parsing image element encountered unknown element: " << n; | ||
55 | } | 56 | } | ||
56 | } | 57 | } | ||
57 | | ||||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | KReportItemImage::~KReportItemImage() | 60 | KReportItemImage::~KReportItemImage() | ||
61 | { | 61 | { | ||
62 | } | 62 | } | ||
63 | 63 | | |||
64 | bool KReportItemImage::isInline() const | 64 | bool KReportItemImage::isInline() const | ||
65 | { | 65 | { | ||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |