| 127 | } |
| 128 | |
| 129 | void SharedStrings::writeRichStringPart_rPr(QXmlStreamWriter &writer, const Format &format) const |
| 130 | { |
| 131 | if (!format.hasFontData()) |
| 132 | return; |
| 133 | |
| 134 | if (format.fontBold()) |
| 135 | writer.writeEmptyElement(QStringLiteral("b")); |
| 136 | if (format.fontItalic()) |
| 137 | writer.writeEmptyElement(QStringLiteral("i")); |
| 138 | if (format.fontStrikeOut()) |
| 139 | writer.writeEmptyElement(QStringLiteral("strike")); |
| 140 | if (format.fontOutline()) |
| 141 | writer.writeEmptyElement(QStringLiteral("outline")); |
| 142 | if (format.boolProperty(FormatPrivate::P_Font_Shadow)) |
| 143 | writer.writeEmptyElement(QStringLiteral("shadow")); |
| 144 | if (format.hasProperty(FormatPrivate::P_Font_Underline)) { |
| 145 | Format::FontUnderline u = format.fontUnderline(); |
| 146 | if (u != Format::FontUnderlineNone) { |
| 147 | writer.writeEmptyElement(QStringLiteral("u")); |
| 148 | if (u== Format::FontUnderlineDouble) |
| 149 | writer.writeAttribute(QStringLiteral("val"), QStringLiteral("double")); |
| 150 | else if (u == Format::FontUnderlineSingleAccounting) |
| 151 | writer.writeAttribute(QStringLiteral("val"), QStringLiteral("singleAccounting")); |
| 152 | else if (u == Format::FontUnderlineDoubleAccounting) |
| 153 | writer.writeAttribute(QStringLiteral("val"), QStringLiteral("doubleAccounting")); |
| 154 | } |
| 155 | } |
| 156 | if (format.hasProperty(FormatPrivate::P_Font_Script)) { |
| 157 | Format::FontScript s = format.fontScript(); |
| 158 | if (s != Format::FontScriptNormal) { |
| 159 | writer.writeEmptyElement(QStringLiteral("vertAlign")); |
| 160 | if (s == Format::FontScriptSuper) |
| 161 | writer.writeAttribute(QStringLiteral("val"), QStringLiteral("superscript")); |
| 162 | else |
| 163 | writer.writeAttribute(QStringLiteral("val"), QStringLiteral("subscript")); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | if (format.hasProperty(FormatPrivate::P_Font_Size)) { |
| 168 | writer.writeEmptyElement(QStringLiteral("sz")); |
| 169 | writer.writeAttribute(QStringLiteral("val"), QString::number(format.fontSize())); |
| 170 | } |
| 171 | |
| 172 | if (format.hasProperty(FormatPrivate::P_Font_Color)) { |
| 173 | XlsxColor color = format.property(FormatPrivate::P_Font_Color).value<XlsxColor>(); |
| 174 | color.saveToXml(writer); |
| 175 | } |
| 176 | |
| 177 | if (!format.fontName().isEmpty()) { |
| 178 | writer.writeEmptyElement(QStringLiteral("rFont")); |
| 179 | writer.writeAttribute(QStringLiteral("val"), format.fontName()); |
| 180 | } |
| 181 | if (format.hasProperty(FormatPrivate::P_Font_Family)) { |
| 182 | writer.writeEmptyElement(QStringLiteral("family")); |
| 183 | writer.writeAttribute(QStringLiteral("val"), QString::number(format.intProperty(FormatPrivate::P_Font_Family))); |
| 184 | } |
| 185 | |
| 186 | if (format.hasProperty(FormatPrivate::P_Font_Scheme)) { |
nothing calls this directly
no test coverage detected