Fix reading piece labels.
This commit is contained in:
parent
d21546e397
commit
88508b102e
|
@ -672,16 +672,54 @@ void VPLayoutFileReader::ReadLabels(const VPPiecePtr &piece)
|
||||||
{
|
{
|
||||||
if (name() == ML::TagPieceLabel)
|
if (name() == ML::TagPieceLabel)
|
||||||
{
|
{
|
||||||
QXmlStreamAttributes attribs = attributes();
|
ReadPieceLabel(piece);
|
||||||
piece->SetPieceLabelRect(StringToPath(ReadAttributeEmptyString(attribs, ML::AttrShape)));
|
|
||||||
|
|
||||||
piece->SetPieceLabelData(ReadLabelLines());
|
|
||||||
}
|
}
|
||||||
else if (name() == ML::TagPatternLabel)
|
else if (name() == ML::TagPatternLabel)
|
||||||
{
|
{
|
||||||
QXmlStreamAttributes attribs = attributes();
|
ReadPatternLabel(piece);
|
||||||
piece->SetPatternLabelRect(StringToPath(ReadAttributeEmptyString(attribs, ML::AttrShape)));
|
}
|
||||||
|
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());
|
piece->SetPatternLabelData(ReadLabelLines());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -695,7 +733,7 @@ void VPLayoutFileReader::ReadLabels(const VPPiecePtr &piece)
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VPLayoutFileReader::ReadLabelLines() -> VTextManager
|
auto VPLayoutFileReader::ReadLabelLines() -> VTextManager
|
||||||
{
|
{
|
||||||
AssertRootTag(ML::TagLabels);
|
AssertRootTag(ML::TagLines);
|
||||||
|
|
||||||
VTextManager text;
|
VTextManager text;
|
||||||
QVector<TextLine> lines;
|
QVector<TextLine> lines;
|
||||||
|
|
|
@ -70,6 +70,8 @@ private:
|
||||||
void ReadMarkers(const VPPiecePtr &piece);
|
void ReadMarkers(const VPPiecePtr &piece);
|
||||||
auto ReadMarker() -> VLayoutPlaceLabel;
|
auto ReadMarker() -> VLayoutPlaceLabel;
|
||||||
void ReadLabels(const VPPiecePtr &piece);
|
void ReadLabels(const VPPiecePtr &piece);
|
||||||
|
void ReadPieceLabel(const VPPiecePtr &piece);
|
||||||
|
void ReadPatternLabel(const VPPiecePtr &piece);
|
||||||
auto ReadLabelLines() -> VTextManager;
|
auto ReadLabelLines() -> VTextManager;
|
||||||
auto ReadLabelLine() -> TextLine;
|
auto ReadLabelLine() -> TextLine;
|
||||||
|
|
||||||
|
|
|
@ -127,14 +127,19 @@
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
|
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:string" name="font" use="required"/>
|
<xs:simpleContent>
|
||||||
<xs:attribute type="xs:boolean" name="bold" use="optional"/>
|
<xs:extension base="xs:string">
|
||||||
<xs:attribute type="xs:boolean" name="italic" use="optional"/>
|
<xs:attribute type="xs:boolean" name="bold" use="optional"/>
|
||||||
<xs:attribute type="xs:unsignedInt" name="alignment" use="optional"/>
|
<xs:attribute type="xs:boolean" name="italic" use="optional"/>
|
||||||
|
<xs:attribute type="xs:unsignedInt" name="alignment" use="optional"/>
|
||||||
|
<xs:attribute type="xs:unsignedInt" name="fontSize" use="optional"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:string" name="font"/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
@ -148,14 +153,19 @@
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
|
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:string" name="font" use="required"/>
|
<xs:simpleContent>
|
||||||
<xs:attribute type="xs:boolean" name="bold" use="optional"/>
|
<xs:extension base="xs:string">
|
||||||
<xs:attribute type="xs:boolean" name="italic" use="optional"/>
|
<xs:attribute type="xs:boolean" name="bold" use="optional"/>
|
||||||
<xs:attribute type="xs:unsignedInt" name="alignment" use="optional"/>
|
<xs:attribute type="xs:boolean" name="italic" use="optional"/>
|
||||||
|
<xs:attribute type="xs:unsignedInt" name="alignment" use="optional"/>
|
||||||
|
<xs:attribute type="xs:unsignedInt" name="fontSize" use="optional"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:string" name="font"/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
@ -284,14 +294,19 @@
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
|
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:string" name="font" use="required"/>
|
<xs:simpleContent>
|
||||||
<xs:attribute type="xs:boolean" name="bold" use="optional"/>
|
<xs:extension base="xs:string">
|
||||||
<xs:attribute type="xs:boolean" name="italic" use="optional"/>
|
<xs:attribute type="xs:boolean" name="bold" use="optional"/>
|
||||||
<xs:attribute type="AlignmentType" name="alignment" use="optional"/>
|
<xs:attribute type="xs:boolean" name="italic" use="optional"/>
|
||||||
|
<xs:attribute type="AlignmentType" name="alignment" use="optional"/>
|
||||||
|
<xs:attribute type="xs:unsignedInt" name="fontSize" use="optional"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:string" name="font"/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
@ -305,14 +320,19 @@
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
|
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:string" name="font" use="required"/>
|
<xs:simpleContent>
|
||||||
<xs:attribute type="xs:boolean" name="bold" use="optional"/>
|
<xs:extension base="xs:string">
|
||||||
<xs:attribute type="xs:boolean" name="italic" use="optional"/>
|
<xs:attribute type="xs:boolean" name="bold" use="optional"/>
|
||||||
<xs:attribute type="AlignmentType" name="alignment" use="optional"/>
|
<xs:attribute type="xs:boolean" name="italic" use="optional"/>
|
||||||
|
<xs:attribute type="AlignmentType" name="alignment" use="optional"/>
|
||||||
|
<xs:attribute type="xs:unsignedInt" name="fontSize" use="optional"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:string" name="font"/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user