Skip to content

Commit 40dc7df

Browse files
committed
fix #5905
1 parent bddb759 commit 40dc7df

File tree

3 files changed

+2
-36
lines changed

3 files changed

+2
-36
lines changed

src/app/qgsattributetabledialog.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -680,33 +680,10 @@ void QgsAttributeTableDialog::editingToggled()
680680
mRemoveAttribute->setEnabled( canDeleteAttributes && mLayer->isEditable() );
681681
mAddFeature->setEnabled( canAddFeatures && mLayer->isEditable() && mLayer->geometryType() == QGis::NoGeometry );
682682

683-
// (probably reload data if user stopped editing - possible revert)
684-
mModel->reload( mModel->index( 0, 0 ), mModel->index( mModel->rowCount() - 1, mModel->columnCount() - 1 ) );
685-
686683
// not necessary to set table read only if layer is not editable
687684
// because model always reflects actual state when returning item flags
688685
}
689686

690-
// not used now
691-
void QgsAttributeTableDialog::startEditing()
692-
{
693-
mLayer->startEditing();
694-
}
695-
696-
// not used now
697-
void QgsAttributeTableDialog::submit()
698-
{
699-
mLayer->commitChanges();
700-
}
701-
702-
// not used now
703-
void QgsAttributeTableDialog::revert()
704-
{
705-
mLayer->rollBack();
706-
mModel->revert();
707-
mModel->reload( mModel->index( 0, 0 ), mModel->index( mModel->rowCount() - 1, mModel->columnCount() - 1 ) );
708-
}
709-
710687
void QgsAttributeTableDialog::on_mAddAttribute_clicked()
711688
{
712689
if ( !mLayer )

src/app/qgsattributetabledialog.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDia
6666
void finished();
6767

6868
private slots:
69-
/**
70-
* submits the data
71-
*/
72-
void submit();
73-
/**
74-
* Reverts the changes
75-
*/
76-
void revert();
7769
/**
7870
* Launches search
7971
*/
@@ -148,10 +140,7 @@ class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDia
148140
* Shows advanced actions
149141
*/
150142
void showAdvanced();
151-
/**
152-
* Starts editing mode
153-
*/
154-
void startEditing();
143+
155144
/**Opens dialog to add new attribute*/
156145
void on_mAddAttribute_clicked();
157146
/**Opens dialog to remove attribute*/

src/gui/attributetable/qgsattributetablemodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ QVariant QgsAttributeTableModel::headerData( int section, Qt::Orientation orient
388388
{
389389
return QVariant( section );
390390
}
391-
else if ( section < mFieldCount )
391+
else if ( section >= 0 && section < mFieldCount )
392392
{
393393
QString attributeName = mLayer->attributeAlias( mAttributes[section] );
394394
if ( attributeName.isEmpty() )

0 commit comments

Comments
 (0)