Skip to content

Commit

Permalink
Merge pull request #3233 from alexbruy/paste-style-fix
Browse files Browse the repository at this point in the history
don't apply raster style to vectors (fix #15001)
  • Loading branch information
alexbruy authored Jun 27, 2016
2 parents eabdb65 + 3ece8ac commit c913a7f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7671,6 +7671,13 @@ void QgisApp::pasteStyle( QgsMapLayer * destinationLayer )
return;
}

bool isVectorStyle = doc.elementsByTagName( "pipe" ).isEmpty();
if (( selectionLayer->type() == QgsMapLayer::RasterLayer && isVectorStyle ) ||
( selectionLayer->type() == QgsMapLayer::VectorLayer && !isVectorStyle ) )
{
return;
}

if ( !selectionLayer->importNamedStyle( doc, errorMsg ) )
{
messageBar()->pushMessage( tr( "Cannot paste style" ),
Expand Down

0 comments on commit c913a7f

Please sign in to comment.