Skip to content
Permalink
Browse files

do not block pasting style on different geometry type layer if destin…

…ation categories don't have symbology
  • Loading branch information
3nids committed Oct 4, 2018
1 parent 226fb47 commit 0787a73d5b85ac36fdad6923c79629110136dfbc
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/qgsmaplayer.cpp
@@ -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;
}
}

0 comments on commit 0787a73

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