Fix export to dxf.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-02-12 21:13:03 +02:00
parent 33cdac0db1
commit 424f661112
2 changed files with 8 additions and 5 deletions

View File

@ -795,11 +795,13 @@ void MainWindowsNoGUI::DxfFile(const QString &name, int i) const
} }
QPainter painter; QPainter painter;
painter.begin(&generator); if (painter.begin(&generator))
{
scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio); scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio);
painter.end(); painter.end();
} }
} }
}
QT_WARNING_POP QT_WARNING_POP

View File

@ -2549,8 +2549,9 @@ void DL_Dxf::endSequence(DL_CreationInterface* creationInterface)
*/ */
DL_WriterA* DL_Dxf::out(const char* file, DL_Codes::version version) DL_WriterA* DL_Dxf::out(const char* file, DL_Codes::version version)
{ {
char* f = new char[strlen(file)+1]; const int size = strlen(file)+1;
strlcpy(f, file, sizeof(f)); char* f = new char[size];
strlcpy(f, file, size); // Strange thing the sizeof(f) doesn't return correct value
this->version = version; this->version = version;
DL_WriterA* dw = new DL_WriterA(f, version); DL_WriterA* dw = new DL_WriterA(f, version);