Skip to content

Commit

Permalink
fix #1338
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9450 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 7, 2008
1 parent 3072d71 commit 438dd76
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/app/qgsattributedialog.cpp
Expand Up @@ -328,11 +328,13 @@ void QgsAttributeDialog::accept()
QString myFieldName = theField.name();
bool myFlag = false;
QString myFieldValue;
bool modified = true;

QLineEdit *le = dynamic_cast<QLineEdit *>( mpWidgets.value( myIndex ) );
if ( le )
{
myFieldValue = le->text();
modified = le->isModified();
}

QComboBox *cb = dynamic_cast<QComboBox *>( mpWidgets.value( myIndex ) );
Expand Down Expand Up @@ -383,10 +385,14 @@ void QgsAttributeDialog::accept()
{
mpFeature->changeAttribute( it.key(), QVariant( myIntValue ) );
}
else
else if ( modified )
{
mpFeature->changeAttribute( it.key(), QVariant( QString::null ) );
}
else
{
mpFeature->changeAttribute( it.key(), myFieldValue );
}
}
break;
case QVariant::Double:
Expand All @@ -396,10 +402,14 @@ void QgsAttributeDialog::accept()
{
mpFeature->changeAttribute( it.key(), QVariant( myDblValue ) );
}
else
else if ( modified )
{
mpFeature->changeAttribute( it.key(), QVariant( QString::null ) );
}
else
{
mpFeature->changeAttribute( it.key(), myFieldValue );
}
}
break;
default: //string
Expand Down

0 comments on commit 438dd76

Please sign in to comment.