Skip to content

Commit

Permalink
Disable current cell on editing off
Browse files Browse the repository at this point in the history
because otherwise on single cell change the change would not been stored in mEditBuffer

fixes #15975

(cherry-picked from 51ee713)
  • Loading branch information
signedav committed Dec 4, 2018
1 parent ee25bb4 commit 8a47643
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -874,6 +874,12 @@ void QgsAttributeTableDialog::mActionToggleEditing_toggled( bool )
{
if ( !mLayer )
return;

//this has to be done, because in case only one cell has been changed and is still enabled, the change
//would not be added to the mEditBuffer. By disabling, it looses focus and the change will be stored.
if ( mLayer->isEditable() && mMainView->tableView()->indexWidget( mMainView->tableView()->currentIndex() ) )
mMainView->tableView()->indexWidget( mMainView->tableView()->currentIndex() )->setEnabled( false );

if ( !QgisApp::instance()->toggleEditing( mLayer ) )
{
// restore gui state if toggling was canceled or layer commit/rollback failed
Expand Down

0 comments on commit 8a47643

Please sign in to comment.