diff --git a/src/app/puzzle/xml/vplayoutfilereader.cpp b/src/app/puzzle/xml/vplayoutfilereader.cpp index 55a2c2b4d..d2456dba6 100644 --- a/src/app/puzzle/xml/vplayoutfilereader.cpp +++ b/src/app/puzzle/xml/vplayoutfilereader.cpp @@ -672,16 +672,54 @@ void VPLayoutFileReader::ReadLabels(const VPPiecePtr &piece) { if (name() == ML::TagPieceLabel) { - QXmlStreamAttributes attribs = attributes(); - piece->SetPieceLabelRect(StringToPath(ReadAttributeEmptyString(attribs, ML::AttrShape))); - - piece->SetPieceLabelData(ReadLabelLines()); + ReadPieceLabel(piece); } else if (name() == ML::TagPatternLabel) { - QXmlStreamAttributes attribs = attributes(); - piece->SetPatternLabelRect(StringToPath(ReadAttributeEmptyString(attribs, ML::AttrShape))); + ReadPatternLabel(piece); + } + else + { + qCDebug(MLReader, "Ignoring tag %s", qUtf8Printable(name().toString())); + skipCurrentElement(); + } + } +} +//--------------------------------------------------------------------------------------------------------------------- +void VPLayoutFileReader::ReadPieceLabel(const VPPiecePtr &piece) +{ + AssertRootTag(ML::TagPieceLabel); + + QXmlStreamAttributes attribs = attributes(); + piece->SetPieceLabelRect(StringToPath(ReadAttributeEmptyString(attribs, ML::AttrShape))); + + while (readNextStartElement()) + { + if (name() == ML::TagLines) + { + piece->SetPieceLabelData(ReadLabelLines()); + } + else + { + qCDebug(MLReader, "Ignoring tag %s", qUtf8Printable(name().toString())); + skipCurrentElement(); + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPLayoutFileReader::ReadPatternLabel(const VPPiecePtr &piece) +{ + AssertRootTag(ML::TagPatternLabel); + + QXmlStreamAttributes attribs = attributes(); + piece->SetPatternLabelRect(StringToPath(ReadAttributeEmptyString(attribs, ML::AttrShape))); + + while (readNextStartElement()) + { + if (name() == ML::TagLines) + { piece->SetPatternLabelData(ReadLabelLines()); } else @@ -695,7 +733,7 @@ void VPLayoutFileReader::ReadLabels(const VPPiecePtr &piece) //--------------------------------------------------------------------------------------------------------------------- auto VPLayoutFileReader::ReadLabelLines() -> VTextManager { - AssertRootTag(ML::TagLabels); + AssertRootTag(ML::TagLines); VTextManager text; QVector lines; diff --git a/src/app/puzzle/xml/vplayoutfilereader.h b/src/app/puzzle/xml/vplayoutfilereader.h index 707a055c5..46ded12a1 100644 --- a/src/app/puzzle/xml/vplayoutfilereader.h +++ b/src/app/puzzle/xml/vplayoutfilereader.h @@ -70,6 +70,8 @@ private: void ReadMarkers(const VPPiecePtr &piece); auto ReadMarker() -> VLayoutPlaceLabel; void ReadLabels(const VPPiecePtr &piece); + void ReadPieceLabel(const VPPiecePtr &piece); + void ReadPatternLabel(const VPPiecePtr &piece); auto ReadLabelLines() -> VTextManager; auto ReadLabelLine() -> TextLine; diff --git a/src/libs/ifc/schema/layout/v0.1.0.xsd b/src/libs/ifc/schema/layout/v0.1.0.xsd index f907fc57a..c226ae332 100644 --- a/src/libs/ifc/schema/layout/v0.1.0.xsd +++ b/src/libs/ifc/schema/layout/v0.1.0.xsd @@ -127,14 +127,19 @@ - - - - - + + + + + + + + + + @@ -148,14 +153,19 @@ - - - - - + + + + + + + + + + @@ -284,14 +294,19 @@ - - - - - + + + + + + + + + + @@ -305,14 +320,19 @@ - - - - - + + + + + + + + + +