Skip to content

Commit eefbd88

Browse files
author
rblazek
committedFeb 21, 2006
conditionalized GPJ_osr_to_grass bug
git-svn-id: http://svn.osgeo.org/qgis/trunk@4889 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 66db8d3 commit eefbd88

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed
 

‎src/plugins/grass/qgsgrassnewmapset.cpp

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -482,32 +482,22 @@ void QgsGrassNewMapset::setGrassProjection()
482482
std::cerr << "wkt = " << wkt << std::endl;
483483
}
484484
#endif
485+
486+
int ret;
485487
// Note: GPJ_osr_to_grass() defaults in PROJECTION_XY if projection
486488
// cannot be set
487489

488-
// There was a bug in GRASS,
489-
// fixed Fri Jan 27 18:21:15 2006 UTC in HEAD(>=6.1)
490-
// it is present in 6.0.x line
491-
// G_version cannot be used as it was also buggy in 6.0.x
492-
int major = QString( GRASS_VERSION_MAJOR ).toInt();
493-
int minor = QString( GRASS_VERSION_MINOR ).toInt();
494-
#ifdef QGISDEBUG
495-
std::cerr << "major = " << major << " minor = " << minor << std::endl;
490+
// There was a bug in GRASS, it is present in 6.0.x line
491+
#if GRASS_VERSION_MAJOR == 6 && GRASS_VERSION_MINOR >= 1
492+
ret = GPJ_osr_to_grass ( &mCellHead, &mProjInfo,
493+
&mProjUnits, hSRS, 0);
494+
#else
495+
// Buggy version:
496+
ret = GPJ_osr_to_grass ( &mCellHead, &mProjInfo,
497+
&mProjUnits, (void **)hSRS, 0);
496498
#endif
497-
int ret;
498-
499-
if ( major == 6 && minor == 0 )
500-
{
501-
// Buggy version:
502-
ret = GPJ_osr_to_grass ( &mCellHead, &mProjInfo,
503-
&mProjUnits, (void **)hSRS, 0);
504-
505-
} else {
506-
ret = GPJ_osr_to_grass ( &mCellHead, &mProjInfo,
507-
&mProjUnits, hSRS, 0);
508-
}
509499

510-
// Note: I seems that GPJ_osr_to_grass()returns always 1,
500+
// Note: It seems that GPJ_osr_to_grass()returns always 1,
511501
// -> test if mProjInfo was set
512502

513503
#ifdef QGISDEBUG

0 commit comments

Comments
 (0)
Please sign in to comment.