Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 a5fe174
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -996,6 +996,7 @@ void QgsComposer::on_mActionAtlasPreview_triggered( bool checked )

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

mapCanvas()->stopRendering();

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

mapCanvas()->stopRendering();

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

mapCanvas()->stopRendering();

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

mapCanvas()->stopRendering();

loadAtlasPredefinedScalesFromProject();
atlasMap->lastFeature();
emit( atlasPreviewFeatureChanged() );
Expand Down Expand Up @@ -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() );
Expand Down
5 changes: 4 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -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?
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit a5fe174

Please sign in to comment.