Skip to content

Commit

Permalink
Fix regression in vector "save as" that saved shapefiles as .dbf only (
Browse files Browse the repository at this point in the history
…fixes #14158)
  • Loading branch information
wonder-sk committed Jan 23, 2016
1 parent 8346601 commit 5512d54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/app/ogr/qgsvectorlayersaveasdialog.cpp
Expand Up @@ -395,21 +395,24 @@ QStringList QgsVectorLayerSaveAsDialog::layerOptions() const
case QgsVectorFileWriter::Int:
{
QSpinBox* sb = mLayerOptionsGroupBox->findChild<QSpinBox*>( it.key() );
options << QString( "%1=%2" ).arg( it.key() ).arg( sb->value() );
if ( sb )
options << QString( "%1=%2" ).arg( it.key() ).arg( sb->value() );
break;
}

case QgsVectorFileWriter::Set:
{
QComboBox* cb = mLayerOptionsGroupBox->findChild<QComboBox*>( it.key() );
options << QString( "%1=%2" ).arg( it.key(), cb->currentText() );
if ( cb && !cb->itemData( cb->currentIndex() ).isNull() )
options << QString( "%1=%2" ).arg( it.key(), cb->currentText() );
break;
}

case QgsVectorFileWriter::String:
{
QLineEdit* le = mLayerOptionsGroupBox->findChild<QLineEdit*>( it.key() );
options << QString( "%1=%2" ).arg( it.key(), le->text() );
if ( le )
options << QString( "%1=%2" ).arg( it.key(), le->text() );
break;
}

Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsvectorfilewriter.cpp
Expand Up @@ -683,7 +683,8 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
<< "ARCZ"
<< "POLYGONZ"
<< "MULTIPOINTZ",
"NULL" // Default value
QString(), // Default value
true // Allow None
) );

layerOptions.insert( "ENCODING", new SetOption(
Expand Down

1 comment on commit 5512d54

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 5512d54 Jan 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wonder-wk , wonderful!

Please sign in to comment.