Skip to content

Commit

Permalink
Use linetype 1 for polygons, check if iodevice is already open
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Nov 8, 2013
1 parent 705ccf5 commit 4984ad6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/qgsdxfexport.cpp
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 4984ad6

Please sign in to comment.