Skip to content

Commit 608b3ff

Browse files
committed
Fix bug in linestyle export
1 parent ae2b72b commit 608b3ff

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/qgsdxfexport.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,10 @@ void QgsDxfExport::writeTables( QTextStream& stream )
393393
stream << " 2\n";
394394
stream << "LTYPE\n";
395395
stream << " 70\n";
396-
stream << QString( "%1\n" ).arg( nLineTypes( slList ) ); //number of linetypes
397-
stream << " 0\n";
396+
stream << QString( "%1\n" ).arg( nLineTypes( slList ) + 1 ); //number of linetypes
398397

399398
//add continuous style as default
399+
stream << " 0\n";
400400
stream << "LTYPE\n";
401401
stream << " 2\n";
402402
stream << "CONTINUOUS\n";
@@ -409,7 +409,7 @@ void QgsDxfExport::writeTables( QTextStream& stream )
409409
stream << " 73\n";
410410
stream << "0\n";
411411
stream << " 40\n"; //todo: add segments in group 49
412-
stream << "0\n";
412+
stream << "0.0\n";
413413

414414
//add symbol layer linestyles
415415
QList<QgsSymbolLayerV2*>::const_iterator slIt = slList.constBegin();
@@ -948,9 +948,9 @@ void QgsDxfExport::writeSymbolLayerLinestyle( QTextStream& stream, const QgsSymb
948948
length += *dashIt;
949949
}
950950

951+
stream << " 0\n";
951952
stream << "LTYPE\n";
952953
stream << " 2\n";
953-
954954
stream << QString( "%1\n" ).arg( name );
955955
stream << " 70\n";
956956
stream << "64\n";
@@ -960,14 +960,14 @@ void QgsDxfExport::writeSymbolLayerLinestyle( QTextStream& stream, const QgsSymb
960960
stream << "65\n";
961961
stream << " 73\n";
962962
stream << QString( "%1\n" ).arg( dashPattern.size() ); //number of segments
963-
stream << " 40\n"; //todo: add segments in group 49
963+
stream << " 40\n"; //total length of segments
964964
stream << QString( "%1\n" ).arg( length );
965965

966966
dashIt = dashPattern.constBegin();
967967
bool isSpace = false;
968968
for ( ; dashIt != dashPattern.constEnd(); ++dashIt )
969969
{
970-
stream << "49\n";
970+
stream << " 49\n";
971971

972972
//map units or mm?
973973
double segmentLength = ( isSpace ? -*dashIt : *dashIt );

0 commit comments

Comments
 (0)