File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments