Warning, file /office/calligra/filters/libmsooxml/MsooXmlDrawingMLSharedImpl.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * This file is part of Office 2007 Filters for Calligra 0003 * 0004 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 0005 * Contact: Suresh Chande suresh.chande@nokia.com 0006 * 0007 * Copyright (C) 2012 Matus Uzak (matus.uzak@gmail.com). 0008 * 0009 * This library is free software; you can redistribute it and/or 0010 * modify it under the terms of the GNU Lesser General Public License 0011 * version 2.1 as published by the Free Software Foundation. 0012 * 0013 * This library is distributed in the hope that it will be useful, but 0014 * WITHOUT ANY WARRANTY; without even the implied warranty of 0015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0016 * Lesser General Public License for more details. 0017 * 0018 * You should have received a copy of the GNU Lesser General Public 0019 * License along with this library; if not, write to the Free Software 0020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 0021 * 02110-1301 USA 0022 * 0023 */ 0024 0025 #ifndef MSOOXML_DRAWINGML_SHARED_IMPL_H 0026 #define MSOOXML_DRAWINGML_SHARED_IMPL_H 0027 0028 #undef CURRENT_EL 0029 #define CURRENT_EL extLst 0030 //! extLst (Extension List) 0031 //! DrawingML ECMA-376 20.1.2.2.15, p.3034 0032 /*! 0033 This element specifies the extension list within which all future 0034 extensions of element type ext is defined. The extension list along 0035 with corresponding future extensions is used to extend the storage 0036 capabilities of the DrawingML framework. This allows for various new 0037 types of data to be stored natively within the framework. 0038 */ 0039 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_extLst() 0040 { 0041 READ_PROLOGUE 0042 // NO support atm, skipping 0043 skipCurrentElement(); 0044 0045 READ_EPILOGUE 0046 } 0047 0048 #undef CURRENT_EL 0049 #define CURRENT_EL lnL 0050 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_Table_lnL() 0051 { 0052 READ_PROLOGUE2(Table_lnL) 0053 0054 return read_Table_generic("lnL"); 0055 0056 READ_EPILOGUE 0057 } 0058 0059 #undef CURRENT_EL 0060 #define CURRENT_EL lnR 0061 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_Table_lnR() 0062 { 0063 READ_PROLOGUE2(Table_lnR) 0064 0065 return read_Table_generic("lnR"); 0066 0067 READ_EPILOGUE 0068 } 0069 0070 #undef CURRENT_EL 0071 #define CURRENT_EL lnT 0072 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_Table_lnT() 0073 { 0074 READ_PROLOGUE2(Table_lnT) 0075 0076 return read_Table_generic("lnT"); 0077 0078 READ_EPILOGUE 0079 } 0080 0081 #undef CURRENT_EL 0082 #define CURRENT_EL lnB 0083 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_Table_lnB() 0084 { 0085 READ_PROLOGUE2(Table_lnB) 0086 0087 return read_Table_generic("lnB"); 0088 0089 READ_EPILOGUE 0090 } 0091 0092 #undef CURRENT_EL 0093 #define CURRENT_EL ln 0094 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_Table_ln() 0095 { 0096 READ_PROLOGUE2(Table_ln) 0097 0098 return read_Table_generic("ln"); 0099 0100 READ_EPILOGUE 0101 } 0102 0103 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_Table_generic(const QString& endElement) 0104 { 0105 QXmlStreamAttributes attrs = attributes(); 0106 0107 m_currentBorder = KoBorder::BorderData(); 0108 0109 //compound line type 0110 TRY_READ_ATTR_WITHOUT_NS(cmpd) 0111 //double lines 0112 if( cmpd.isEmpty() || cmpd == "sng" ) { 0113 m_currentBorder.style = KoBorder::BorderSolid; 0114 } 0115 //single line 0116 else if (cmpd == "dbl") { 0117 m_currentBorder.style = KoBorder::BorderDouble; 0118 } 0119 //thick thin double lines 0120 else if (cmpd == "thickThin") { 0121 //FIXME it seem we don't support this properly. Use solid for now. 0122 m_currentBorder.style = KoBorder::BorderDouble; 0123 } 0124 //thin thick double lines 0125 else if (cmpd == "thinThick") { 0126 //FIXME it doesn't seem we support this properly. 0127 m_currentBorder.style = KoBorder::BorderDouble; 0128 } 0129 //thin thick thin triple lines 0130 else if (cmpd == "tri") { 0131 //NOTE: There is not triple in ODF 0132 m_currentBorder.style = KoBorder::BorderSolid; 0133 } 0134 0135 TRY_READ_ATTR_WITHOUT_NS(w) //width 0136 m_currentBorder.outerPen.setWidthF(EMU_TO_POINT(w.toDouble())); 0137 0138 while (!atEnd()) { 0139 readNext(); 0140 if (isEndElement() && name() == endElement) { 0141 break; 0142 } 0143 if(isStartElement()) { 0144 if(QUALIFIED_NAME_IS(solidFill)) { 0145 TRY_READ(solidFill); 0146 m_currentBorder.style = KoBorder::BorderSolid; 0147 m_currentBorder.innerPen.setColor(m_currentColor); 0148 m_currentBorder.outerPen.setColor(m_currentColor); 0149 } 0150 else if (QUALIFIED_NAME_IS(prstDash)) { 0151 attrs = attributes(); 0152 //TODO find out how other colors are handled 0153 m_currentBorder.innerPen.setColor(Qt::black); 0154 m_currentBorder.outerPen.setColor(Qt::black); 0155 TRY_READ_ATTR_WITHOUT_NS(val) 0156 //TODO support other dash types. Make it its own function. 0157 if (val == "dash") { 0158 m_currentBorder.style = KoBorder::BorderDashed; 0159 } 0160 else if(val == "dashDot") { 0161 m_currentBorder.style = KoBorder::BorderDashDot; 0162 } 0163 else if(val == "dot") { 0164 m_currentBorder.style = KoBorder::BorderDotted; 0165 } 0166 } 0167 SKIP_UNKNOWN 0168 // ELSE_WRONG_FORMAT 0169 } 0170 } 0171 return KoFilter::OK; 0172 } 0173 0174 #undef CURRENT_EL 0175 #define CURRENT_EL ln 0176 //! ln (Outline) 0177 //! DrawingML ECMA-376, 20.1.2.2.24, p. 3048. 0178 /*! 0179 This element specifies an outline style that can be applied to a 0180 number of different objects such as shapes and text. The line allows 0181 for the specifying of many different types of outlines including 0182 even line dashes and bevels. 0183 0184 Parent Elements: 0185 0186 Child Elements: 0187 - [done] bevel (Line Join Bevel) §20.1.8.9 0188 - custDash (Custom Dash) §20.1.8.21 0189 - extLst (Extension List) §20.1.2.2.15 0190 - gradFill (Gradient Fill) §20.1.8.33 0191 - [done] headEnd (Line Head/End Style) §20.1.8.38 0192 - [done] miter (Miter Line Join) §20.1.8.43 0193 - [done] noFill (No Fill) §20.1.8.44 0194 - pattFill (Pattern Fill) §20.1.8.47 0195 - [done] prstDash (Preset Dash) §20.1.8.48 0196 - [done] round (Round Line Join) §20.1.8.52 0197 - [done] solidFill (Solid Fill) §20.1.8.54 0198 - [done] tailEnd (Tail line end style) §20.1.8.57 0199 0200 Attributes: 0201 - algn (Stroke Alignment) 0202 - [done] cap (Line Ending Cap Style) 0203 - cmpd (Compound Line Type) 0204 - [done] w (Line Width) 0205 */ 0206 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_ln() 0207 { 0208 READ_PROLOGUE 0209 QXmlStreamAttributes attrs(attributes()); 0210 0211 //TODO: align 0212 TRY_READ_ATTR_WITHOUT_NS(algn) 0213 //center 0214 if (algn.isEmpty() || algn == "ctr") { 0215 } 0216 //inset 0217 else if (algn == "in") { 0218 } 0219 0220 //line ending cap 0221 TRY_READ_ATTR_WITHOUT_NS(cap) 0222 if (cap.isEmpty() || cap == "sq") { 0223 m_currentDrawStyle->addProperty("svg:stroke-linecap", "square"); 0224 } 0225 else if (cap == "rnd") { 0226 m_currentDrawStyle->addProperty("svg:stroke-linecap", "round"); 0227 } 0228 else if (cap == "flat") { 0229 m_currentDrawStyle->addProperty("svg:stroke-linecap", "butt"); 0230 } 0231 0232 //TODO: compound line type 0233 TRY_READ_ATTR_WITHOUT_NS(cmpd) 0234 0235 //single line 0236 if( cmpd.isEmpty() || cmpd == "sng" ) { 0237 } 0238 //double lines 0239 else if (cmpd == "dbl") { 0240 } 0241 //thick thin double lines 0242 else if (cmpd == "thickThin") { 0243 } 0244 //thin thick double lines 0245 else if (cmpd == "thinThick") { 0246 } 0247 //thin thick thin triple lines 0248 else if (cmpd == "tri") { 0249 } 0250 0251 TRY_READ_ATTR_WITHOUT_NS(w) 0252 0253 if (!w.isEmpty()) { 0254 m_currentLineWidth = EMU_TO_POINT(w.toDouble()); 0255 m_currentDrawStyle->addPropertyPt("svg:stroke-width", m_currentLineWidth); 0256 m_currentDrawStyle->addProperty("draw:stroke", "solid"); 0257 } 0258 0259 while (!atEnd()) { 0260 readNext(); 0261 BREAK_IF_END_OF(CURRENT_EL) 0262 if ( isStartElement() ) { 0263 0264 // line head/tail end 0265 TRY_READ_IF(headEnd) 0266 ELSE_TRY_READ_IF(tailEnd) 0267 0268 // linejoin 0269 else if (qualifiedName() == QLatin1String("a:bevel")) { 0270 m_currentDrawStyle->addProperty("draw:stroke-linejoin", "bevel"); 0271 } 0272 else if (qualifiedName() == QLatin1String("a:miter")) { 0273 m_currentDrawStyle->addProperty("draw:stroke-linejoin", "miter"); 0274 } 0275 else if (qualifiedName() == QLatin1String("a:round")) { 0276 m_currentDrawStyle->addProperty("draw:stroke-linejoin", "round"); 0277 } 0278 0279 // //custom dash 0280 // else if(qualifiedName() == QLatin1String("a:custDash")) { 0281 // } 0282 // //extension list 0283 // else if(qualifiedName() == QLatin1String("a:extLst")) { 0284 // } 0285 // //gradient fill 0286 // else if(qualifiedName() == QLatin1String("a:gradFill")) { 0287 // } 0288 0289 // //pattern fill 0290 // else if(qualifiedName() == QLatin1String("a:pattFill")) { 0291 // } 0292 0293 //solid fill 0294 else if (qualifiedName() == QLatin1String("a:solidFill")) { 0295 TRY_READ(solidFill) 0296 m_currentDrawStyle->addProperty("svg:stroke-color", m_currentColor.name()); 0297 0298 // Opacity is disabled because there's a bug somewhere 0299 // which makes even 1% opacity hide lines. 0300 0301 // if (m_currentAlpha > 0) { 0302 // m_currentDrawStyle->addProperty("svg:stroke-opacity", 0303 // QString("%1%").arg(m_currentAlpha/100.0)); 0304 // } 0305 } 0306 else if (qualifiedName() == QLatin1String("a:noFill")) { 0307 m_currentDrawStyle->addProperty("draw:stroke", "none"); 0308 } 0309 else if (qualifiedName() == QLatin1String("a:prstDash")) { 0310 attrs = attributes(); 0311 TRY_READ_ATTR_WITHOUT_NS(val) 0312 QPen pen; 0313 pen.setWidthF(m_currentLineWidth); 0314 if (val == "dash") { 0315 pen.setStyle(Qt::DashLine); 0316 m_currentDrawStyle->addProperty("draw:stroke", "dash"); 0317 KoGenStyle dashStyle(KoGenStyle::StrokeDashStyle); 0318 dashStyle.addAttribute("draw:style", "rect"); 0319 QVector<qreal> dashes = pen.dashPattern(); 0320 dashStyle.addAttribute("draw:dots1", static_cast<int>(1)); 0321 dashStyle.addAttributePt("draw:dots1-length", dashes[0]*pen.widthF()); 0322 dashStyle.addAttributePt("draw:distance", dashes[1]*pen.widthF()); 0323 if (dashes.size() > 2) { 0324 dashStyle.addAttribute("draw:dots2", static_cast<int>(1)); 0325 dashStyle.addAttributePt("draw:dots2-length", dashes[2]*pen.widthF()); 0326 } 0327 QString dashStyleName = mainStyles->insert(dashStyle, "dash"); 0328 m_currentDrawStyle->addProperty("draw:stroke-dash", dashStyleName); 0329 // NOTE: A "dash" looks wrong in Calligra/LO when 0330 // svg:stroke-linecap is applied. 0331 m_currentDrawStyle->removeProperty("svg:stroke-linecap"); 0332 } 0333 } 0334 SKIP_UNKNOWN 0335 } 0336 } 0337 0338 READ_EPILOGUE 0339 } 0340 0341 #undef CURRENT_EL 0342 #define CURRENT_EL solidFill 0343 //! solidFill - Solid Fill 0344 /*! DrawingML ECMA-376 20.1.8.54, p. 3234. 0345 0346 This element specifies a solid color fill. The shape is filled entirely with 0347 the specified color. 0348 0349 Parents: 0350 - bg (§21.4.3.1) 0351 - bgFillStyleLst (§20.1.4.1.7) 0352 - bgPr (§19.3.1.2) 0353 - defRPr (§21.1.2.3.2) 0354 - endParaRPr (§21.1.2.2.3) 0355 - fill (§20.1.8.28) 0356 - fill (§20.1.4.2.9) 0357 - fillOverlay (§20.1.8.29) 0358 - fillStyleLst (§20.1.4.1.13) 0359 - grpSpPr (§21.3.2.14) 0360 - grpSpPr (§20.1.2.2.22) 0361 - grpSpPr (§20.5.2.18) 0362 - grpSpPr (§19.3.1.23) 0363 - ln (§20.1.2.2.24) 0364 - lnB (§21.1.3.5) 0365 - lnBlToTr (§21.1.3.6) 0366 - lnL (§21.1.3.7) 0367 - lnR (§21.1.3.8) 0368 - lnT (§21.1.3.9) 0369 - lnTlToBr (§21.1.3.10) 0370 - [done] rPr (§21.1.2.3.9) 0371 - spPr (§21.2.2.197) 0372 - spPr (§21.3.2.23) 0373 - spPr (§21.4.3.7) 0374 - [done] spPr (§20.1.2.2.35) 0375 - spPr (§20.2.2.6) 0376 - spPr (§20.5.2.30) 0377 - [done] spPr (§19.3.1.44) 0378 - tblPr (§21.1.3.15) 0379 - tcPr (§21.1.3.17) 0380 - uFill (§21.1.2.3.12) 0381 - uLn (§21.1.2.3.14) 0382 0383 Child elements: 0384 - [done] hslClr (Hue, Saturation, Luminance Color Model) §20.1.2.3.13 0385 - [done] prstClr (Preset Color) §20.1.2.3.22 0386 - [done] schemeClr (Scheme Color) §20.1.2.3.29 0387 - [done] scrgbClr (RGB Color Model - Percentage Variant) §20.1.2.3.30 0388 - [done] srgbClr (RGB Color Model - Hex Variant) §20.1.2.3.32 0389 - [done] sysClr (System Color) §20.1.2.3.33 0390 0391 Attributes: 0392 None. 0393 */ 0394 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_solidFill() 0395 { 0396 READ_PROLOGUE 0397 0398 while (!atEnd()) { 0399 readNext(); 0400 debugMsooXml << *this; 0401 BREAK_IF_END_OF(CURRENT_EL) 0402 if (isStartElement()) { 0403 TRY_READ_IF(scrgbClr) 0404 ELSE_TRY_READ_IF(schemeClr) 0405 ELSE_TRY_READ_IF(srgbClr) 0406 ELSE_TRY_READ_IF(sysClr) 0407 ELSE_TRY_READ_IF(prstClr) 0408 ELSE_TRY_READ_IF(hslClr) 0409 ELSE_WRONG_FORMAT 0410 } 0411 } 0412 READ_EPILOGUE 0413 } 0414 0415 //! fillREf handler (Fill reference) 0416 /* 0417 Parent elements: 0418 - [done] style (§21.3.2.24); 0419 - [done] style (§21.4.2.28); 0420 - [done] style (§20.1.2.2.37); 0421 - [done] style (§20.5.2.31); 0422 - [done] style (§19.3.1.46); 0423 - [done] tblBg (§20.1.4.2.25); 0424 - [done] tcStyle (§20.1.4.2.29) 0425 0426 Child elements: 0427 - [done] hslClr (Hue, Saturation, Luminance Color Model) §20.1.2.3.13 0428 - [done] prstClr (Preset Color) §20.1.2.3.22 0429 - [done] schemeClr (Scheme Color) §20.1.2.3.29 0430 - [done] scrgbClr (RGB Color Model - Percentage Variant) §20.1.2.3.30 0431 - [done] srgbClr (RGB Color Model - Hex Variant) §20.1.2.3.32 0432 - [done] sysClr (System Color) §20.1.2.3.33 0433 0434 */ 0435 #if !defined MSOOXML_THEMESREADER_CPP 0436 #undef CURRENT_EL 0437 #define CURRENT_EL fillRef 0438 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_fillRef() 0439 { 0440 READ_PROLOGUE 0441 const QXmlStreamAttributes attrs(attributes()); 0442 TRY_READ_ATTR_WITHOUT_NS(idx) 0443 int index = idx.toInt(); 0444 0445 // If it has draw:fill it means that the style has already been defined 0446 if (!m_currentDrawStyle->property("draw:fill").isEmpty()) { 0447 skipCurrentElement(); 0448 READ_EPILOGUE 0449 } 0450 0451 while (!atEnd()) { 0452 readNext(); 0453 debugMsooXml << *this; 0454 BREAK_IF_END_OF(CURRENT_EL) 0455 if (isStartElement()) { 0456 TRY_READ_IF(schemeClr) 0457 ELSE_TRY_READ_IF(scrgbClr) 0458 ELSE_TRY_READ_IF(sysClr) 0459 ELSE_TRY_READ_IF(srgbClr) 0460 ELSE_TRY_READ_IF(prstClr) 0461 ELSE_TRY_READ_IF(hslClr) 0462 ELSE_WRONG_FORMAT 0463 } 0464 } 0465 0466 MSOOXML::DrawingMLFillBase *fillBase = m_context->themes->formatScheme.fillStyles.value(index); 0467 if (fillBase) { 0468 fillBase->writeStyles(*mainStyles, m_currentDrawStyle, m_currentColor); 0469 } 0470 0471 READ_EPILOGUE 0472 } 0473 0474 #undef CURRENT_EL 0475 #define CURRENT_EL fontRef 0476 //! fontRef handler (Font reference) 0477 /* 0478 Parent elements: 0479 - [done] style (§21.3.2.24); 0480 - [done] style (§21.4.2.28); 0481 - [done] style (§20.1.2.2.37); 0482 - [done] style (§20.5.2.31); 0483 - [done] style (§19.3.1.46); 0484 - [done] tcTxStyle (§20.1.4.2.30) 0485 0486 Child elements: 0487 - [done] hslClr (Hue, Saturation, Luminance Color Model) §20.1.2.3.13 0488 - [done] prstClr (Preset Color) §20.1.2.3.22 0489 - [done] schemeClr (Scheme Color) §20.1.2.3.29 0490 - [done] scrgbClr (RGB Color Model - Percentage Variant) §20.1.2.3.30 0491 - [done] srgbClr (RGB Color Model - Hex Variant) §20.1.2.3.32 0492 - [done] sysClr (System Color) §20.1.2.3.33 0493 */ 0494 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_fontRef() 0495 { 0496 READ_PROLOGUE 0497 0498 const QXmlStreamAttributes attrs(attributes()); 0499 0500 TRY_READ_ATTR_WITHOUT_NS(idx) 0501 0502 if (!idx.isEmpty()) { 0503 if (idx.startsWith("major")) { 0504 m_referredFontName = m_context->themes->fontScheme.majorFonts.latinTypeface; 0505 } 0506 else if (idx.startsWith("minor")) { 0507 m_referredFontName = m_context->themes->fontScheme.minorFonts.latinTypeface; 0508 } 0509 } 0510 0511 while (!atEnd()) { 0512 readNext(); 0513 BREAK_IF_END_OF(CURRENT_EL) 0514 if (isStartElement()) { 0515 TRY_READ_IF(schemeClr) 0516 ELSE_TRY_READ_IF(srgbClr) 0517 ELSE_TRY_READ_IF(sysClr) 0518 ELSE_TRY_READ_IF(scrgbClr) 0519 ELSE_TRY_READ_IF(prstClr) 0520 ELSE_TRY_READ_IF(hslClr) 0521 ELSE_WRONG_FORMAT 0522 } 0523 } 0524 0525 READ_EPILOGUE 0526 } 0527 #endif //!defined MSOOXML_THEMESREADER_CPP 0528 0529 #undef CURRENT_EL 0530 #define CURRENT_EL hslClr 0531 //! hslClr (hue saturation luminance color) 0532 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_hslClr() 0533 { 0534 READ_PROLOGUE 0535 const QXmlStreamAttributes attrs(attributes()); 0536 0537 READ_ATTR_WITHOUT_NS(hue) 0538 READ_ATTR_WITHOUT_NS(sat) 0539 READ_ATTR_WITHOUT_NS(lum) 0540 0541 qreal trueHue = hue.toDouble() / 6000.0 / 360; 0542 qreal trueSat = sat.left(sat.size() - 1).toDouble() / 100.0; 0543 qreal trueLum = lum.left(lum.size() - 1).toDouble() / 100.0; 0544 0545 m_currentColor.setHslF(trueHue, trueSat, trueLum); 0546 0547 //TODO: all the color transformations 0548 while (!atEnd()) { 0549 readNext(); 0550 BREAK_IF_END_OF(CURRENT_EL) 0551 if (isStartElement()) { 0552 TRY_READ_IF(tint) 0553 ELSE_TRY_READ_IF(shade) 0554 ELSE_TRY_READ_IF(satMod) 0555 ELSE_TRY_READ_IF(alpha) 0556 SKIP_UNKNOWN 0557 } 0558 } 0559 0560 MSOOXML::Utils::modifyColor(m_currentColor, m_currentTint, m_currentShadeLevel, m_currentSatMod); 0561 0562 READ_EPILOGUE 0563 } 0564 0565 0566 #undef CURRENT_EL 0567 #define CURRENT_EL prstClr 0568 //! prstClr (preset color) 0569 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_prstClr() 0570 { 0571 READ_PROLOGUE 0572 const QXmlStreamAttributes attrs(attributes()); 0573 0574 TRY_READ_ATTR_WITHOUT_NS(val) 0575 0576 // TODO: support all of them.. 0577 if (!val.isEmpty()) { 0578 if (val == "aliceBlue") { 0579 m_currentColor = QColor(240, 248, 255); 0580 } 0581 else if (val == "antiqueWhite") { 0582 m_currentColor = QColor(250, 235, 215); 0583 } 0584 else if (val == "aqua") { 0585 m_currentColor = QColor(0, 255, 255); 0586 } 0587 else if (val == "aquamarine") { 0588 m_currentColor = QColor(127, 255, 212); 0589 } 0590 else if (val == "azure") { 0591 m_currentColor = QColor(240, 255, 255); 0592 } 0593 else if (val == "beige") { 0594 m_currentColor = QColor(245, 245, 220); 0595 } 0596 else if (val == "bisque") { 0597 m_currentColor = QColor(255, 228, 196); 0598 } 0599 else if (val == "black") { 0600 m_currentColor = QColor(0, 0, 0); 0601 } 0602 else if (val == "blue") { 0603 m_currentColor = QColor(0, 0, 215); 0604 } 0605 else if (val == "green") { 0606 m_currentColor = QColor(0, 255, 0); 0607 } 0608 else if (val == "red") { 0609 m_currentColor = QColor(255, 0, 0); 0610 } 0611 else if (val == "violet") { 0612 m_currentColor = QColor(238, 130, 238); 0613 } 0614 else if (val == "wheat") { 0615 m_currentColor = QColor(245, 222, 179); 0616 } 0617 else if (val == "white") { 0618 m_currentColor = QColor(255, 255, 255); 0619 } 0620 else if (val == "whiteSmoke") { 0621 m_currentColor = QColor(245, 245, 245); 0622 } 0623 else if (val == "yellow") { 0624 m_currentColor = QColor(255, 255, 0); 0625 } 0626 else if (val == "yellowGreen") { 0627 m_currentColor = QColor(154, 205, 50); 0628 } 0629 } 0630 0631 m_currentTint = 0; 0632 m_currentShadeLevel = 0; 0633 m_currentSatMod = 0; 0634 m_currentAlpha = 0; 0635 0636 //TODO: all the color transformations 0637 while (!atEnd()) { 0638 readNext(); 0639 BREAK_IF_END_OF(CURRENT_EL) 0640 if (isStartElement()) { 0641 TRY_READ_IF(tint) 0642 ELSE_TRY_READ_IF(shade) 0643 ELSE_TRY_READ_IF(satMod) 0644 ELSE_TRY_READ_IF(alpha) 0645 SKIP_UNKNOWN 0646 } 0647 } 0648 0649 MSOOXML::Utils::modifyColor(m_currentColor, m_currentTint, m_currentShadeLevel, m_currentSatMod); 0650 0651 READ_EPILOGUE 0652 } 0653 0654 /* 0655 This element specifies a color bound to a user's theme. As with all 0656 elements which define a color, it is possible to apply a list of color 0657 transforms to the base color defined. 0658 0659 Parent Elements 0660 - accent1 (§20.1.4.1.1) 0661 - accent2 (§20.1.4.1.2) 0662 - accent3 (§20.1.4.1.3) 0663 - accent4 (§20.1.4.1.4) 0664 - accent5 (§20.1.4.1.5) 0665 - accent6 (§20.1.4.1.6) 0666 - alphaInv (§20.1.8.4) 0667 - bgClr (§20.1.8.10) 0668 - bgRef (§19.3.1.3) 0669 - buClr (§21.1.2.4.4) 0670 - clrFrom (§20.1.8.17) 0671 - clrMru (§19.2.1.4) 0672 - clrRepl (§20.1.8.18) 0673 - clrTo (§20.1.8.19) 0674 - clrVal (§19.5.27) 0675 - contourClr (§20.1.5.6) 0676 - custClr (§20.1.4.1.8) 0677 - dk1 (§20.1.4.1.9) 0678 - dk2 (§20.1.4.1.10) 0679 - duotone (§20.1.8.23) 0680 - effectClrLst (§21.4.4.7) 0681 - effectRef (§20.1.4.2.8) 0682 - extrusionClr (§20.1.5.7) 0683 - fgClr (§20.1.8.27) 0684 - fillClrLst (§21.4.4.8) 0685 - fillRef (§20.1.4.2.10) 0686 - folHlink (§20.1.4.1.15) 0687 - fontRef (§20.1.4.1.17) 0688 - from (§19.5.43) 0689 - glow (§20.1.8.32) 0690 - gs (§20.1.8.36) 0691 - highlight (§21.1.2.3.4) 0692 - hlink (§20.1.4.1.19) 0693 - innerShdw (§20.1.8.40) 0694 - linClrLst (§21.4.4.9) 0695 - lnRef (§20.1.4.2.19) 0696 - lt1 (§20.1.4.1.22) 0697 - lt2 (§20.1.4.1.23) 0698 - outerShdw (§20.1.8.45) 0699 - penClr (§19.2.1.23) 0700 - prstShdw (§20.1.8.49) 0701 - [done] solidFill (§20.1.8.54) 0702 - tcTxStyle (§20.1.4.2.30) 0703 - to (§19.5.90) 0704 - txEffectClrLst (§21.4.4.12) 0705 - txFillClrLst (§21.4.4.13) 0706 - txLinClrLst (§21.4.4.14) 0707 0708 Child elements: 0709 - [done] alpha (Alpha) §20.1.2.3.1 0710 - alphaMod (Alpha Modulation) §20.1.2.3.2 0711 - alphaOff (Alpha Offset) §20.1.2.3.3 0712 - blue (Blue) §20.1.2.3.4 0713 - blueMod (Blue Modification) §20.1.2.3.5 0714 - blueOff (Blue Offset) §20.1.2.3.6 0715 - comp (Complement) §20.1.2.3.7 0716 - gamma (Gamma) §20.1.2.3.8 0717 - gray (Gray) §20.1.2.3.9 0718 - green (Green) §20.1.2.3.10 0719 - greenMod (Green Modification) §20.1.2.3.11 0720 - greenOff (Green Offset) §20.1.2.3.12 0721 - hue (Hue) §20.1.2.3.14 0722 - hueMod (Hue Modulate) §20.1.2.3.15 0723 - hueOff (Hue Offset) §20.1.2.3.16 0724 - inv (Inverse) §20.1.2.3.17 0725 - invGamma (Inverse Gamma) §20.1.2.3.18 0726 - lum (Luminance) §20.1.2.3.19 0727 - [done] lumMod (Luminance Modulation) §20.1.2.3.20 0728 - [done] lumOff (Luminance Offset) §20.1.2.3.21 0729 - red (Red) §20.1.2.3.23 0730 - redMod (Red Modulation) §20.1.2.3.24 0731 - redOff (Red Offset) §20.1.2.3.25 0732 - sat (Saturation) §20.1.2.3.26 0733 - [done] satMod (Saturation Modulation) §20.1.2.3.27 0734 - satOff (Saturation Offset) §20.1.2.3.28 0735 - shade (Shade) §20.1.2.3.31 0736 - [done] tint (Tint) §20.1.2.3.34 0737 0738 Attributes 0739 - val (Value) Specifies the desired scheme. 0740 */ 0741 #undef CURRENT_EL 0742 #define CURRENT_EL schemeClr 0743 //! @todo support all child elements 0744 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_schemeClr() 0745 { 0746 READ_PROLOGUE 0747 0748 const QXmlStreamAttributes attrs(attributes()); 0749 READ_ATTR_WITHOUT_NS(val) 0750 0751 #ifdef PPTXXMLDOCUMENTREADER_CPP 0752 // Skip the rest of the code, the color scheme map (clrMap) is unknown at 0753 // time of reading. 0754 if (m_colorState == PptxXmlDocumentReader::defRPrState) { 0755 defaultTextColors[defaultTextColors.size() - 1] = val; 0756 } 0757 else { 0758 defaultBulletColors[defaultBulletColors.size() - 1] = val; 0759 } 0760 skipCurrentElement(); 0761 READ_EPILOGUE 0762 #endif 0763 0764 m_currentTint = 0; 0765 m_currentShadeLevel = 0; 0766 m_currentSatMod = 0; 0767 m_currentAlpha = 0; 0768 0769 MSOOXML::DrawingMLColorSchemeItemBase *colorItem = 0; 0770 0771 #if !defined MSOOXML_THEMESREADER_CPP 0772 QString valTransformed = m_context->colorMap.value(val); 0773 if (valTransformed.isEmpty()) { 0774 // In some cases, such as fontRef, mapping is bypassed 0775 colorItem = m_context->themes->colorScheme.value(val); 0776 } else { 0777 colorItem = m_context->themes->colorScheme.value(valTransformed); 0778 } 0779 #endif 0780 0781 // Parse the child elements 0782 MSOOXML::Utils::DoubleModifier lumMod; 0783 MSOOXML::Utils::DoubleModifier lumOff; 0784 while (!atEnd()) { 0785 readNext(); 0786 BREAK_IF_END_OF(CURRENT_EL) 0787 if (isStartElement()) { 0788 // @todo: Hmm, are these color modifications only available for pptx? 0789 if (QUALIFIED_NAME_IS(lumMod)) { 0790 m_currentDoubleValue = &lumMod.value; 0791 TRY_READ(lumMod) 0792 lumMod.valid = true; 0793 } else if (QUALIFIED_NAME_IS(lumOff)) { 0794 m_currentDoubleValue = &lumOff.value; 0795 TRY_READ(lumOff) 0796 lumOff.valid = true; 0797 } 0798 ELSE_TRY_READ_IF(shade) 0799 ELSE_TRY_READ_IF(tint) 0800 ELSE_TRY_READ_IF(satMod) 0801 ELSE_TRY_READ_IF(alpha) 0802 SKIP_UNKNOWN 0803 } 0804 } 0805 0806 QColor col = Qt::white; 0807 if (colorItem) { 0808 col = colorItem->value(); 0809 } 0810 0811 col = MSOOXML::Utils::colorForLuminance(col, lumMod, lumOff); 0812 m_currentColor = col; 0813 0814 MSOOXML::Utils::modifyColor(m_currentColor, m_currentTint, m_currentShadeLevel, m_currentSatMod); 0815 0816 READ_EPILOGUE 0817 } 0818 0819 #undef CURRENT_EL 0820 #define CURRENT_EL sysClr 0821 //! sysClr handler 0822 // SysClr is bit controversial, it is supposed to use 0823 // color defined by the system at the moment, the document is read 0824 // however, it often means that when reading the document, it is not 0825 // using the same colors, the creator wished. 0826 // Sometimes sysclr saves attribute lastClr which tells which color 0827 // the creator was using, the current implementation uses that 0828 // and ignores real system colors. 0829 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_sysClr() 0830 { 0831 READ_PROLOGUE 0832 const QXmlStreamAttributes attrs(attributes()); 0833 0834 m_currentTint = 0; 0835 m_currentShadeLevel = 0; 0836 m_currentSatMod = 0; 0837 m_currentAlpha = 0; 0838 0839 TRY_READ_ATTR_WITHOUT_NS(lastClr) 0840 0841 if (!lastClr.isEmpty()) { 0842 m_currentColor = QColor( QLatin1Char('#') + lastClr ); 0843 } 0844 0845 //TODO: all the color transformations 0846 while (!atEnd()) { 0847 readNext(); 0848 BREAK_IF_END_OF(CURRENT_EL) 0849 if (isStartElement()) { 0850 TRY_READ_IF(tint) 0851 ELSE_TRY_READ_IF(shade) 0852 ELSE_TRY_READ_IF(satMod) 0853 ELSE_TRY_READ_IF(alpha) 0854 SKIP_UNKNOWN 0855 } 0856 } 0857 0858 MSOOXML::Utils::modifyColor(m_currentColor, m_currentTint, m_currentShadeLevel, m_currentSatMod); 0859 0860 READ_EPILOGUE 0861 } 0862 0863 #undef CURRENT_EL 0864 #define CURRENT_EL scrgbClr 0865 //! RGB Color Model - Percentage Variant 0866 //! DrawingML ECMA-376 20.1.2.3.30, p. 3074. 0867 /*! 0868 This element specifies a solid color fill. 0869 0870 Child elements: 0871 - [done] alpha (Alpha) §20.1.2.3.1 0872 - alphaMod (Alpha Modulation) §20.1.2.3.2 0873 - alphaOff (Alpha Offset) §20.1.2.3.3 0874 - blue (Blue) §20.1.2.3.4 0875 - blueMod (Blue Modification) §20.1.2.3.5 0876 - blueOff (Blue Offset) §20.1.2.3.6 0877 - comp (Complement) §20.1.2.3.7 0878 - gamma (Gamma) §20.1.2.3.8 0879 - gray (Gray) §20.1.2.3.9 0880 - green (Green) §20.1.2.3.10 0881 - greenMod (Green Modification) §20.1.2.3.11 0882 - greenOff (Green Offset) §20.1.2.3.12 0883 - hue (Hue) §20.1.2.3.14 0884 - hueMod (Hue Modulate) §20.1.2.3.15 0885 - hueOff (Hue Offset) §20.1.2.3.16 0886 - [done] inv (Inverse) §20.1.2.3.17 0887 - invGamma (Inverse Gamma) §20.1.2.3.18 0888 - lum (Luminance) §20.1.2.3.19 0889 - lumMod (Luminance Modulation) §20.1.2.3.20 0890 - lumOff (Luminance Offset) §20.1.2.3.21 0891 - red (Red) §20.1.2.3.23 0892 - redMod (Red Modulation) §20.1.2.3.24 0893 - redOff (Red Offset) §20.1.2.3.25 0894 0895 Attributes: 0896 - [done] b (blue) 0897 - [done] g (green) 0898 - [done] r (red) 0899 */ 0900 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_scrgbClr() 0901 { 0902 READ_PROLOGUE 0903 0904 const QXmlStreamAttributes attrs(attributes()); 0905 0906 m_currentTint = 0; 0907 m_currentShadeLevel = 0; 0908 m_currentSatMod = 0; 0909 m_currentAlpha = 0; 0910 0911 READ_ATTR_WITHOUT_NS(r) 0912 READ_ATTR_WITHOUT_NS(g) 0913 READ_ATTR_WITHOUT_NS(b) 0914 0915 bool okR, okG, okB; 0916 0917 m_currentColor = QColor::fromRgbF(qreal(MSOOXML::Utils::ST_Percentage_to_double(r, okR)), 0918 qreal(MSOOXML::Utils::ST_Percentage_to_double(g, okG)), 0919 qreal(MSOOXML::Utils::ST_Percentage_to_double(b, okB))); 0920 0921 //TODO: all the color transformations 0922 while (!atEnd()) { 0923 readNext(); 0924 BREAK_IF_END_OF(CURRENT_EL) 0925 if (isStartElement()) { 0926 TRY_READ_IF(tint) 0927 ELSE_TRY_READ_IF(alpha) 0928 SKIP_UNKNOWN 0929 } 0930 } 0931 0932 MSOOXML::Utils::modifyColor(m_currentColor, m_currentTint, m_currentShadeLevel, m_currentSatMod); 0933 0934 READ_EPILOGUE 0935 } 0936 0937 #undef CURRENT_EL 0938 #define CURRENT_EL srgbClr 0939 //! srgbClr (RGB Color Model - Hex Variant) 0940 //! DrawingML ECMA-376 20.1.2.3.32, p. 3085. 0941 /*! 0942 This element specifies a color in RGB notation. 0943 0944 Child elements: 0945 - alpha (Alpha) §20.1.2.3.1 0946 - alphaMod (Alpha Modulation) §20.1.2.3.2 0947 - alphaOff (Alpha Offset) §20.1.2.3.3 0948 - blue (Blue) §20.1.2.3.4 0949 - blueMod (Blue Modification) §20.1.2.3.5 0950 - blueOff (Blue Offset) §20.1.2.3.6 0951 - comp (Complement) §20.1.2.3.7 0952 - gamma (Gamma) §20.1.2.3.8 0953 - gray (Gray) §20.1.2.3.9 0954 - green (Green) §20.1.2.3.10 0955 - greenMod (Green Modification) §20.1.2.3.11 0956 - greenOff (Green Offset) §20.1.2.3.12 0957 - hue (Hue) §20.1.2.3.14 0958 - hueMod (Hue Modulate) §20.1.2.3.15 0959 - hueOff (Hue Offset) §20.1.2.3.16 0960 - inv (Inverse) §20.1.2.3.17 0961 - invGamma (Inverse Gamma) §20.1.2.3.18 0962 - lum (Luminance) §20.1.2.3.19 0963 - lumMod (Luminance Modulation) §20.1.2.3.20 0964 - lumOff (Luminance Offset) §20.1.2.3.21 0965 - red (Red) §20.1.2.3.23 0966 - redMod (Red Modulation) §20.1.2.3.24 0967 - redOff (Red Offset) §20.1.2.3.25 0968 - sat (Saturation) §20.1.2.3.26 0969 - [done] satMod (Saturation Modulation) §20.1.2.3.27 0970 - satOff (Saturation Offset) §20.1.2.3.28 0971 - [done] shade (Shade) §20.1.2.3.31 0972 - [done] tint (Tint) §20.1.2.3.34 0973 0974 Attributes: 0975 - [done] val ("RRGGBB" hex digits) 0976 */ 0977 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_srgbClr() 0978 { 0979 READ_PROLOGUE 0980 0981 const QXmlStreamAttributes attrs(attributes()); 0982 0983 m_currentTint = 0; 0984 m_currentShadeLevel = 0; 0985 m_currentSatMod = 0; 0986 m_currentAlpha = 0; 0987 0988 READ_ATTR_WITHOUT_NS(val) 0989 0990 m_currentColor = QColor( QLatin1Char('#') + val ); 0991 0992 //TODO: all the color transformations 0993 while (!atEnd()) { 0994 readNext(); 0995 BREAK_IF_END_OF(CURRENT_EL) 0996 if (isStartElement()) { 0997 TRY_READ_IF(tint) 0998 ELSE_TRY_READ_IF(shade) 0999 ELSE_TRY_READ_IF(satMod) 1000 ELSE_TRY_READ_IF(alpha) 1001 SKIP_UNKNOWN 1002 } 1003 } 1004 1005 MSOOXML::Utils::modifyColor(m_currentColor, m_currentTint, m_currentShadeLevel, m_currentSatMod); 1006 1007 READ_EPILOGUE 1008 } 1009 1010 #undef CURRENT_EL 1011 #define CURRENT_EL shade 1012 //! shade (shade value) 1013 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_shade() 1014 { 1015 READ_PROLOGUE 1016 const QXmlStreamAttributes attrs(attributes()); 1017 TRY_READ_ATTR_WITHOUT_NS(val) 1018 1019 if (!val.isEmpty()) { 1020 bool ok = false; 1021 int value = val.toInt(&ok); 1022 if (!ok) { 1023 value = 0; 1024 } 1025 m_currentShadeLevel = value/100000.0; // To get percentage (form 0.x) 1026 } 1027 1028 readNext(); 1029 READ_EPILOGUE 1030 } 1031 1032 #undef CURRENT_EL 1033 #define CURRENT_EL tint 1034 //! tint (tint value) 1035 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_tint() 1036 { 1037 READ_PROLOGUE 1038 const QXmlStreamAttributes attrs(attributes()); 1039 TRY_READ_ATTR_WITHOUT_NS(val) 1040 1041 if (!val.isEmpty()) { 1042 bool ok = false; 1043 int value = val.toInt(&ok); 1044 if (!ok) { 1045 value = 0; 1046 } 1047 m_currentTint = value/100000.0; // To get percentage (form 0.x) 1048 } 1049 1050 readNext(); 1051 READ_EPILOGUE 1052 } 1053 1054 #undef CURRENT_EL 1055 #define CURRENT_EL alpha 1056 //! alpha (alpha value) 1057 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_alpha() 1058 { 1059 READ_PROLOGUE 1060 const QXmlStreamAttributes attrs(attributes()); 1061 TRY_READ_ATTR_WITHOUT_NS(val) 1062 1063 if (!val.isEmpty()) { 1064 bool ok = false; 1065 int value = val.toInt(&ok); 1066 if (!ok) { 1067 value = 0; 1068 } 1069 m_currentAlpha = value/1000; // To get percentage 1070 } 1071 1072 readNext(); 1073 READ_EPILOGUE 1074 } 1075 1076 #undef CURRENT_EL 1077 #define CURRENT_EL lumMod 1078 //! 20.1.2.3.20 lumMod (Luminance Modulation) 1079 //! This element specifies the input color with its luminance modulated by the given percentage. 1080 //! @todo support all child elements 1081 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_lumMod() 1082 { 1083 READ_PROLOGUE 1084 const QXmlStreamAttributes attrs(attributes()); 1085 READ_ATTR_WITHOUT_NS(val) 1086 1087 bool ok; 1088 Q_ASSERT(m_currentDoubleValue); 1089 *m_currentDoubleValue = MSOOXML::Utils::ST_Percentage_withMsooxmlFix_to_double(val, ok); 1090 if (!ok) 1091 return KoFilter::WrongFormat; 1092 1093 readNext(); 1094 READ_EPILOGUE 1095 } 1096 1097 #undef CURRENT_EL 1098 #define CURRENT_EL satMod 1099 //! satMod (Saturation modulation value) 1100 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_satMod() 1101 { 1102 READ_PROLOGUE 1103 const QXmlStreamAttributes attrs(attributes()); 1104 TRY_READ_ATTR_WITHOUT_NS(val) 1105 1106 if (!val.isEmpty()) { 1107 bool ok = false; 1108 int value = val.toInt(&ok); 1109 if (!ok) { 1110 value = 0; 1111 } 1112 m_currentSatMod = value/100000.0; // To get percentage in from 0.x 1113 } 1114 1115 readNext(); 1116 READ_EPILOGUE 1117 } 1118 1119 #undef CURRENT_EL 1120 #define CURRENT_EL lumOff 1121 //! 20.1.2.3.21 lumOff (Luminance Offset) 1122 //! This element specifies the input color with its luminance shifted, but with its hue and saturation unchanged. 1123 //! @todo support all child elements 1124 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_lumOff() 1125 { 1126 READ_PROLOGUE 1127 const QXmlStreamAttributes attrs(attributes()); 1128 READ_ATTR_WITHOUT_NS(val) 1129 1130 bool ok; 1131 Q_ASSERT(m_currentDoubleValue); 1132 *m_currentDoubleValue = MSOOXML::Utils::ST_Percentage_withMsooxmlFix_to_double(val, ok); 1133 if (!ok) 1134 return KoFilter::WrongFormat; 1135 1136 readNext(); 1137 READ_EPILOGUE 1138 } 1139 1140 //! tailEnd (Tail line end style) 1141 //! DrawingML ECMA-376 20.1.8.57, p.3232 1142 /*! 1143 This element specifies decorations which can be added to the tail of 1144 a line. 1145 1146 Parent Elements: 1147 - [done] ln (§20.1.2.2.24); 1148 - lnB (§21.1.3.5); 1149 - lnBlToTr (§21.1.3.6); 1150 - lnL (§21.1.3.7); 1151 - lnR (§21.1.3.8); 1152 - lnT (§21.1.3.9); 1153 - lnTlToBr (§21.1.3.10); 1154 - uLn (§21.1.2.3.14) 1155 1156 Attributes: 1157 - len (Length of Head/End) 1158 - [done] type (Line Head/End Type) 1159 - w (Width of Head/End) 1160 1161 TODO: merge the following two readers 1162 */ 1163 #undef CURRENT_EL 1164 #define CURRENT_EL tailEnd 1165 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_tailEnd() 1166 { 1167 READ_PROLOGUE 1168 const QXmlStreamAttributes attrs(attributes()); 1169 TRY_READ_ATTR_WITHOUT_NS(type) 1170 TRY_READ_ATTR_WITHOUT_NS(w) 1171 1172 if (!type.isEmpty() && type != "none") { 1173 // draw:marker-end 1174 m_currentDrawStyle->addProperty("draw:marker-end", MSOOXML::Utils::defineMarkerStyle(*mainStyles, type)); 1175 // draw:marker-end-center 1176 m_currentDrawStyle->addProperty("draw:marker-end-center", "false"); 1177 // draw:marker-end-width 1178 m_currentDrawStyle->addPropertyPt("draw:marker-end-width", 1179 MSOOXML::Utils::defineMarkerWidth(w, m_currentLineWidth)); 1180 } 1181 1182 readNext(); 1183 READ_EPILOGUE 1184 } 1185 1186 #undef CURRENT_EL 1187 #define CURRENT_EL headEnd 1188 KoFilter::ConversionStatus MSOOXML_CURRENT_CLASS::read_headEnd() 1189 { 1190 READ_PROLOGUE 1191 const QXmlStreamAttributes attrs(attributes()); 1192 TRY_READ_ATTR_WITHOUT_NS(type) 1193 TRY_READ_ATTR_WITHOUT_NS(w) 1194 1195 if (!type.isEmpty() && type != "none") { 1196 // draw:marker-start 1197 m_currentDrawStyle->addProperty("draw:marker-start", MSOOXML::Utils::defineMarkerStyle(*mainStyles, type)); 1198 // draw:marker-start-center 1199 m_currentDrawStyle->addProperty("draw:marker-start-center", "false"); 1200 // draw:marker-start-width 1201 m_currentDrawStyle->addPropertyPt("draw:marker-start-width", 1202 MSOOXML::Utils::defineMarkerWidth(w, m_currentLineWidth)); 1203 } 1204 1205 readNext(); 1206 READ_EPILOGUE 1207 } 1208 1209 #endif