Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportDesign_p.cpp
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | |||||
105 | { | 105 | { | ||
106 | return s_global; | 106 | return s_global; | ||
107 | } | 107 | } | ||
108 | 108 | | |||
109 | static void setStatus(KReportDesignReadingStatus *status, const QString& details, | 109 | static void setStatus(KReportDesignReadingStatus *status, const QString& details, | ||
110 | const QDomNode &node) | 110 | const QDomNode &node) | ||
111 | { | 111 | { | ||
112 | if (status) { | 112 | if (status) { | ||
113 | status->errorDetails = details; | 113 | status->setErrorDetails(details); | ||
114 | status->lineNumber = node.lineNumber() == -1 ? 0 /* mark error */ : node.lineNumber(); | 114 | status->setErrorLineNumber(node.lineNumber() == -1 ? 0 /* mark error */ : node.lineNumber()); | ||
115 | status->columnNumber = node.columnNumber() == -1 ? 0 /* mark error */ : node.columnNumber(); | 115 | status->setErrorColumnNumber(node.columnNumber() == -1 ? 0 /* mark error */ : node.columnNumber()); | ||
116 | } | 116 | } | ||
117 | } | 117 | } | ||
118 | 118 | | |||
119 | static bool checkElement(const QDomNode &node, KReportDesignReadingStatus *status) | 119 | static bool checkElement(const QDomNode &node, KReportDesignReadingStatus *status) | ||
120 | { | 120 | { | ||
121 | if (node.isElement()) { | 121 | if (node.isElement()) { | ||
122 | return true; | 122 | return true; | ||
123 | } | 123 | } | ||
▲ Show 20 Lines • Show All 323 Lines • ▼ Show 20 Line(s) | 446 | if (!checkElement(node, status)) { | |||
447 | return false; | 447 | return false; | ||
448 | } | 448 | } | ||
449 | if (!processContentElementChild(node.toElement(), status)) { | 449 | if (!processContentElementChild(node.toElement(), status)) { | ||
450 | return false; | 450 | return false; | ||
451 | } | 451 | } | ||
452 | } | 452 | } | ||
453 | 453 | | |||
454 | if (status) { | 454 | if (status) { | ||
455 | status->lineNumber = -1; | 455 | *status = KReportDesignReadingStatus(); | ||
staniek: If we support KReportDesignReadingStatus::operator=() we could just do this here:
*status =… | |||||
456 | status->columnNumber = -1; | | |||
457 | status->errorMessage.clear(); | | |||
458 | status->errorDetails.clear(); | | |||
459 | } | 456 | } | ||
460 | return true; | 457 | return true; | ||
461 | } | 458 | } |
If we support KReportDesignReadingStatus::operator=() we could just do this here:
*status = KReportDesignReadingStatus();
And this would be more maintainable.