Skip to content

Commit

Permalink
Merge pull request highperformancecoder#215 from Suthiro/bugfix
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
highperformancecoder authored Apr 17, 2021
2 parents faf0b7a + abcbd5a commit 0fed08b
Show file tree
Hide file tree
Showing 17 changed files with 64,635 additions and 93,326 deletions.
4 changes: 2 additions & 2 deletions libscidavis/src/Matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ bool Matrix::recalculate()
saveCellsToMemory();
double dx = fabs(xEnd() - xStart()) / (double)(numRows() - 1);
double dy = fabs(yEnd() - yStart()) / (double)(numCols() - 1);
std::pair<double, bool> invalidValue(std::numeric_limits<double>::quiet_NaN(), false);
std::pair<double, bool> unsetValue(std::numeric_limits<double>::quiet_NaN(), false);
std::vector<std::vector<std::pair<double, bool>>> calculatedValues(
endRow - startRow + 1,
std::vector<std::pair<double, bool>>(endCol - startCol + 1, invalidValue));
std::vector<std::pair<double, bool>>(endCol - startCol + 1, unsetValue));
for (int row = startRow; row <= endRow; row++)
for (int col = startCol; col <= endCol; col++) {
if (!isCellSelected(row, col))
Expand Down
16 changes: 8 additions & 8 deletions libscidavis/src/future/core/datatypes/String2DateTimeFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "lib/XmlStreamReader.h"
#include <QXmlStreamWriter>

const char *String2DateTimeFilter::date_formats[] = {
const QStringList String2DateTimeFilter::date_formats = {
"yyyy-M-d", // ISO 8601 w/ and w/o leading zeros
"yyyy/M/d",
"d/M/yyyy", // European style day/month order (this order seems to be used in more countries
Expand All @@ -41,11 +41,11 @@ const char *String2DateTimeFilter::date_formats[] = {
"d.M.yyyy", // German style
"d.M.yy", "M/yyyy",
"d.M.", // German form w/o year
"yyyyMMdd", 0
"yyyyMMdd"
};

const char *String2DateTimeFilter::time_formats[] = {
"h", "h ap", "h:mm", "h:mm ap", "h:mm:ss", "h:mm:ss.zzz", "h:mm:ss:zzz", "mm:ss.zzz", "hmmss", 0
const QStringList String2DateTimeFilter::time_formats = {
"h", "h ap", "h:mm", "h:mm ap", "h:mm:ss", "h:mm:ss.zzz", "h:mm:ss:zzz", "mm:ss.zzz", "hmmss"
};

QDateTime String2DateTimeFilter::dateTimeAt(int row) const
Expand Down Expand Up @@ -88,14 +88,14 @@ QDateTime String2DateTimeFilter::dateTimeAt(int row) const
time_string = date_string;

// try to find a valid date
for (const char **format = date_formats; *format != 0; format++) {
date_result = QDate::fromString(date_string, *format);
for (const auto& format : date_formats) {
date_result = QDate::fromString(date_string, format);
if (date_result.isValid())
break;
}
// try to find a valid time
for (const char **format = time_formats; *format != 0; format++) {
time_result = QTime::fromString(time_string, *format);
for (const auto& format : time_formats) {
time_result = QTime::fromString(time_string, format);
if (time_result.isValid())
break;
}
Expand Down
4 changes: 2 additions & 2 deletions libscidavis/src/future/core/datatypes/String2DateTimeFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class String2DateTimeFilter : public AbstractSimpleFilter
//! The format string.
QString d_format;

static const char *date_formats[];
static const char *time_formats[];
static const QStringList date_formats;
static const QStringList time_formats;

public:
virtual QDateTime dateTimeAt(int row) const;
Expand Down
13 changes: 10 additions & 3 deletions libscidavis/src/future/table/TableView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,16 @@ void TableView::applyType()
break;
}
col->setColumnMode(new_mode, converter);
DateTime2StringFilter *filter =
static_cast<DateTime2StringFilter *>(col->outputFilter());
filter->setFormat(format);
{
auto filter = dynamic_cast<DateTime2StringFilter *>(col->outputFilter());
if (nullptr != filter)
filter->setFormat(format);
}
{
auto filter = dynamic_cast<String2DateTimeFilter *>(col->inputFilter());
if (nullptr != filter)
filter->setFormat(format);
}
col->endMacro();
}
break;
Expand Down
12,951 changes: 6,441 additions & 6,510 deletions scidavis/translations/scidavis_cs-alt.ts

Large diffs are not rendered by default.

9,311 changes: 2,801 additions & 6,510 deletions scidavis/translations/scidavis_cs.ts

Large diffs are not rendered by default.

12,946 changes: 6,435 additions & 6,511 deletions scidavis/translations/scidavis_de.ts

Large diffs are not rendered by default.

12,987 changes: 6,476 additions & 6,511 deletions scidavis/translations/scidavis_es.ts

Large diffs are not rendered by default.

12,926 changes: 6,415 additions & 6,511 deletions scidavis/translations/scidavis_fr.ts

Large diffs are not rendered by default.

12,842 changes: 6,331 additions & 6,511 deletions scidavis/translations/scidavis_ja.ts

Large diffs are not rendered by default.

12,980 changes: 6,470 additions & 6,510 deletions scidavis/translations/scidavis_pl.ts

Large diffs are not rendered by default.

9,359 changes: 2,849 additions & 6,510 deletions scidavis/translations/scidavis_pt-br.ts

Large diffs are not rendered by default.

5,957 changes: 2,969 additions & 2,988 deletions scidavis/translations/scidavis_ru.ts

Large diffs are not rendered by default.

26,771 changes: 17,401 additions & 9,370 deletions scidavis/translations/scidavis_sv.ts

Large diffs are not rendered by default.

14,446 changes: 12 additions & 14,434 deletions scidavis/translations/scidavis_zh-cn.ts

Large diffs are not rendered by default.

14,446 changes: 12 additions & 14,434 deletions scidavis/translations/scidavis_zh-tw.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion update_translations.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ cp scidavis/translations/*.ts scidavis/oldtranslations/
# run lupdate to generate new files
lupdate -noobsolete scidavis.pro
# run python script to merge translated lines from old translations into new
python translation_updater.py scidavis/oldtranslations scidavis/translations
python3 translation_updater.py scidavis/oldtranslations scidavis/translations
# remove temporary directory
rm -rf scidavis/oldtranslations

0 comments on commit 0fed08b

Please sign in to comment.