Skip to content

Commit 438dd76

Browse files
author
jef
committed
fix #1338
git-svn-id: http://svn.osgeo.org/qgis/trunk@9450 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3072d71 commit 438dd76

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/app/qgsattributedialog.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,13 @@ void QgsAttributeDialog::accept()
328328
QString myFieldName = theField.name();
329329
bool myFlag = false;
330330
QString myFieldValue;
331+
bool modified = true;
331332

332333
QLineEdit *le = dynamic_cast<QLineEdit *>( mpWidgets.value( myIndex ) );
333334
if ( le )
334335
{
335336
myFieldValue = le->text();
337+
modified = le->isModified();
336338
}
337339

338340
QComboBox *cb = dynamic_cast<QComboBox *>( mpWidgets.value( myIndex ) );
@@ -383,10 +385,14 @@ void QgsAttributeDialog::accept()
383385
{
384386
mpFeature->changeAttribute( it.key(), QVariant( myIntValue ) );
385387
}
386-
else
388+
else if ( modified )
387389
{
388390
mpFeature->changeAttribute( it.key(), QVariant( QString::null ) );
389391
}
392+
else
393+
{
394+
mpFeature->changeAttribute( it.key(), myFieldValue );
395+
}
390396
}
391397
break;
392398
case QVariant::Double:
@@ -396,10 +402,14 @@ void QgsAttributeDialog::accept()
396402
{
397403
mpFeature->changeAttribute( it.key(), QVariant( myDblValue ) );
398404
}
399-
else
405+
else if ( modified )
400406
{
401407
mpFeature->changeAttribute( it.key(), QVariant( QString::null ) );
402408
}
409+
else
410+
{
411+
mpFeature->changeAttribute( it.key(), myFieldValue );
412+
}
403413
}
404414
break;
405415
default: //string

0 commit comments

Comments
 (0)