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
  • Loading branch information
signedav committed Nov 21, 2018
1 parent b089b57 commit 51ee713
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -875,6 +875,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 51ee713

Please sign in to comment.