Browse Source

Don't generate externalReferences tags if non externalLinks exists

master
Debao Zhang 11 years ago
parent
commit
ca0df02acb
  1. 14
      src/xlsx/xlsxworkbook.cpp

14
src/xlsx/xlsxworkbook.cpp

@ -437,13 +437,15 @@ void Workbook::saveToXmlFile(QIODevice *device) const
} }
writer.writeEndElement();//sheets writer.writeEndElement();//sheets
writer.writeStartElement(QStringLiteral("externalReferences")); if (d->externalLinks.size() > 0) {
for (int i=0; i<d->externalLinks.size(); ++i) { writer.writeStartElement(QStringLiteral("externalReferences"));
writer.writeEmptyElement(QStringLiteral("externalReference")); for (int i=0; i<d->externalLinks.size(); ++i) {
d->relationships->addDocumentRelationship(QStringLiteral("/externalLink"), QStringLiteral("externalLinks/externalLink%1.xml").arg(i+1)); writer.writeEmptyElement(QStringLiteral("externalReference"));
writer.writeAttribute(QStringLiteral("r:id"), QStringLiteral("rId%1").arg(d->relationships->count())); d->relationships->addDocumentRelationship(QStringLiteral("/externalLink"), QStringLiteral("externalLinks/externalLink%1.xml").arg(i+1));
writer.writeAttribute(QStringLiteral("r:id"), QStringLiteral("rId%1").arg(d->relationships->count()));
}
writer.writeEndElement();//externalReferences
} }
writer.writeEndElement();//externalReferences
if (!d->definedNamesList.isEmpty()) { if (!d->definedNamesList.isEmpty()) {
writer.writeStartElement(QStringLiteral("definedNames")); writer.writeStartElement(QStringLiteral("definedNames"));

Loading…
Cancel
Save