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

Method writeRichStringPart_rPr

src/3rdparty/QXlsx/source/xlsxsharedstrings.cpp:129–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void 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)) {

Callers

nothing calls this directly

Calls 15

hasFontDataMethod · 0.80
fontBoldMethod · 0.80
fontItalicMethod · 0.80
fontStrikeOutMethod · 0.80
fontOutlineMethod · 0.80
boolPropertyMethod · 0.80
hasPropertyMethod · 0.80
fontUnderlineMethod · 0.80
fontScriptMethod · 0.80
fontSizeMethod · 0.80
fontNameMethod · 0.80
intPropertyMethod · 0.80

Tested by

no test coverage detected