@@ -6812,24 +6812,6 @@ void QgisApp::copyStyle( QgsMapLayer * sourceLayer )
6812
6812
rootNode.setAttribute ( " minimumScale" , QString::number ( selectionLayer->minimumScale () ) );
6813
6813
rootNode.setAttribute ( " maximumScale" , QString::number ( selectionLayer->maximumScale () ) );
6814
6814
6815
- /*
6816
- * Check to see if the layer is vector - in which case we should also copy its geometryType
6817
- * to avoid eventually pasting to a layer with a different geometry
6818
- */
6819
- if ( selectionLayer->type () == 0 )
6820
- {
6821
- // Getting the selectionLayer geometry
6822
- QgsVectorLayer *SelectionGeometry = static_cast <QgsVectorLayer*>( selectionLayer );
6823
- QString geoType = QString::number ( SelectionGeometry->geometryType () );
6824
-
6825
- // Adding geometryinformation
6826
- QDomElement layerGeometryType = doc.createElement ( " layerGeometryType" );
6827
- QDomText type = doc.createTextNode ( geoType );
6828
-
6829
- layerGeometryType.appendChild ( type );
6830
- rootNode.appendChild ( layerGeometryType );
6831
- }
6832
-
6833
6815
QString errorMsg;
6834
6816
if ( !selectionLayer->writeSymbology ( rootNode, doc, errorMsg ) )
6835
6817
{
@@ -6871,20 +6853,6 @@ void QgisApp::pasteStyle( QgsMapLayer * destinationLayer )
6871
6853
6872
6854
QDomElement rootNode = doc.firstChildElement ( " qgis" );
6873
6855
6874
- // Test for matching geometry type on vector layers when pasting
6875
- if ( selectionLayer->type () == QgsMapLayer::VectorLayer )
6876
- {
6877
- QgsVectorLayer *selectionVectorLayer = static_cast <QgsVectorLayer*>( selectionLayer );
6878
- int pasteLayerGeometryType = doc.elementsByTagName ( " layerGeometryType" ).item ( 0 ).toElement ().text ().toInt ();
6879
- if ( selectionVectorLayer->geometryType () != pasteLayerGeometryType )
6880
- {
6881
- messageBar ()->pushMessage ( tr ( " Cannot paste style to layer with a different geometry type" ),
6882
- tr ( " Your copied style does not match the layer you are pasting to" ),
6883
- QgsMessageBar::INFO, messageTimeout () );
6884
- return ;
6885
- }
6886
- }
6887
-
6888
6856
if ( !selectionLayer->readSymbology ( rootNode, errorMsg ) )
6889
6857
{
6890
6858
messageBar ()->pushMessage ( errorMsg,
0 commit comments