Skip to content

Commit

Permalink
only allow 7-bit ASCII for IGES and STEP header information
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Feb 14, 2019
1 parent 1a68b75 commit 7d0e06c
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/Mod/Part/Gui/DlgSettingsGeneral.cpp
Expand Up @@ -22,9 +22,11 @@


#include "PreCompiled.h"
#ifndef _PreComp_
# include <QButtonGroup>
#endif
#ifndef _PreComp_
# include <QButtonGroup>
# include <QRegExp>
# include <QRegExpValidator>
#endif

#include <Interface_Static.hxx>

Expand Down Expand Up @@ -95,6 +97,15 @@ DlgImportExportIges::DlgImportExportIges(QWidget* parent)
bg = new QButtonGroup(this);
bg->addButton(ui->radioButtonBRepOff, 0);
bg->addButton(ui->radioButtonBRepOn, 1);

QRegExp rx;
rx.setPattern(QString::fromLatin1("[\\x00-\\x7F]+"));
QRegExpValidator* companyValidator = new QRegExpValidator(ui->lineEditCompany);
companyValidator->setRegExp(rx);
ui->lineEditCompany->setValidator(companyValidator);
QRegExpValidator* authorValidator = new QRegExpValidator(ui->lineEditAuthor);
authorValidator->setRegExp(rx);
ui->lineEditAuthor->setValidator(authorValidator);
}

/**
Expand Down Expand Up @@ -188,6 +199,15 @@ DlgImportExportStep::DlgImportExportStep(QWidget* parent)
ui = new Ui_DlgImportExportStep();
ui->setupUi(this);
ui->lineEditProduct->setReadOnly(true);

QRegExp rx;
rx.setPattern(QString::fromLatin1("[\\x00-\\x7F]+"));
QRegExpValidator* companyValidator = new QRegExpValidator(ui->lineEditCompany);
companyValidator->setRegExp(rx);
ui->lineEditCompany->setValidator(companyValidator);
QRegExpValidator* authorValidator = new QRegExpValidator(ui->lineEditAuthor);
authorValidator->setRegExp(rx);
ui->lineEditAuthor->setValidator(authorValidator);
}

/**
Expand Down

0 comments on commit 7d0e06c

Please sign in to comment.