Skip to content
Permalink
Browse files

fix beata crash

git-svn-id: http://svn.osgeo.org/qgis/trunk@10433 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 28, 2009
1 parent 58605dc commit 6a4ddd6476355b6f6ef4796cfe97c104d453af20
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/app/attributetable/BeataModel.cpp
@@ -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;
@@ -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() )
@@ -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() )
@@ -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());

0 comments on commit 6a4ddd6

Please sign in to comment.
You can’t perform that action at this time.