MCPcopy Create free account
hub / github.com/KDE/labplot / loadXmlSheetFormatProps

Method loadXmlSheetFormatProps

src/3rdparty/QXlsx/source/xlsxworksheet.cpp:2703–2766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2701}
2702
2703void WorksheetPrivate::loadXmlSheetFormatProps(QXmlStreamReader &reader)
2704{
2705 Q_ASSERT(reader.name() == QLatin1String("sheetFormatPr"));
2706
2707 const QXmlStreamAttributes attributes = reader.attributes();
2708 XlsxSheetFormatProps formatProps;
2709 bool isSetWidth = false;
2710
2711 // Retain default values
2712 for (const QXmlStreamAttribute &attrib : attributes)
2713 {
2714 if(attrib.name() == QLatin1String("baseColWidth") )
2715 {
2716 formatProps.baseColWidth = attrib.value().toInt();
2717 }
2718 else if(attrib.name() == QLatin1String("customHeight"))
2719 {
2720 formatProps.customHeight = attrib.value() == QLatin1String("1");
2721 }
2722 else if(attrib.name() == QLatin1String("defaultColWidth"))
2723 {
2724 double dDefaultColWidth = attrib.value().toDouble();
2725 formatProps.defaultColWidth = dDefaultColWidth;
2726 isSetWidth = true;
2727 }
2728 else if(attrib.name() == QLatin1String("defaultRowHeight"))
2729 {
2730 formatProps.defaultRowHeight = attrib.value().toDouble();
2731 }
2732 else if(attrib.name() == QLatin1String("outlineLevelCol"))
2733 {
2734 formatProps.outlineLevelCol = attrib.value().toInt();
2735 }
2736 else if(attrib.name() == QLatin1String("outlineLevelRow"))
2737 {
2738 formatProps.outlineLevelRow = attrib.value().toInt();
2739 }
2740 else if(attrib.name() == QLatin1String("thickBottom"))
2741 {
2742 formatProps.thickBottom = attrib.value() == QLatin1String("1");
2743 }
2744 else if(attrib.name() == QLatin1String("thickTop"))
2745 {
2746 formatProps.thickTop = attrib.value() == QLatin1String("1");
2747 }
2748 else if(attrib.name() == QLatin1String("zeroHeight"))
2749 {
2750 formatProps.zeroHeight = attrib.value() == QLatin1String("1");
2751 }
2752 }
2753
2754 // if (formatProps.defaultColWidth == 0.0)
2755 if ( !isSetWidth )
2756 {
2757 //not set
2758 double dCalcWidth = WorksheetPrivate::calculateColWidth(formatProps.baseColWidth);
2759 formatProps.defaultColWidth = dCalcWidth;
2760 }

Callers 1

loadFromXmlFileMethod · 0.80

Calls 2

nameMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected