Skip to content

Commit

Permalink
do not block pasting style on different geometry type layer if destin…
Browse files Browse the repository at this point in the history
…ation categories don't have symbology
  • Loading branch information
3nids committed Oct 4, 2018
1 parent 226fb47 commit 0787a73
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -1059,9 +1059,10 @@ bool QgsMapLayer::importNamedStyle( QDomDocument &myDocument, QString &myErrorMe
{
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( this );
QgsWkbTypes::GeometryType importLayerGeometryType = static_cast<QgsWkbTypes::GeometryType>( myRoot.firstChildElement( QStringLiteral( "layerGeometryType" ) ).text().toInt() );
if ( vl->geometryType() != importLayerGeometryType )
if ( vl->geometryType() != importLayerGeometryType &&
( categories.testFlag( QgsMapLayer::Symbology ) || categories.testFlag( QgsMapLayer::Symbology3D ) ) )
{
myErrorMessage = tr( "Cannot apply style to layer with a different geometry type" );
myErrorMessage = tr( "Cannot apply style with symbology to layer with a different geometry type" );
return false;
}
}
Expand Down

0 comments on commit 0787a73

Please sign in to comment.