Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 26, 2013
1 parent 4904c06 commit 226c006
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/app/qgsclipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,34 +147,35 @@ QgsFeatureList QgsClipboard::copyOf( const QgsFields &fields )

#ifndef Q_OS_WIN
QString text = cb->text( QClipboard::Selection );
#endif
#else
QString text = cb->text( QClipboard::Clipboard );
#endif

QStringList values = text.split("\n");
QStringList values = text.split( "\n" );
if ( values.isEmpty() || text.isEmpty() )
return mFeatureClipboard;
return mFeatureClipboard;

QgsFeatureList features;
foreach ( QString row, values )
{
// Assume that it's just WKT for now.
QgsGeometry* geometry = QgsGeometry::fromWkt( row );
if ( !geometry )
continue;
// Assume that it's just WKT for now.
QgsGeometry* geometry = QgsGeometry::fromWkt( row );
if ( !geometry )
continue;

QgsFeature* feature = new QgsFeature();
if ( !fields.isEmpty() )
feature->setFields( &fields , true );
QgsFeature* feature = new QgsFeature();
if ( !fields.isEmpty() )
feature->setFields( &fields , true );

feature->setGeometry( geometry );
features.append( QgsFeature( *feature ));
feature->setGeometry( geometry );
features.append( QgsFeature( *feature ) );
}

if ( features.isEmpty() )
return mFeatureClipboard;
return mFeatureClipboard;

if ( !fields.isEmpty() )
mFeatureFields = fields;
mFeatureFields = fields;

return features;
}
Expand All @@ -200,12 +201,13 @@ bool QgsClipboard::empty()
QClipboard *cb = QApplication::clipboard();
#ifndef Q_OS_WIN
QString text = cb->text( QClipboard::Selection );
#endif
#else
QString text = cb->text( QClipboard::Clipboard );
#endif
return text.isEmpty() && mFeatureClipboard.empty();
}

QgsFeatureList QgsClipboard::transformedCopyOf(QgsCoordinateReferenceSystem destCRS , const QgsFields &fields)
QgsFeatureList QgsClipboard::transformedCopyOf( QgsCoordinateReferenceSystem destCRS , const QgsFields &fields )
{
QgsFeatureList featureList = copyOf( fields );
QgsCoordinateTransform ct( crs(), destCRS );
Expand Down

0 comments on commit 226c006

Please sign in to comment.