Skip to content

Commit

Permalink
Update OGRColumn.cpp
Browse files Browse the repository at this point in the history
Table merge bug: integers with commas are cut off GeoDaCenter#1898
  • Loading branch information
lixun910 committed Jun 16, 2019
1 parent 87cf6c3 commit 326059a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions DataViewer/OGRColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ void OGRColumnString::FillData(vector<double>& data)
if (tmp.IsEmpty()) {
data[i] = 0.0;
undef_markers[i] = true;
} else if (tmp.ToDouble(&val)) {
} else if (wxNumberFormatter::FromString(tmp, &val)) {
data[i] = val;
} else {
// try to use different locale
Expand All @@ -826,7 +826,7 @@ void OGRColumnString::FillData(vector<double>& data)
setlocale(LC_NUMERIC, "de_DE");
}
double _val;
if (tmp.ToDouble(&_val)) {
if (wxNumberFormatter::FromString(tmp, &_val)) {
data[i] = _val;
} else {
data[i] = 0.0;
Expand Down Expand Up @@ -882,10 +882,10 @@ void OGRColumnString::FillData(vector<wxInt64> &data)
undef_markers[i] = true;
data[i] = 0;

} else if (tmp.ToLongLong(&val)) {
} else if (wxNumberFormatter::FromString(tmp, &val)) {
data[i] = val;

} else if (tmp.ToDouble(&val_d)) {
} else if (wxNumberFormatter::FromString(tmp, &val_d)) {
val = static_cast<wxInt64>(val_d);
data[i] = val;

Expand All @@ -901,10 +901,10 @@ void OGRColumnString::FillData(vector<wxInt64> &data)
}
wxInt64 val_;
double val_d_;
if (tmp.ToLongLong(&val_)) {
if (wxNumberFormatter::FromString(tmp, &val_)) {
data[i] = val_;

} else if (tmp.ToDouble(&val_d_)) {
} else if (wxNumberFormatter::FromString(tmp, &val_d_)) {
val_ = static_cast<wxInt64>(val_d_);
data[i] = val_;

Expand Down

0 comments on commit 326059a

Please sign in to comment.