Skip to content

Commit

Permalink
set check point of EG_Anchor and sub-objects
Browse files Browse the repository at this point in the history
  • Loading branch information
j2doll committed Nov 1, 2019
1 parent 78001b3 commit 1ba38b3
Show file tree
Hide file tree
Showing 2 changed files with 293 additions and 92 deletions.
29 changes: 24 additions & 5 deletions QXlsx/source/xlsxdrawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,38 @@ void Drawing::saveToXmlFile(QIODevice *device) const
writer.writeEndDocument();
}

// check point
bool Drawing::loadFromXmlFile(QIODevice *device)
{
/*
<xsd:group name="EG_Anchor">
<xsd:choice>
<xsd:element name="twoCellAnchor" type="CT_TwoCellAnchor"/>
<xsd:element name="oneCellAnchor" type="CT_OneCellAnchor"/>
<xsd:element name="absoluteAnchor" type="CT_AbsoluteAnchor"/>
</xsd:choice>
</xsd:group>
*/

QXmlStreamReader reader(device);
while (!reader.atEnd()) {

while (!reader.atEnd())
{
reader.readNextStartElement();
if (reader.tokenType() == QXmlStreamReader::StartElement) {
if (reader.name() == QLatin1String("absoluteAnchor")) {
if (reader.tokenType() == QXmlStreamReader::StartElement)
{
if (reader.name() == QLatin1String("absoluteAnchor")) // CT_AbsoluteAnchor
{
DrawingAbsoluteAnchor * anchor = new DrawingAbsoluteAnchor(this);
anchor->loadFromXml(reader);
} else if (reader.name() == QLatin1String("oneCellAnchor")) {
}
else if (reader.name() == QLatin1String("oneCellAnchor")) // CT_OneCellAnchor
{
DrawingOneCellAnchor * anchor = new DrawingOneCellAnchor(this);
anchor->loadFromXml(reader);
} else if (reader.name() == QLatin1String("twoCellAnchor")) {
}
else if (reader.name() == QLatin1String("twoCellAnchor")) // CT_TwoCellAnchor
{
DrawingTwoCellAnchor * anchor = new DrawingTwoCellAnchor(this);
anchor->loadFromXml(reader);
}
Expand Down
Loading

0 comments on commit 1ba38b3

Please sign in to comment.