| 2855 | } |
| 2856 | |
| 2857 | bool Worksheet::loadFromXmlFile(QIODevice *device) |
| 2858 | { |
| 2859 | Q_D(Worksheet); |
| 2860 | |
| 2861 | QXmlStreamReader reader(device); |
| 2862 | while (!reader.atEnd()) |
| 2863 | { |
| 2864 | reader.readNextStartElement(); |
| 2865 | if (reader.tokenType() == QXmlStreamReader::StartElement) |
| 2866 | { |
| 2867 | if (reader.name() == QLatin1String("dimension")) |
| 2868 | { |
| 2869 | QXmlStreamAttributes attributes = reader.attributes(); |
| 2870 | QString range = attributes.value(QLatin1String("ref")).toString(); |
| 2871 | d->dimension = CellRange(range); |
| 2872 | } |
| 2873 | else if (reader.name() == QLatin1String("sheetViews")) |
| 2874 | { |
| 2875 | d->loadXmlSheetViews(reader); |
| 2876 | } |
| 2877 | else if (reader.name() == QLatin1String("sheetFormatPr")) |
| 2878 | { |
| 2879 | d->loadXmlSheetFormatProps(reader); |
| 2880 | } |
| 2881 | else if (reader.name() == QLatin1String("cols")) |
| 2882 | { |
| 2883 | d->loadXmlColumnsInfo(reader); |
| 2884 | } |
| 2885 | else if (reader.name() == QLatin1String("sheetData")) |
| 2886 | { |
| 2887 | d->loadXmlSheetData(reader); |
| 2888 | } |
| 2889 | else if (reader.name() == QLatin1String("mergeCells")) |
| 2890 | { |
| 2891 | d->loadXmlMergeCells(reader); |
| 2892 | } |
| 2893 | else if (reader.name() == QLatin1String("dataValidations")) |
| 2894 | { |
| 2895 | d->loadXmlDataValidations(reader); |
| 2896 | } |
| 2897 | else if (reader.name() == QLatin1String("conditionalFormatting")) |
| 2898 | { |
| 2899 | ConditionalFormatting cf; |
| 2900 | cf.loadFromXml(reader, workbook()->styles()); |
| 2901 | d->conditionalFormattingList.append(cf); |
| 2902 | } |
| 2903 | else if (reader.name() == QLatin1String("hyperlinks")) |
| 2904 | { |
| 2905 | d->loadXmlHyperlinks(reader); |
| 2906 | } |
| 2907 | else if(reader.name() == QLatin1String("pageSetup")) |
| 2908 | { |
| 2909 | QXmlStreamAttributes attributes = reader.attributes(); |
| 2910 | |
| 2911 | d->PpaperSize = attributes.value(QLatin1String("paperSize")).toString().trimmed(); |
| 2912 | d->Pscale = attributes.value(QLatin1String("scale")).toString().trimmed(); |
| 2913 | d->PfirstPageNumber = attributes.value(QLatin1String("firstPageNumber")).toString().trimmed(); |
| 2914 | d->Porientation = attributes.value(QLatin1String("orientation")).toString().trimmed(); |
nothing calls this directly
no test coverage detected