@@ -261,7 +261,7 @@ void QgsMapRenderer::render( QPainter* painter, double* forceWidthScale )
261
261
262
262
mDrawing = true ;
263
263
264
- const QgsCoordinateTransform* ct;
264
+ const QgsCoordinateTransform * ct;
265
265
266
266
#ifdef QGISDEBUG
267
267
QgsDebugMsg ( " Starting to render layer stack." );
@@ -794,7 +794,7 @@ bool QgsMapRenderer::splitLayersExtent( QgsMapLayer* layer, QgsRectangle& extent
794
794
// extent separately.
795
795
static const double splitCoord = 180.0 ;
796
796
797
- const QgsCoordinateTransform* transform = transformation ( layer );
797
+ const QgsCoordinateTransform * transform = transformation ( layer );
798
798
if ( layer->crs ().geographicFlag () )
799
799
{
800
800
// Note: ll = lower left point
@@ -848,7 +848,7 @@ QgsRectangle QgsMapRenderer::layerExtentToOutputExtent( QgsMapLayer* theLayer, Q
848
848
{
849
849
try
850
850
{
851
- const QgsCoordinateTransform* transform = transformation ( theLayer );
851
+ const QgsCoordinateTransform * transform = transformation ( theLayer );
852
852
if ( transform )
853
853
{
854
854
extent = transform->transformBoundingBox ( extent );
@@ -867,14 +867,21 @@ QgsRectangle QgsMapRenderer::layerExtentToOutputExtent( QgsMapLayer* theLayer, Q
867
867
868
868
QgsRectangle QgsMapRenderer::outputExtentToLayerExtent ( QgsMapLayer* theLayer, QgsRectangle extent )
869
869
{
870
- QgsDebugMsg ( QString ( " layer sourceCrs = " + transformation ( theLayer )->sourceCrs ().authid () ) );
871
- QgsDebugMsg ( QString ( " layer destCRS = " + transformation ( theLayer )->destCRS ().authid () ) );
870
+ #if QGISDEBUG
871
+ const QgsCoordinateTransform *transform = transformation ( theLayer );
872
+ QgsDebugMsg ( QString ( " layer sourceCrs = " + ( transform ? transform->sourceCrs ().authid () : " none" ) ) );
873
+ QgsDebugMsg ( QString ( " layer destCRS = " + ( transform ? transform->destCRS ().authid () : " none" ) ) );
872
874
QgsDebugMsg ( QString ( " extent = " + extent.toString () ) );
875
+ #endif
873
876
if ( hasCrsTransformEnabled () )
874
877
{
875
878
try
876
879
{
877
- extent = transformation ( theLayer )->transformBoundingBox ( extent, QgsCoordinateTransform::ReverseTransform );
880
+ const QgsCoordinateTransform *transform = transformation ( theLayer );
881
+ if ( transform )
882
+ {
883
+ extent = transform->transformBoundingBox ( extent, QgsCoordinateTransform::ReverseTransform );
884
+ }
878
885
}
879
886
catch ( QgsCsException &cse )
880
887
{
@@ -893,7 +900,11 @@ QgsPoint QgsMapRenderer::layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint
893
900
{
894
901
try
895
902
{
896
- point = transformation ( theLayer )->transform ( point, QgsCoordinateTransform::ForwardTransform );
903
+ const QgsCoordinateTransform *transform = transformation ( theLayer );
904
+ if ( transform )
905
+ {
906
+ point = transform->transform ( point, QgsCoordinateTransform::ForwardTransform );
907
+ }
897
908
}
898
909
catch ( QgsCsException &cse )
899
910
{
@@ -913,7 +924,11 @@ QgsRectangle QgsMapRenderer::layerToMapCoordinates( QgsMapLayer* theLayer, QgsRe
913
924
{
914
925
try
915
926
{
916
- rect = transformation ( theLayer )->transform ( rect, QgsCoordinateTransform::ForwardTransform );
927
+ const QgsCoordinateTransform *transform = transformation ( theLayer );
928
+ if ( transform )
929
+ {
930
+ rect = transform->transform ( rect, QgsCoordinateTransform::ForwardTransform );
931
+ }
917
932
}
918
933
catch ( QgsCsException &cse )
919
934
{
@@ -933,7 +948,9 @@ QgsPoint QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint
933
948
{
934
949
try
935
950
{
936
- point = transformation ( theLayer )->transform ( point, QgsCoordinateTransform::ReverseTransform );
951
+ const QgsCoordinateTransform *transform = transformation ( theLayer );
952
+ if ( transform )
953
+ point = transform->transform ( point, QgsCoordinateTransform::ReverseTransform );
937
954
}
938
955
catch ( QgsCsException &cse )
939
956
{
@@ -953,7 +970,9 @@ QgsRectangle QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsRe
953
970
{
954
971
try
955
972
{
956
- rect = transformation ( theLayer )->transform ( rect, QgsCoordinateTransform::ReverseTransform );
973
+ const QgsCoordinateTransform *transform = transformation ( theLayer );
974
+ if ( transform )
975
+ rect = transform->transform ( rect, QgsCoordinateTransform::ReverseTransform );
957
976
}
958
977
catch ( QgsCsException &cse )
959
978
{
@@ -1245,7 +1264,7 @@ void QgsMapRenderer::setLabelingEngine( QgsLabelingEngineInterface* iface )
1245
1264
mLabelingEngine = iface;
1246
1265
}
1247
1266
1248
- const QgsCoordinateTransform* QgsMapRenderer::transformation ( const QgsMapLayer *layer ) const
1267
+ const QgsCoordinateTransform * QgsMapRenderer::transformation ( const QgsMapLayer *layer ) const
1249
1268
{
1250
1269
if ( !layer || !mDestCRS )
1251
1270
{
0 commit comments