1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-30 05:02:52 +08:00

Merge pull request #254 from xuyouqiao2005/master

fix that sometimes can not read sheet info
- merged to alpha branch
This commit is contained in:
Jay Two 2023-01-04 18:18:13 +09:00 committed by GitHub
commit 4be4d1d505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -278,7 +278,14 @@ bool DocumentPrivate::loadPackage(QIODevice *device)
//If the .rel file exists, load it.
if (zipReader.filePaths().contains(rel_path))
sheet->relationships()->loadFromXmlData(zipReader.fileData(rel_path));
sheet->loadFromXmlData(zipReader.fileData(sheet->filePath()));
if (strFilePath.startsWith(QStringLiteral("xl/xl/")) &&
!zipReader.filePaths().contains(strFilePath) &&
zipReader.filePaths().contains(strFilePath.mid(3))) {
sheet->loadFromXmlData(zipReader.fileData(strFilePath.mid(3)));
} else {
sheet->loadFromXmlData(zipReader.fileData(strFilePath));
}
}
//load external links