Skip to content

Commit

Permalink
[clipboard] Do not add a geometry column when copying features from a…
Browse files Browse the repository at this point in the history
… non-geometry/table layer
  • Loading branch information
nirvn authored and nyalldawson committed Sep 14, 2024
1 parent fcf436c commit 4109c8d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/qgsclipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,19 @@ void QgsClipboard::replaceWithCopyOf( QgsFeatureStore &featureStore, QgsVectorLa

void QgsClipboard::generateClipboardText( QString &textContent, QString &htmlContent ) const
{
const CopyFormat format = QgsSettings().enumValue( QStringLiteral( "qgis/copyFeatureFormat" ), AttributesWithWKT );
CopyFormat format = QgsSettings().enumValue( QStringLiteral( "qgis/copyFeatureFormat" ), AttributesWithWKT );

textContent.clear();
htmlContent.clear();

if ( QgsVectorLayer *vectorLayer = qobject_cast<QgsVectorLayer *>( mFeatureLayer.data() ) )
{
if ( vectorLayer->geometryType() == Qgis::GeometryType::Null )
{
format = AttributesOnly;
}
}

switch ( format )
{
case AttributesOnly:
Expand Down

0 comments on commit 4109c8d

Please sign in to comment.