diff --git a/src/CSV/Export.cpp b/src/CSV/Export.cpp index e6d2c119..9d0f66c3 100644 --- a/src/CSV/Export.cpp +++ b/src/CSV/Export.cpp @@ -183,6 +183,13 @@ void Export::writeValues() auto datasetUnits = dataset.value("u").toVariant().toString(); auto datasetValue = dataset.value("v").toVariant().toString(); + datasetTitle = datasetTitle.replace("\n", ""); + datasetUnits = datasetUnits.replace("\n", ""); + datasetValue = datasetValue.replace("\n", ""); + datasetTitle = datasetTitle.replace("\r", ""); + datasetUnits = datasetUnits.replace("\r", ""); + datasetValue = datasetValue.replace("\r", ""); + if (datasetTitle.isEmpty()) continue; diff --git a/src/JSON/Dataset.cpp b/src/JSON/Dataset.cpp index 0e5c2248..92d0cc9b 100644 --- a/src/JSON/Dataset.cpp +++ b/src/JSON/Dataset.cpp @@ -101,6 +101,15 @@ bool Dataset::read(const QJsonObject &object) auto units = object.value("u").toVariant().toString(); auto widget = object.value("w").toVariant().toString(); + title = title.replace("\n", ""); + title = title.replace("\r", ""); + value = value.replace("\n", ""); + value = value.replace("\r", ""); + units = units.replace("\n", ""); + units = units.replace("\r", ""); + widget = widget.replace("\n", ""); + widget = widget.replace("\r", ""); + if (!value.isEmpty()) { m_graph = graph; diff --git a/src/JSON/Frame.cpp b/src/JSON/Frame.cpp index 852cd2cd..26036ee2 100644 --- a/src/JSON/Frame.cpp +++ b/src/JSON/Frame.cpp @@ -93,6 +93,10 @@ bool Frame::read(const QJsonObject &object) auto title = object.value("t").toString(); auto groups = object.value("g").toArray(); + // Remove line breaks from title + title = title.replace("\n", ""); + title = title.replace("\r", ""); + // We need to have a project title and at least one group if (!title.isEmpty() && !groups.isEmpty()) { diff --git a/src/JSON/Group.cpp b/src/JSON/Group.cpp index cec51ffc..7fa637fc 100644 --- a/src/JSON/Group.cpp +++ b/src/JSON/Group.cpp @@ -100,6 +100,11 @@ bool Group::read(const QJsonObject &object) auto title = object.value("t").toVariant().toString(); auto widget = object.value("w").toVariant().toString(); + title = title.replace("\n", ""); + title = title.replace("\r", ""); + widget = widget.replace("\n", ""); + widget = widget.replace("\r", ""); + if (!title.isEmpty() && !array.isEmpty()) { m_title = title;