Skip to content

Commit

Permalink
fix beata crash
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@10433 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 28, 2009
1 parent 58605dc commit 6a4ddd6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/attributetable/BeataModel.cpp
Expand Up @@ -105,9 +105,11 @@ void BeataModel::featureDeleted( int fid )
{
QgsDebugMsg( "entered." );

#ifdef QGISDEBUG
int idx = mIdRowMap[fid];
QgsDebugMsg( idx );
QgsDebugMsg( fid );
#endif

#if 0
--mFeatureCount;
Expand Down Expand Up @@ -406,6 +408,9 @@ QVariant BeataModel::data( const QModelIndex &index, int role ) const
mLastRow = ( QgsAttributeMap * ) & mFeat.attributeMap();
}

if( !mLastRow )
return QVariant( "ERROR" );

QVariant& val = ( *mLastRow )[ mAttributes[index.column()] ];

if ( val.isNull() )
Expand Down Expand Up @@ -537,6 +542,9 @@ QVariant BeataMemModel::data( const QModelIndex &index, int role ) const
mLastRow = ( QgsAttributeMap * ) & mFeat.attributeMap();
}

if( !mLastRow )
return QVariant( "ERROR" );

QVariant &val = ( *mLastRow )[ mAttributes[index.column()] ];

if ( val.isNull() )
Expand Down Expand Up @@ -574,7 +582,7 @@ bool BeataMemModel::setData( const QModelIndex &index, const QVariant &value, in
{
mLastRowId = rowToId( index.row() );
mFeat = mFeatureMap[rowToId( index.row() )];
mLastRow = ( QgsAttributeMap * )( &( mFeat.attributeMap() ) );
mLastRow = ( QgsAttributeMap * ) &mFeat.attributeMap();


// QgsDebugMsg(mFeatureMap[rowToId(index.row())].id());
Expand Down

0 comments on commit 6a4ddd6

Please sign in to comment.