00001
00002
00003
00004
00005
00006
00007 #include "CurvesGraphs.h"
00008 #include "Document.h"
00009 #include "EngaugeAssert.h"
00010 #include "ExportToClipboard.h"
00011 #include <QStringList>
00012 #include <QTextStream>
00013
00014 ExportToClipboard::ExportToClipboard()
00015 {
00016 }
00017
00018 void ExportToClipboard::exportToClipboard (const QStringList &selected,
00019 const Transformation &transformation,
00020 QTextStream &strCsv,
00021 QTextStream &strHtml,
00022 const Curve &curveAxis,
00023 const CurvesGraphs &curvesGraphsAll,
00024 CurvesGraphs &curvesGraphsSelected) const
00025 {
00026
00027 QHash<QString, bool> selectedHash;
00028 QStringList::const_iterator itrH;
00029 for (itrH = selected.begin (); itrH != selected.end (); itrH++) {
00030 QString pointIdentifier = *itrH;
00031 selectedHash [pointIdentifier] = false;
00032 }
00033
00034
00035
00036
00037 QStringList curveNames = curvesGraphsAll.curvesGraphsNames();
00038 curveNames << AXIS_CURVE_NAME;
00039
00040
00041 QStringList::const_iterator itrC;
00042 for (itrC = curveNames.begin(); itrC != curveNames.end (); itrC++) {
00043
00044 QString curveName = *itrC;
00045 if (curveName == AXIS_CURVE_NAME) {
00046 curveAxis.exportToClipboard (selectedHash,
00047 transformation,
00048 strCsv,
00049 strHtml,
00050 curvesGraphsSelected);
00051 } else {
00052 const Curve *curve = curvesGraphsAll.curveForCurveName(curveName);
00053 ENGAUGE_CHECK_PTR (curve);
00054 curve->exportToClipboard (selectedHash,
00055 transformation,
00056 strCsv,
00057 strHtml,
00058 curvesGraphsSelected);
00059 }
00060 }
00061 }