Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/views/reports/core/pivottable.cpp
Show All 15 Lines | |||||
16 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "pivottable.h" | 20 | #include "pivottable.h" | ||
21 | 21 | | |||
22 | // ---------------------------------------------------------------------------- | 22 | // ---------------------------------------------------------------------------- | ||
23 | // QT Includes | 23 | // QT Includes | ||
24 | #include <QDomDocument> | ||||
25 | #include <QDomElement> | ||||
24 | #include <QRegExp> | 26 | #include <QRegExp> | ||
25 | #include <QFile> | 27 | #include <QFile> | ||
26 | #include <QTextStream> | 28 | #include <QTextStream> | ||
27 | #include <QList> | 29 | #include <QList> | ||
28 | 30 | | |||
29 | // ---------------------------------------------------------------------------- | 31 | // ---------------------------------------------------------------------------- | ||
30 | // KDE Includes | 32 | // KDE Includes | ||
31 | 33 | | |||
▲ Show 20 Lines • Show All 2343 Lines • ▼ Show 20 Line(s) | 2360 | { | |||
2375 | 2377 | | |||
2376 | //if there is no column matching the current date, return -1 | 2378 | //if there is no column matching the current date, return -1 | ||
2377 | if (column == m_numColumns) { | 2379 | if (column == m_numColumns) { | ||
2378 | column = -1; | 2380 | column = -1; | ||
2379 | } | 2381 | } | ||
2380 | return column; | 2382 | return column; | ||
2381 | } | 2383 | } | ||
2382 | 2384 | | |||
2385 | bool PivotTable::loadFromXml(const QString &file) | ||||
2386 | { | ||||
2387 | Q_UNUSED(file); | ||||
2388 | return false; | ||||
2389 | } | ||||
2390 | | ||||
2391 | bool PivotTable::saveToXml(const QString &file) | ||||
2392 | { | ||||
2393 | QFile out(file); | ||||
2394 | if (!out.open(QIODevice::WriteOnly)) | ||||
2395 | return false; | ||||
2396 | QTextStream stream(&out); | ||||
2397 | stream << toXml(); | ||||
2398 | return true; | ||||
2399 | } | ||||
2400 | | ||||
2401 | QString PivotTable::toXml() | ||||
2402 | { | ||||
2403 | QDomDocument doc; | ||||
2404 | QDomElement el = doc.createElement("PivotTable"); | ||||
2405 | QString name = m_config_f.name(); | ||||
2406 | el.setAttribute("name", name); | ||||
2407 | m_grid.saveToXml(doc, el); | ||||
2408 | doc.appendChild(el); | ||||
2409 | return doc.toString(); | ||||
2410 | } | ||||
2383 | } // namespace | 2411 | } // namespace |