diff --git a/core/src/processing/data/StringDict.java b/core/src/processing/data/StringDict.java index 3768f6953..1ea488359 100644 --- a/core/src/processing/data/StringDict.java +++ b/core/src/processing/data/StringDict.java @@ -108,6 +108,21 @@ public class StringDict { } + /** + * Create a dictionary that maps between column titles and cell entries + * in a TableRow. + */ + public StringDict(TableRow row) { + String[] titles = row.getColumnTitles(); + if (titles == null) { + titles = new StringList(IntList.fromRange(row.getColumnCount())).array(); + } + for (int col = 0; col < row.getColumnCount(); col++) { + set(titles[col], row.getString(col)); + } + } + + /** * @webref stringdict:method * @brief Returns the number of key/value pairs diff --git a/core/src/processing/data/Table.java b/core/src/processing/data/Table.java index 307b9df67..be8defeec 100644 --- a/core/src/processing/data/Table.java +++ b/core/src/processing/data/Table.java @@ -671,6 +671,12 @@ public class Table { addPiece(start, i, hasEscapedQuotes); start = i+2; return true; + + } else { + // This is a lone-wolf quote, occasionally seen in exports. + // It's a single quote in the middle of some other text, + // and not escaped properly. Pray for the best! + i++; } } else { // not a quoted line diff --git a/core/todo.txt b/core/todo.txt index ebd169cd1..c1608243e 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,4 +1,7 @@ 0257 (3.2.5) +X StringDict(TableRow) constructor +X allow lone double quotes in the midst of csv strings +_ make trim() work on column titles as well _ no prompt shows with selectInput() on 10.11 and 10.12 diff --git a/todo.txt b/todo.txt index 24b37130d..ed123f37b 100755 --- a/todo.txt +++ b/todo.txt @@ -6,6 +6,8 @@ X Contribution Manager does not show all libraries until filter cleared X https://github.com/processing/processing/issues/4840 X fixed in 3.2.4 +_ NVIDIA driver problems (and means to check) +_ https://github.com/processing/processing/issues/4853 _ "Sketch disappeared" infinite pop up dialogs _ https://github.com/processing/processing/pull/4808