From d9aa870e5d509cc7309ab82dd102a937ab58613a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Thu, 9 Feb 2017 04:36:04 -0500 Subject: Imported Upstream version 3.1.1+dfsg1 --- SQLiteStudio3/coreSQLiteStudio/csvformat.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'SQLiteStudio3/coreSQLiteStudio/csvformat.cpp') diff --git a/SQLiteStudio3/coreSQLiteStudio/csvformat.cpp b/SQLiteStudio3/coreSQLiteStudio/csvformat.cpp index f5daa60..151fffd 100644 --- a/SQLiteStudio3/coreSQLiteStudio/csvformat.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/csvformat.cpp @@ -1,7 +1,7 @@ #include "csvformat.h" #include -const CsvFormat CsvFormat::DEFAULT = {",", "\n"}; +const CsvFormat CsvFormat::DEFAULT = {{","}, {"\r\n", "\n", "\r"}}; CsvFormat::CsvFormat() { @@ -12,6 +12,27 @@ CsvFormat::CsvFormat(const QString& columnSeparator, const QString& rowSeparator { } +CsvFormat::CsvFormat(const QStringList &columnSeparators, const QStringList &rowSeparators) +{ + if (rowSeparators.size() > 1) + { + this->rowSeparators = rowSeparators; + multipleRowSeparators = true; + strictRowSeparator = true; + } + else if (rowSeparators.size() > 0) + this->rowSeparator = rowSeparators.first(); + + if (columnSeparators.size() > 1) + { + this->columnSeparators = columnSeparators; + multipleColumnSeparators = true; + strictColumnSeparator = true; + } + else if (columnSeparators.size() > 0) + this->columnSeparator = columnSeparators.first(); +} + CsvFormat::CsvFormat(const QString& columnSeparator, const QString& rowSeparator, bool strictRowSeparator, bool strictColumnSeparator) : columnSeparator(columnSeparator), rowSeparator(rowSeparator), strictColumnSeparator(strictColumnSeparator), strictRowSeparator(strictRowSeparator) { -- cgit v1.2.3