Remove attribute "typeObject" since 0.4.0.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-11-25 13:19:38 +02:00
parent 39b27e4b24
commit 6c04b2e7ca
3 changed files with 33 additions and 3 deletions

View file

@ -280,7 +280,6 @@
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="typeObject" type="xs:string"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="idTool" type="xs:unsignedInt"></xs:attribute>
@ -291,7 +290,6 @@
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="typeObject" type="xs:string"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="idTool" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="inUse" type="xs:boolean"></xs:attribute>
@ -301,7 +299,6 @@
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="typeObject" type="xs:string"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="idTool" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="inUse" type="xs:boolean"></xs:attribute>

View file

@ -130,6 +130,7 @@ const QString strMy = QStringLiteral("my");
const QString strForbidFlipping = QStringLiteral("forbidFlipping");
const QString strInLayout = QStringLiteral("inLayout");
const QString strSeamAllowance = QStringLiteral("seamAllowance");
const QString strTypeObject = QStringLiteral("typeObject");
//---------------------------------------------------------------------------------------------------------------------
VPatternConverter::VPatternConverter(const QString &fileName)
@ -575,6 +576,7 @@ void VPatternConverter::ToV0_4_0()
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.0"));
TagRemoveAttributeTypeObjectInV0_4_0();
TagDetailToV0_4_0();
Save();
}
@ -1681,6 +1683,36 @@ void VPatternConverter::FixSubPaths(int i, quint32 id, quint32 baseCurve)
}
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::TagRemoveAttributeTypeObjectInV0_4_0()
{
// TODO. Delete if minimal supported version is 0.4.0
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < CONVERTER_VERSION_CHECK(0, 4, 0),
"Time to refactor the code.");
const QDomNodeList list = elementsByTagName(strModeling);
for (int i = 0; i < list.size(); ++i)
{
QDomElement modeling = list.at(i).toElement();
if (not modeling.isNull())
{
QDomNode domNode = modeling.firstChild();
while (not domNode.isNull())
{
QDomElement domElement = domNode.toElement();
if (not domElement.isNull())
{
if (domElement.hasAttribute(strTypeObject))
{
domElement.removeAttribute(strTypeObject);
}
}
domNode = domNode.nextSibling();
}
}
}
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::TagDetailToV0_4_0()
{

View file

@ -134,6 +134,7 @@ private:
void FixCutPoint();
void FixSubPaths(int i, quint32 id, quint32 baseCurve);
void TagRemoveAttributeTypeObjectInV0_4_0();
void TagDetailToV0_4_0();
};