Skip to content

Commit

Permalink
and followup 84dc1ba :(
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 15, 2012
1 parent 84dc1ba commit 836f235
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/core/qgsmaprenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,11 +1116,18 @@ QgsCoordinateTransform *QgsMapRenderer::tr( QgsMapLayer *layer )
mCachedTrForLayer = layer;

connect( layer, SIGNAL( layerCrsChanged() ), this, SLOT( invalidateCachedLayerCrs() ) );
connect( layer, SIGNAL( destroyed() ), this, SLOT( cachedLayerDestroyed() ) );
}

return mCachedTr;
}

void QgsMapRenderer::cachedLayerDestroyed()
{
if ( mCachedTrForLayer == sender() )
mCachedTrForLayer = 0;
}

void QgsMapRenderer::invalidateCachedLayerCrs()
{
if ( mCachedTrForLayer )
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgsmaprenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ class CORE_EXPORT QgsMapRenderer : public QObject
//! invalidate cached layer CRS
void invalidateCachedLayerCrs();

//! cached layer was destroyed
void cachedLayerDestroyed();

protected:

//! adjust extent to fit the pixmap size
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgspoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ QString QgsPoint::toString() const

QString QgsPoint::toString( int thePrecision ) const
{
QString rep = QString::number( m_x, 'f', thePrecision ) + QString( "," ) +
QString::number( m_y, 'f', thePrecision );
return rep;
QString x = qIsFinite( m_x ) ? QString::number( m_x, 'f', thePrecision ) : QObject::tr( "infinite" );
QString y = qIsFinite( m_y ) ? QString::number( m_y, 'f', thePrecision ) : QObject::tr( "infinite" );
return QString( "%1,%2" ).arg( x ).arg( y );
}

QString QgsPoint::toDegreesMinutesSeconds( int thePrecision ) const
Expand Down

0 comments on commit 836f235

Please sign in to comment.