Skip to content
Permalink
Browse files

Explicitly list [xlsx] extension for 'MS Office Open XML spreadsheet'…

… format

...because most humans don't associate "MS Office Open XML" with XLS
  • Loading branch information
nyalldawson committed Jun 20, 2018
1 parent f332971 commit 352f3f34cebf6f7c749db1e59879d27263d26340
Showing with 4 additions and 2 deletions.
  1. +2 −2 src/core/qgsvectorfilewriter.cpp
  2. +2 −0 tests/src/python/test_qgsvectorfilewriter.py
@@ -1853,7 +1853,7 @@ class QgsVectorFileWriterMetadataContainer
driverMetadata.insert( QStringLiteral( "XLSX" ),
QgsVectorFileWriter::MetaData(
QStringLiteral( "MS Office Open XML spreadsheet" ),
QObject::tr( "MS Office Open XML spreadsheet" ),
QObject::tr( "MS Office Open XML spreadsheet [XLSX]" ),
QStringLiteral( "*.xlsx" ),
QStringLiteral( "xlsx" ),
datasetOptions,
@@ -1893,7 +1893,7 @@ class QgsVectorFileWriterMetadataContainer
driverMetadata.insert( QStringLiteral( "ODS" ),
QgsVectorFileWriter::MetaData(
QStringLiteral( "Open Document Spreadsheet" ),
QObject::tr( "Open Document Spreadsheet" ),
QObject::tr( "Open Document Spreadsheet [ODS]" ),
QStringLiteral( "*.ods" ),
QStringLiteral( "ods" ),
datasetOptions,
@@ -797,6 +797,8 @@ def testOgrDriverList(self):
sqlite_index = next(i for i, v in enumerate(drivers) if v.driverName == 'SQLite')
self.assertLess(ms_xlsx_index, sqlite_index)

self.assertIn('[XLSX]', drivers[ms_xlsx_index].longName)

# alphabetical sorting
drivers2 = QgsVectorFileWriter.ogrDriverList(QgsVectorFileWriter.VectorFormatOptions())
self.assertTrue(drivers2[0].longName < drivers2[1].longName)

0 comments on commit 352f3f3

Please sign in to comment.
You can’t perform that action at this time.