Skip to content
Permalink
Browse files
fix #1338
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9450 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 7, 2008
1 parent c2d2673 commit e0663b46a77c4aa17d1e6fc58cf401707bc54f04
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/app/qgsattributedialog.cpp
@@ -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 ) );
@@ -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:
@@ -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

0 comments on commit e0663b4

Please sign in to comment.