Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportUtils.cpp
Show All 13 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to | ||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "KReportUtils.h" | 20 | #include "KReportUtils.h" | ||
21 | #include "KReportUnit.h" | 21 | #include "KReportUnit.h" | ||
22 | #include "KReportPosition.h" | | |||
23 | #include "KReportSize.h" | | |||
24 | #include "KReportItemBase.h" | 22 | #include "KReportItemBase.h" | ||
25 | #include "KReportLineStyle.h" | 23 | #include "KReportLineStyle.h" | ||
26 | 24 | | |||
27 | #include <KProperty> | 25 | #include <KProperty> | ||
28 | 26 | | |||
29 | #include <QDomDocument> | 27 | #include <QDomDocument> | ||
30 | #include <QDomElement> | 28 | #include <QDomElement> | ||
31 | 29 | | |||
▲ Show 20 Lines • Show All 465 Lines • ▼ Show 20 Line(s) | 480 | if (elemSource.tagName() == QLatin1String("report:line-style")) { | |||
497 | } else if (l == QLatin1String("dashdotdot")) { | 495 | } else if (l == QLatin1String("dashdotdot")) { | ||
498 | ls->setPenStyle(Qt::DashDotDotLine); | 496 | ls->setPenStyle(Qt::DashDotDotLine); | ||
499 | } | 497 | } | ||
500 | return true; | 498 | return true; | ||
501 | } | 499 | } | ||
502 | return false; | 500 | return false; | ||
503 | } | 501 | } | ||
504 | 502 | | |||
503 | #if 0 | ||||
505 | bool KReportUtils::parseReportRect(const QDomElement & elemSource, KReportPosition *pos, KReportSize *size) | 504 | bool KReportUtils::parseReportRect(const QDomElement & elemSource, KReportPosition *pos, KReportSize *size) | ||
506 | { | 505 | { | ||
507 | Q_ASSERT(pos); | 506 | Q_ASSERT(pos); | ||
508 | Q_ASSERT(size); | 507 | Q_ASSERT(size); | ||
509 | // QStringList sl; | 508 | // QStringList sl; | ||
510 | // QDomNamedNodeMap map = elemSource.attributes(); | 509 | // QDomNamedNodeMap map = elemSource.attributes(); | ||
511 | // for (int i=0; i < map.count(); ++i ) { | 510 | // for (int i=0; i < map.count(); ++i ) { | ||
512 | // sl << map.item(i).nodeName(); | 511 | // sl << map.item(i).nodeName(); | ||
513 | // } | 512 | // } | ||
514 | QPointF _pos; | 513 | QPointF _pos; | ||
515 | QSizeF _siz; | 514 | QSizeF _siz; | ||
516 | 515 | | |||
517 | _pos.setX(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:x"), QLatin1String("1cm")))); | 516 | _pos.setX(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:x"), QLatin1String("1cm")))); | ||
518 | _pos.setY(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:y"), QLatin1String("1cm")))); | 517 | _pos.setY(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:y"), QLatin1String("1cm")))); | ||
519 | _siz.setWidth(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:width"), QLatin1String("1cm")))); | 518 | _siz.setWidth(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:width"), QLatin1String("1cm")))); | ||
520 | _siz.setHeight(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:height"), QLatin1String("1cm")))); | 519 | _siz.setHeight(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:height"), QLatin1String("1cm")))); | ||
521 | 520 | | |||
522 | pos->setPointPos(_pos); | 521 | pos->setPointPos(_pos); | ||
523 | size->setPointSize(_siz); | 522 | size->setPointSize(_siz); | ||
524 | return true; | 523 | return true; | ||
525 | } | 524 | } | ||
525 | #endif | ||||
526 | 526 | | |||
527 | class PageIds : private QHash<QString, QPageSize::PageSizeId> | 527 | class PageIds : private QHash<QString, QPageSize::PageSizeId> | ||
528 | { | 528 | { | ||
529 | public: | 529 | public: | ||
530 | PageIds() {} | 530 | PageIds() {} | ||
531 | QPageSize::PageSizeId id(const QString &key) { | 531 | QPageSize::PageSizeId id(const QString &key) { | ||
532 | if (isEmpty()) { | 532 | if (isEmpty()) { | ||
533 | for (int i = 0; i < QPageSize::LastPageSize; ++i) { | 533 | for (int i = 0; i < QPageSize::LastPageSize; ++i) { | ||
Show All 22 Lines |