Skip to content
Permalink
Browse files

Fix crashes when using atlas and expressions which rely on specialcol…

…umns. Bring on context based expressions so we can remove this hack!
  • Loading branch information
nyalldawson committed Oct 7, 2014
1 parent 1b99780 commit a5fe17480415e2c9169265e1235fcfb031c1234f
Showing with 15 additions and 1 deletion.
  1. +11 −0 src/app/composer/qgscomposer.cpp
  2. +4 −1 src/app/qgisapp.cpp
@@ -996,6 +996,7 @@ void QgsComposer::on_mActionAtlasPreview_triggered( bool checked )

if ( checked )
{
mapCanvas()->stopRendering();
emit( atlasPreviewFeatureChanged() );
}
else
@@ -1014,6 +1015,8 @@ void QgsComposer::on_mActionAtlasNext_triggered()
return;
}

mapCanvas()->stopRendering();

loadAtlasPredefinedScalesFromProject();
atlasMap->nextFeature();
emit( atlasPreviewFeatureChanged() );
@@ -1027,6 +1030,8 @@ void QgsComposer::on_mActionAtlasPrev_triggered()
return;
}

mapCanvas()->stopRendering();

loadAtlasPredefinedScalesFromProject();
atlasMap->prevFeature();
emit( atlasPreviewFeatureChanged() );
@@ -1040,6 +1045,8 @@ void QgsComposer::on_mActionAtlasFirst_triggered()
return;
}

mapCanvas()->stopRendering();

loadAtlasPredefinedScalesFromProject();
atlasMap->firstFeature();
emit( atlasPreviewFeatureChanged() );
@@ -1053,6 +1060,8 @@ void QgsComposer::on_mActionAtlasLast_triggered()
return;
}

mapCanvas()->stopRendering();

loadAtlasPredefinedScalesFromProject();
atlasMap->lastFeature();
emit( atlasPreviewFeatureChanged() );
@@ -3573,6 +3582,8 @@ void QgsComposer::setAtlasFeature( QgsMapLayer* layer, const QgsFeature& feat )
//bring composer window to foreground
activate();

mapCanvas()->stopRendering();

//set current preview feature id
atlas.prepareForFeature( &feat );
emit( atlasPreviewFeatureChanged() );
@@ -5966,7 +5966,7 @@ void QgisApp::editPaste( QgsMapLayer *destinationLayer )
// convert geometry to match destination layer
QGis::GeometryType destType = pasteVectorLayer->geometryType();
bool destIsMulti = QGis::isMultiType( pasteVectorLayer->wkbType() );
if ( pasteVectorLayer->storageType() == "ESRI Shapefile" && destType != QGis::Point)
if ( pasteVectorLayer->storageType() == "ESRI Shapefile" && destType != QGis::Point )
{
// force destination to multi if shapefile if it's not a point file
// Should we really force anything here? Isn't it better to just transform?
@@ -6265,6 +6265,9 @@ void QgisApp::copyFeatures( QgsFeatureStore & featureStore )

void QgisApp::refreshMapCanvas()
{
//stop any current rendering
mMapCanvas->stopRendering();

//reload cached provider data
QgsMapLayerRegistry::instance()->reloadAllLayers();

0 comments on commit a5fe174

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