From cec6b825611a5aa44a7fe09e22ccaca20ecb5510 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Tue, 7 May 2019 23:14:52 +0200 Subject: [PATCH] Fix loading of last used settings in Import CSV dialog Fix the loading of the last used import settings in the Import CSV dialog when the "Other" option has been used in one of the dropdown boxes. --- src/ImportCsvDialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ImportCsvDialog.cpp b/src/ImportCsvDialog.cpp index 33274ffb..95a59fdf 100644 --- a/src/ImportCsvDialog.cpp +++ b/src/ImportCsvDialog.cpp @@ -710,7 +710,7 @@ void ImportCsvDialog::setQuoteChar(const QChar& c) int index = combo->findText(c); if(index == -1) { - combo->setCurrentIndex(combo->count()); + combo->setCurrentIndex(combo->count() - 1); ui->editCustomQuote->setText(c); } else @@ -738,7 +738,7 @@ void ImportCsvDialog::setSeparatorChar(const QChar& c) int index = combo->findText(sText); if(index == -1) { - combo->setCurrentIndex(combo->count()); + combo->setCurrentIndex(combo->count() - 1); ui->editCustomSeparator->setText(c); } else @@ -762,7 +762,7 @@ void ImportCsvDialog::setEncoding(const QString& sEnc) int index = combo->findText(sEnc); if(index == -1) { - combo->setCurrentIndex(combo->count()); + combo->setCurrentIndex(combo->count() - 1); ui->editCustomEncoding->setText(sEnc); } else