mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 06:09:17 +01:00
add StringDict constructor, another double quote case
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user