From bba4a2a46aa90f8a6c8fc87537ba7219a12d4b2f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 20 Apr 2019 20:19:30 +0300 Subject: [PATCH] Fixed issue #967. Variable must not include new line character. --HG-- branch : release --- ChangeLog.txt | 1 + src/app/valentina/xml/vpattern.cpp | 2 +- src/libs/ifc/schema/individual_measurements/v0.5.0.xsd | 2 +- src/libs/ifc/schema/pattern/v0.7.12.xsd | 2 +- src/libs/ifc/schema/standard_measurements/v0.4.4.xsd | 2 +- src/libs/qmuparser/qmudef.cpp | 6 +++--- src/libs/vformat/vmeasurements.cpp | 2 +- src/libs/vpatterndb/variables/vinternalvariable.cpp | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 815c08a4c..531459e12 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -22,6 +22,7 @@ - [#963] Bug in tool Point intersect curve and axis. - [#964] Assign operator crashes math parser. - [#966] Unable to control Approximation scale for arc with length. +- [#967] Variable must not include new line character. # Version 0.6.1 October 23, 2018 - [#885] Regression. Broken support for multi size measurements. diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 76c4b1ebc..32a4dae11 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -3835,7 +3835,7 @@ void VPattern::ParseIncrementsElement(const QDomNode &node, const Document &pars { if (domElement.tagName() == TagIncrement) { - const QString name = GetParametrString(domElement, AttrName, QString()); + const QString name = GetParametrString(domElement, AttrName, QString()).simplified(); const QString desc = GetParametrEmptyString(domElement, AttrDescription); const QString formula = GetParametrString(domElement, AttrFormula, QChar('0')); bool ok = false; diff --git a/src/libs/ifc/schema/individual_measurements/v0.5.0.xsd b/src/libs/ifc/schema/individual_measurements/v0.5.0.xsd index c7bca79f1..fd8ba97f7 100644 --- a/src/libs/ifc/schema/individual_measurements/v0.5.0.xsd +++ b/src/libs/ifc/schema/individual_measurements/v0.5.0.xsd @@ -42,7 +42,7 @@ - + diff --git a/src/libs/ifc/schema/pattern/v0.7.12.xsd b/src/libs/ifc/schema/pattern/v0.7.12.xsd index 73eac9aa8..1080cf218 100644 --- a/src/libs/ifc/schema/pattern/v0.7.12.xsd +++ b/src/libs/ifc/schema/pattern/v0.7.12.xsd @@ -763,7 +763,7 @@ - + diff --git a/src/libs/ifc/schema/standard_measurements/v0.4.4.xsd b/src/libs/ifc/schema/standard_measurements/v0.4.4.xsd index 16fee792f..c49f3ee16 100644 --- a/src/libs/ifc/schema/standard_measurements/v0.4.4.xsd +++ b/src/libs/ifc/schema/standard_measurements/v0.4.4.xsd @@ -43,7 +43,7 @@ - + diff --git a/src/libs/qmuparser/qmudef.cpp b/src/libs/qmuparser/qmudef.cpp index 2e8316546..608c85e60 100644 --- a/src/libs/qmuparser/qmudef.cpp +++ b/src/libs/qmuparser/qmudef.cpp @@ -317,14 +317,14 @@ QString NameRegExp() } } - negativeSigns.replace('-', "\\-"); + negativeSigns.replace('-', QLatin1String("\\-")); groupSeparators.remove('\''); //Same regexp in pattern.xsd shema file. Don't forget to synchronize. // \p{Nd} - \p{Decimal_Digit_Number} // \p{Zs} - \p{Space_Separator} - regex = QString("^([^\\p{Nd}\\p{Zs}*/&|!<>^\\()%1%2%3%4=?:;'\"]){1,1}" - "([^\\p{Zs}*/&|!<>^\\()%1%2%3%4=?:;\"]){0,}$") + regex = QString("^([^\\p{Nd}\\p{Zs}*/&|!<>^\n\\()%1%2%3%4=?:;'\"]){1,1}" + "([^\\p{Zs}*/&|!<>^\n\\()%1%2%3%4=?:;\"]){0,}$") .arg(negativeSigns, positiveSigns, decimalPoints, groupSeparators); } diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp index 9cc6bd792..4a710e7ea 100644 --- a/src/libs/vformat/vmeasurements.cpp +++ b/src/libs/vformat/vmeasurements.cpp @@ -264,7 +264,7 @@ void VMeasurements::ReadMeasurements(qreal height, qreal size) const { const QDomElement dom = list.at(i).toElement(); - const QString name = GetParametrString(dom, AttrName); + const QString name = GetParametrString(dom, AttrName).simplified(); const QString description = GetParametrEmptyString(dom, AttrDescription); const QString fullName = GetParametrEmptyString(dom, AttrFullName); diff --git a/src/libs/vpatterndb/variables/vinternalvariable.cpp b/src/libs/vpatterndb/variables/vinternalvariable.cpp index 1e205e78a..da5b2acf6 100644 --- a/src/libs/vpatterndb/variables/vinternalvariable.cpp +++ b/src/libs/vpatterndb/variables/vinternalvariable.cpp @@ -94,7 +94,7 @@ QString VInternalVariable::GetName() const //--------------------------------------------------------------------------------------------------------------------- void VInternalVariable::SetName(const QString &name) { - d->name = name; + d->name = name.simplified(); } //---------------------------------------------------------------------------------------------------------------------