Skip to content
Permalink
Browse files

Use linetype 1 for polygons, check if iodevice is already open

  • Loading branch information
mhugent committed Nov 8, 2013
1 parent 705ccf5 commit 4984ad6de9ac0f32cf3fe1d0a217a568d4e019a4
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/qgsdxfexport.cpp
@@ -301,7 +301,7 @@ int QgsDxfExport::writeToFile( QIODevice* d )
return 1;
}

if ( !d->open( QIODevice::WriteOnly ) )
if ( !d->isOpen() && !d->open( QIODevice::WriteOnly ) )
{
return 2;
}
@@ -409,8 +409,8 @@ void QgsDxfExport::writeTables( QTextStream& stream )
stream << "LAYER\n";
stream << " 70\n";
stream << mLayers.count() << "\n";
QList< QgsMapLayer* >::iterator layerIt = mLayers.begin();
for ( ; layerIt != mLayers.end(); ++layerIt )
QList< QgsMapLayer* >::const_iterator layerIt = mLayers.constBegin();
for ( ; layerIt != mLayers.constEnd(); ++layerIt )
{
stream << " 0\n";
stream << "LAYER\n";
@@ -612,7 +612,7 @@ void QgsDxfExport::writePolyline( QTextStream& stream, const QgsPolyline& line,
stream << " 66\n";
stream << "1\n";
stream << " 70\n";
int type = polygon ? 49 : 0;
int type = polygon ? 1 : 0;
stream << type << "\n";
stream << " 40\n";
stream << width << "\n";

0 comments on commit 4984ad6

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