Skip to content
Permalink
Browse files
fix #1338
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 438dd760e588d0372059d1d2fc1d1db780b67fe7
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 438dd76

Please sign in to comment.