mirror of
https://github.com/QtExcel/QXlsx.git
synced 2025-01-30 05:02:52 +08:00
fix: workbook.xml.rels with absolute path
https://github.com/QtExcel/QXlsx/issues/310
This commit is contained in:
parent
db36c652ed
commit
3192b808a2
@ -607,6 +607,11 @@ bool Workbook::loadFromXmlFile(QIODevice *device)
|
||||
|
||||
AbstractSheet *sheet = addSheet(name, sheetId, type);
|
||||
sheet->setSheetState(state);
|
||||
if (relationship.target.startsWith("/")) {
|
||||
QString fullPath = QDir::cleanPath(relationship.target.mid(1));
|
||||
|
||||
sheet->setFilePath(fullPath);
|
||||
}else{
|
||||
QString strFilePath = filePath();
|
||||
|
||||
// const QString fullPath = QDir::cleanPath(splitPath(strFilePath).constFirst() +
|
||||
@ -616,6 +621,7 @@ bool Workbook::loadFromXmlFile(QIODevice *device)
|
||||
QDir::cleanPath(parts.first() + QLatin1String("/") + relationship.target);
|
||||
|
||||
sheet->setFilePath(fullPath);
|
||||
}
|
||||
} else if (reader.name() == QLatin1String("workbookPr")) {
|
||||
QXmlStreamAttributes attrs = reader.attributes();
|
||||
if (attrs.hasAttribute(QLatin1String("date1904")))
|
||||
|
Loading…
x
Reference in New Issue
Block a user