Skip to content
Snippets Groups Projects
Commit c70855f3 authored by Pete Peterson's avatar Pete Peterson Committed by GitHub
Browse files

Merge pull request #20401 from mantidproject/fix-table-view-bug

Fix string table values being truncated in table window
parents 4394527c 9ef688d7
No related merge requests found
...@@ -296,12 +296,13 @@ void MantidTable::cellEdited(int row, int col) { ...@@ -296,12 +296,13 @@ void MantidTable::cellEdited(int row, int col) {
std::istringstream textStream(text); std::istringstream textStream(text);
const std::locale systemLocale(""); const std::locale systemLocale("");
textStream.imbue(systemLocale); textStream.imbue(systemLocale);
c->read(index, textStream); c->read(index, textStream.str());
// Set the table view to be the same text after editing. // Set the table view to be the same text after editing.
// That way, if the string was stupid, it will be reset to the old value. // That way, if the string was stupid, it will be reset to the old value.
std::ostringstream s; std::ostringstream s;
s.imbue(systemLocale); s.imbue(systemLocale);
// Avoid losing precision for numeric data // Avoid losing precision for numeric data
if (c->type() == "double") { if (c->type() == "double") {
s.precision(std::numeric_limits<double>::max_digits10); s.precision(std::numeric_limits<double>::max_digits10);
......
...@@ -50,6 +50,7 @@ Custom Interfaces ...@@ -50,6 +50,7 @@ Custom Interfaces
Bugs Resolved Bugs Resolved
------------- -------------
- Fixed a bug causing table windows with string values to appear truncated if the string contained a space.
SliceViewer Improvements SliceViewer Improvements
------------------------ ------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment