Can read .xlsx files with font styles now

This commit is contained in:
Debao Zhang
2013-10-21 17:23:10 +08:00
parent 74839a73b9
commit b56d86aab4
5 changed files with 230 additions and 25 deletions
+5 -1
View File
@@ -147,7 +147,11 @@ bool Package::parsePackage(QIODevice *packageDevice)
QList<XlsxRelationship> rels_styles = xlworkbook_Rels.documentRelationships(QStringLiteral("/styles"));
if (!rels_styles.isEmpty()) {
//In normal case this should be styles.xml which in xl
//:Todo
QString name = rels_styles[0].target;
QString path = xlworkbook_Dir + QLatin1String("/") + name;
QSharedPointer<Styles> styles (new Styles(true));
styles->loadFromXmlData(zipReader.fileData(path));
m_document->workbook()->d_ptr->styles = styles;
}
//load sharedStrings