display_attributes_of_a_null_geometry.patch

crude patch to solve the problem - Gabriele Monfardini, 2009-07-18 07:06 AM

Download (1.2 KB)

View differences:

src/core/qgsvectordataprovider.cpp (copia locale)
28 28
    : QgsDataProvider( uri ),
29 29
    mCacheMinMaxDirty( TRUE ),
30 30
    mEncoding( QTextCodec::codecForLocale() ),
31
    mFetchFeaturesWithoutGeom( FALSE )
31
    mFetchFeaturesWithoutGeom( TRUE )
32 32
{
33 33
}
34 34

  
src/providers/ogr/qgsogrprovider.cpp (copia locale)
370 370
    feature.setTypeName( featureTypeName );
371 371

  
372 372
    /* fetch geometry */
373
    if ( mFetchGeom || mUseIntersect )
373
    if ( OGR_F_GetGeometryRef( fet ) != NULL && ( mFetchGeom || mUseIntersect ) )
374 374
    {
375 375
      OGRGeometryH geom = OGR_F_GetGeometryRef( fet );
376 376

  
......
415 415
  if ( fet )
416 416
  {
417 417
    OGR_F_Destroy( fet );
418
    feature.setValid( true );
418
    if ( OGR_F_GetGeometryRef( fet ) != NULL )
419
    {
420
      feature.setValid( true );
421
    }
422
    else
423
    {
424
      feature.setValid( false );
425
    }
419 426
    return true;
420 427
  }
421 428
  else