Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportUtils.cpp
Show First 20 Lines • Show All 356 Lines • ▼ Show 20 Line(s) | |||||
357 | void KReportUtils::buildXMLRect(QDomElement *entity, const QPointF &pos, const QSizeF &size) | 357 | void KReportUtils::buildXMLRect(QDomElement *entity, const QPointF &pos, const QSizeF &size) | ||
358 | { | 358 | { | ||
359 | Q_ASSERT(entity); | 359 | Q_ASSERT(entity); | ||
360 | 360 | | |||
361 | KReportUtils::setAttribute(entity, pos); | 361 | KReportUtils::setAttribute(entity, pos); | ||
362 | KReportUtils::setAttribute(entity, size ); | 362 | KReportUtils::setAttribute(entity, size ); | ||
363 | } | 363 | } | ||
364 | 364 | | |||
365 | void KReportUtils::buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts) | 365 | void KReportUtils::buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KReportTextStyleData &ts) | ||
366 | { | 366 | { | ||
367 | Q_ASSERT(doc); | 367 | Q_ASSERT(doc); | ||
368 | Q_ASSERT(entity); | 368 | Q_ASSERT(entity); | ||
369 | QDomElement element = doc->createElement(QLatin1String("report:text-style")); | 369 | QDomElement element = doc->createElement(QLatin1String("report:text-style")); | ||
370 | 370 | | |||
371 | element.setAttribute(QLatin1String("fo:background-color"), ts.backgroundColor.name()); | 371 | element.setAttribute(QLatin1String("fo:background-color"), ts.backgroundColor.name()); | ||
372 | element.setAttribute(QLatin1String("fo:foreground-color"), ts.foregroundColor.name()); | 372 | element.setAttribute(QLatin1String("fo:foreground-color"), ts.foregroundColor.name()); | ||
373 | element.setAttribute(QLatin1String("fo:background-opacity"), QString::number(ts.backgroundOpacity) + QLatin1Char('%')); | 373 | element.setAttribute(QLatin1String("fo:background-opacity"), QString::number(ts.backgroundOpacity) + QLatin1Char('%')); | ||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | |||||
452 | 452 | | |||
453 | void KReportUtils::setAttribute(QDomElement *e, const QSizeF &value) | 453 | void KReportUtils::setAttribute(QDomElement *e, const QSizeF &value) | ||
454 | { | 454 | { | ||
455 | Q_ASSERT(e); | 455 | Q_ASSERT(e); | ||
456 | KReportUtils::setAttribute(e, QLatin1String("svg:width"), value.width()); | 456 | KReportUtils::setAttribute(e, QLatin1String("svg:width"), value.width()); | ||
457 | KReportUtils::setAttribute(e, QLatin1String("svg:height"), value.height()); | 457 | KReportUtils::setAttribute(e, QLatin1String("svg:height"), value.height()); | ||
458 | } | 458 | } | ||
459 | 459 | | |||
460 | bool KReportUtils::parseReportTextStyleData(const QDomElement & elemSource, KRTextStyleData *ts) | 460 | bool KReportUtils::parseReportTextStyleData(const QDomElement & elemSource, KReportTextStyleData *ts) | ||
461 | { | 461 | { | ||
462 | Q_ASSERT(ts); | 462 | Q_ASSERT(ts); | ||
463 | if (elemSource.tagName() != QLatin1String("report:text-style")) | 463 | if (elemSource.tagName() != QLatin1String("report:text-style")) | ||
464 | return false; | 464 | return false; | ||
465 | ts->backgroundColor = QColor(elemSource.attribute(QLatin1String("fo:background-color"), QLatin1String("#ffffff"))); | 465 | ts->backgroundColor = QColor(elemSource.attribute(QLatin1String("fo:background-color"), QLatin1String("#ffffff"))); | ||
466 | ts->foregroundColor = QColor(elemSource.attribute(QLatin1String("fo:foreground-color"), QLatin1String("#000000"))); | 466 | ts->foregroundColor = QColor(elemSource.attribute(QLatin1String("fo:foreground-color"), QLatin1String("#000000"))); | ||
467 | 467 | | |||
468 | bool ok; | 468 | bool ok; | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |