mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Issue 923 oops preserve output order
git-svn-id: https://zxing.googlecode.com/svn/trunk@1874 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
3f26da0f80
commit
b151a85c7e
|
@ -266,19 +266,29 @@ public final class HistoryManager {
|
||||||
}
|
}
|
||||||
Cursor cursor = null;
|
Cursor cursor = null;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
cursor = db.query(DBHelper.TABLE_NAME,
|
cursor = db.query(DBHelper.TABLE_NAME,
|
||||||
COLUMNS,
|
COLUMNS,
|
||||||
null, null, null, null,
|
null, null, null, null,
|
||||||
DBHelper.TIMESTAMP_COL + " DESC");
|
DBHelper.TIMESTAMP_COL + " DESC");
|
||||||
|
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
for (int col = 0; col < COLUMNS.length; col++) {
|
|
||||||
historyText.append('"').append(massageHistoryField(cursor.getString(col))).append("\",");
|
historyText.append('"').append(massageHistoryField(cursor.getString(0))).append("\",");
|
||||||
}
|
historyText.append('"').append(massageHistoryField(cursor.getString(1))).append("\",");
|
||||||
|
historyText.append('"').append(massageHistoryField(cursor.getString(2))).append("\",");
|
||||||
|
historyText.append('"').append(massageHistoryField(cursor.getString(3))).append("\",");
|
||||||
|
|
||||||
// Add timestamp again, formatted
|
// Add timestamp again, formatted
|
||||||
long timestamp = cursor.getLong(3);
|
long timestamp = cursor.getLong(3);
|
||||||
historyText.append('"').append(massageHistoryField(
|
historyText.append('"').append(massageHistoryField(
|
||||||
EXPORT_DATE_TIME_FORMAT.format(new Date(timestamp)))).append("\"\r\n");
|
EXPORT_DATE_TIME_FORMAT.format(new Date(timestamp)))).append("\",");
|
||||||
|
|
||||||
|
// Above we're preserving the old ordering of columns which had formatted data in position 5
|
||||||
|
|
||||||
|
historyText.append('"').append(massageHistoryField(cursor.getString(4))).append("\"\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
if (cursor != null) {
|
if (cursor != null) {
|
||||||
cursor.close();
|
cursor.close();
|
||||||
|
|
Loading…
Reference in a new issue