KReportItemField::KReportItemField(const QDomNode & element) { createProperties(); QDomNodeList nl = element.childNodes(); QString n; QDomNode node; nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); m_verticalAlignment->setValue(element.toElement().attribute(QLatin1String("report:vertical-align"))); m_canGrow->setValue(element.toElement().attribute(QLatin1String("report:can-grow"))); m_wordWrap->setValue(element.toElement().attribute(QLatin1String("report:word-wrap"))); parseReportRect(element.toElement()); for (int i = 0; i < nl.count(); i++) { node = nl.item(i); n = node.nodeName(); if (n == QLatin1String("report:text-style")) { KRTextStyleData ts; if (parseReportTextStyleData(node.toElement(), &ts)) { m_backgroundColor->setValue(ts.backgroundColor); m_foregroundColor->setValue(ts.foregroundColor); m_backgroundOpacity->setValue(ts.backgroundOpacity); m_font->setValue(ts.font); } } else if (n == QLatin1String("report:line-style")) { KReportLineStyle ls; if (parseReportLineStyleData(node.toElement(), &ls)) { m_lineWeight->setValue(ls.width()); m_lineColor->setValue(ls.color()); m_lineStyle->setValue(QPen(ls.penStyle())); } } else { kreportpluginWarning() << "while parsing field element encountered unknow element: " << n; } } }
KoReportItemLabel::KoReportItemLabel(QDomNode & element) { createProperties(); QDomNodeList nl = element.childNodes(); QString n; QDomNode node; m_name->setValue(element.toElement().attribute("report:name")); m_text->setValue(element.toElement().attribute("report:caption")); Z = element.toElement().attribute("report:z-index").toDouble(); m_horizontalAlignment->setValue(element.toElement().attribute("report:horizontal-align")); m_verticalAlignment->setValue(element.toElement().attribute("report:vertical-align")); parseReportRect(element.toElement(), &m_pos, &m_size); for (int i = 0; i < nl.count(); i++) { node = nl.item(i); n = node.nodeName(); if (n == "report:text-style") { KRTextStyleData ts; if (parseReportTextStyleData(node.toElement(), ts)) { m_backgroundColor->setValue(ts.backgroundColor); m_foregroundColor->setValue(ts.foregroundColor); m_backgroundOpacity->setValue(ts.backgroundOpacity); m_font->setValue(ts.font); } } else if (n == "report:line-style") { KRLineStyleData ls; if (parseReportLineStyleData(node.toElement(), ls)) { m_lineWeight->setValue(ls.weight); m_lineColor->setValue(ls.lineColor); m_lineStyle->setValue(ls.style); } } else { kWarning() << "while parsing label element encountered unknow element: " << n; } } }
KRTextData::KRTextData(QDomNode & element) : bpad(0.0) { createProperties(); QDomNodeList nl = element.childNodes(); QString n; QDomNode node; for (int i = 0; i < nl.count(); i++) { node = nl.item(i); n = node.nodeName(); if (n == "data") { QDomNodeList dnl = node.childNodes(); for (int di = 0; di < dnl.count(); di++) { node = dnl.item(di); n = node.nodeName(); /*if ( n == "query" ) { _query->setValue ( node.firstChild().nodeValue() ); } else */if (n == "controlsource") { m_controlSource->setValue(node.firstChild().nodeValue()); } else { kDebug() << "while parsing field data encountered and unknown element: " << n; } } } else if (n == "name") { m_name->setValue(node.firstChild().nodeValue()); } else if (n == "zvalue") { Z = node.firstChild().nodeValue().toDouble(); } else if (n == "bottompad") { bpad = node.firstChild().nodeValue().toDouble() / 100.0; } else if (n == "left") { m_horizontalAlignment->setValue("Left"); } else if (n == "hcenter") { m_horizontalAlignment->setValue("Center"); } else if (n == "right") { m_horizontalAlignment->setValue("Right"); } else if (n == "top") { m_verticalAlignment->setValue("Top"); } else if (n == "vcenter") { m_verticalAlignment->setValue("Center"); } else if (n == "bottom") { m_verticalAlignment->setValue("Bottom"); } else if (n == "rect") { QRectF r; parseReportRect(node.toElement(), r); m_pos.setPointPos(r.topLeft()); m_size.setPointSize(r.size()); } else if (n == "textstyle") { ORTextStyleData ts; if (parseReportTextStyleData(node.toElement(), ts)) { m_backgroundColor->setValue(ts.bgColor); m_foregroundColor->setValue(ts.fgColor); m_backgroundOpacity->setValue(ts.bgOpacity); m_font->setValue(ts.font); } } else if (n == "linestyle") { ORLineStyleData ls; if (parseReportLineStyleData(node.toElement(), ls)) { m_lineWeight->setValue(ls.weight); m_lineColor->setValue(ls.lnColor); m_lineStyle->setValue(ls.style); } } else { kDebug() << "while parsing text element encountered unknow element: " << n; } } }