diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-19 02:24:00 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-19 21:20:46 +0200 |
commit | 1fe24bb1e2fbe44a4bf2c03297e259b3a18b1235 (patch) | |
tree | e237d906174ec0646fef5051e5f6940da31e28cf /sd | |
parent | 2a6450cbe8b57cae240d8cfea02e508cfac78dbe (diff) |
Further cleanup of FastSerializerHelper's startElement/singleElement[NS]
Drop FSEND_t: C-style varargs code was replaced since version 6.0 in commit
d43fc40718217d89cc95cc3c0bc0b8e7926abcc0, so it's time to remove the last bits.
Drop int-to-string macros that are simple wrappers over OString::number.
Avoid unnecessary string type conversions.
Change-Id: I86478577b8e469f99b5a90619e5f78a61f4f23fb
Reviewed-on: https://gerrit.libreoffice.org/70964
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/eppt/pptx-animations.cxx | 118 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 173 |
2 files changed, 132 insertions, 159 deletions
diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx index d62b6214e898..a8c062b5c7df 100644 --- a/sd/source/filter/eppt/pptx-animations.cxx +++ b/sd/source/filter/eppt/pptx-animations.cxx @@ -95,8 +95,8 @@ void WriteAnimationProperty(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 n x += 1.0; y += 1.0; } - pFS->singleElementNS(XML_p, nToken, XML_x, OString::number(x * 100000).getStr(), XML_y, - OString::number(y * 100000).getStr(), FSEND); + pFS->singleElementNS(XML_p, nToken, XML_x, OString::number(x * 100000), XML_y, + OString::number(y * 100000)); } return; } @@ -110,21 +110,21 @@ void WriteAnimationProperty(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 n && (aClass == TypeClass_LONG || aClass == TypeClass_DOUBLE || aClass == TypeClass_STRING); if (bWriteToken) - pFS->startElementNS(XML_p, nToken, FSEND); + pFS->startElementNS(XML_p, nToken); switch (rAny.getValueType().getTypeClass()) { case TypeClass_LONG: rAny >>= nRgb; - pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nRgb), FSEND); + pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nRgb)); break; case TypeClass_DOUBLE: rAny >>= fDouble; - pFS->singleElementNS(XML_p, XML_fltVal, XML_val, DS(fDouble), FSEND); + pFS->singleElementNS(XML_p, XML_fltVal, XML_val, OString::number(fDouble)); break; case TypeClass_STRING: pFS->singleElementNS(XML_p, XML_strVal, XML_val, - (*o3tl::doAccess<OUString>(rAny)).toUtf8(), FSEND); + (*o3tl::doAccess<OUString>(rAny)).toUtf8()); break; default: break; @@ -142,7 +142,7 @@ void WriteAnimateColorColor(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 n sal_Int32 nColor = 0; if (rAny >>= nColor) { - pFS->startElementNS(XML_p, nToken, FSEND); + pFS->startElementNS(XML_p, nToken); if (nToken == XML_by) { @@ -152,7 +152,7 @@ void WriteAnimateColorColor(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 n else { // CT_Color - pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nColor), FSEND); + pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nColor)); } pFS->endElementNS(XML_p, nToken); @@ -162,13 +162,14 @@ void WriteAnimateColorColor(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 n if (!(rAny >>= aHSL)) return; - pFS->startElementNS(XML_p, nToken, FSEND); + pFS->startElementNS(XML_p, nToken); if (nToken == XML_by) { // CT_TLByHslColorTransform - pFS->singleElementNS(XML_p, XML_hsl, XML_h, I32S(aHSL[0] * 60000), // ST_Angel - XML_s, I32S(aHSL[1] * 100000), XML_l, I32S(aHSL[2] * 100000), FSEND); + pFS->singleElementNS(XML_p, XML_hsl, XML_h, OString::number(aHSL[0] * 60000), // ST_Angel + XML_s, OString::number(aHSL[1] * 100000), XML_l, + OString::number(aHSL[2] * 100000)); } else { @@ -201,7 +202,7 @@ void WriteAnimateValues(const FSHelperPtr& pFS, const Reference<XAnimate>& rXAni SAL_INFO("sd.eppt", "animate values, formula: " << sFormula.toUtf8()); - pFS->startElementNS(XML_p, XML_tavLst, FSEND); + pFS->startElementNS(XML_p, XML_tavLst); for (int i = 0; i < aKeyTimes.getLength(); i++) { @@ -210,8 +211,8 @@ void WriteAnimateValues(const FSHelperPtr& pFS, const Reference<XAnimate>& rXAni { pFS->startElementNS(XML_p, XML_tav, XML_fmla, sFormula.isEmpty() ? nullptr : sFormula.toUtf8().getStr(), XML_tm, - I32S(static_cast<sal_Int32>(aKeyTimes[i] * 100000.0)), FSEND); - pFS->startElementNS(XML_p, XML_val, FSEND); + OString::number(static_cast<sal_Int32>(aKeyTimes[i] * 100000.0))); + pFS->startElementNS(XML_p, XML_val); ValuePair aPair; if (aValues[i] >>= aPair) { @@ -237,10 +238,10 @@ void WriteAnimationCondListForSeq(const FSHelperPtr& pFS, sal_Int32 nToken) { const char* pEvent = (nToken == XML_prevCondLst) ? "onPrev" : "onNext"; - pFS->startElementNS(XML_p, nToken, FSEND); - pFS->startElementNS(XML_p, XML_cond, XML_evt, pEvent, FSEND); - pFS->startElementNS(XML_p, XML_tgtEl, FSEND); - pFS->singleElementNS(XML_p, XML_sldTgt, FSEND); + pFS->startElementNS(XML_p, nToken); + pFS->startElementNS(XML_p, XML_cond, XML_evt, pEvent); + pFS->startElementNS(XML_p, XML_tgtEl); + pFS->singleElementNS(XML_p, XML_sldTgt); pFS->endElementNS(XML_p, XML_tgtEl); pFS->endElementNS(XML_p, XML_cond); pFS->endElementNS(XML_p, nToken); @@ -293,17 +294,17 @@ void WriteAnimationAttributeName(const FSHelperPtr& pFS, const OUString& rAttrib if (rAttributeName.isEmpty()) return; - pFS->startElementNS(XML_p, XML_attrNameLst, FSEND); + pFS->startElementNS(XML_p, XML_attrNameLst); SAL_INFO("sd.eppt", "write attribute name: " << rAttributeName.toUtf8()); if (rAttributeName == "X;Y") { - pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->startElementNS(XML_p, XML_attrName); pFS->writeEscaped("ppt_x"); pFS->endElementNS(XML_p, XML_attrName); - pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->startElementNS(XML_p, XML_attrName); pFS->writeEscaped("ppt_y"); pFS->endElementNS(XML_p, XML_attrName); } @@ -325,7 +326,7 @@ void WriteAnimationAttributeName(const FSHelperPtr& pFS, const OUString& rAttrib if (pAttribute) { - pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->startElementNS(XML_p, XML_attrName); pFS->writeEscaped(pAttribute); pFS->endElementNS(XML_p, XML_attrName); } @@ -698,13 +699,13 @@ void PPTXAnimationExport::WriteAnimationTarget(const Any& rTarget) sal_Int32 nShapeID = mrPowerPointExport.GetShapeID(rXShape); - mpFS->startElementNS(XML_p, XML_tgtEl, FSEND); - mpFS->startElementNS(XML_p, XML_spTgt, XML_spid, I32S(nShapeID), FSEND); + mpFS->startElementNS(XML_p, XML_tgtEl); + mpFS->startElementNS(XML_p, XML_spTgt, XML_spid, OString::number(nShapeID)); if (bParagraphTarget) { - mpFS->startElementNS(XML_p, XML_txEl, FSEND); - mpFS->singleElementNS(XML_p, XML_pRg, XML_st, I32S(nParagraph), XML_end, I32S(nParagraph), - FSEND); + mpFS->startElementNS(XML_p, XML_txEl); + mpFS->singleElementNS(XML_p, XML_pRg, XML_st, OString::number(nParagraph), XML_end, + OString::number(nParagraph)); mpFS->endElementNS(XML_p, XML_txEl); } mpFS->endElementNS(XML_p, XML_spTgt); @@ -739,7 +740,7 @@ void PPTXAnimationExport::WriteAnimationCondList(const Any& rAny, sal_Int32 nTok if (aList.size() > 0) { - mpFS->startElementNS(XML_p, nToken, FSEND); + mpFS->startElementNS(XML_p, nToken); for (const Cond& rCond : aList) WriteAnimationCond(rCond); @@ -755,18 +756,18 @@ void PPTXAnimationExport::WriteAnimationCond(const Cond& rCond) if (rCond.mxShape.is()) { mpFS->startElementNS(XML_p, XML_cond, XML_delay, rCond.getDelay(), XML_evt, - rCond.mpEvent, FSEND); + rCond.mpEvent); WriteAnimationTarget(makeAny(rCond.mxShape)); mpFS->endElementNS(XML_p, XML_cond); } else { mpFS->singleElementNS(XML_p, XML_cond, XML_delay, rCond.getDelay(), XML_evt, - rCond.mpEvent, FSEND); + rCond.mpEvent); } } else - mpFS->singleElementNS(XML_p, XML_cond, XML_delay, rCond.getDelay(), FSEND); + mpFS->singleElementNS(XML_p, XML_cond, XML_delay, rCond.getDelay()); } void PPTXAnimationExport::WriteAnimationNodeAnimate(sal_Int32 nXmlNodeType) @@ -819,8 +820,7 @@ void PPTXAnimationExport::WriteAnimationNodeAnimate(sal_Int32 nXmlNodeType) aPath = ::basegfx::utils::exportToSvgD(aPolyPoly, false, false, true, true); } - mpFS->startElementNS(XML_p, nXmlNodeType, XML_origin, "layout", XML_path, - OUStringToOString(aPath, RTL_TEXTENCODING_UTF8), FSEND); + mpFS->startElementNS(XML_p, nXmlNodeType, XML_origin, "layout", XML_path, aPath.toUtf8()); } else if (nXmlNodeType == XML_animRot) { @@ -853,7 +853,7 @@ void PPTXAnimationExport::WriteAnimationNodeAnimate(sal_Int32 nXmlNodeType) } } - mpFS->startElementNS(XML_p, nXmlNodeType, XML_by, pBy, XML_from, pFrom, XML_to, pTo, FSEND); + mpFS->startElementNS(XML_p, nXmlNodeType, XML_by, pBy, XML_from, pFrom, XML_to, pTo); } else if (nXmlNodeType == XML_animClr) { @@ -867,7 +867,7 @@ void PPTXAnimationExport::WriteAnimationNodeAnimate(sal_Int32 nXmlNodeType) pDirection = xColor->getDirection() ? "cw" : "ccw"; } mpFS->startElementNS(XML_p, nXmlNodeType, XML_clrSpc, pColorSpace, XML_dir, pDirection, - XML_calcmode, pCalcMode, XML_valueType, pValueType, FSEND); + XML_calcmode, pCalcMode, XML_valueType, pValueType); } else { @@ -888,7 +888,7 @@ void PPTXAnimationExport::WriteAnimationNodeAnimate(sal_Int32 nXmlNodeType) pValueType, XML_from, sFrom.isEmpty() ? nullptr : sFrom.toUtf8().getStr(), XML_to, sTo.isEmpty() ? nullptr : sTo.toUtf8().getStr(), XML_by, - sBy.isEmpty() ? nullptr : sBy.toUtf8().getStr(), FSEND); + sBy.isEmpty() ? nullptr : sBy.toUtf8().getStr()); bTo = sTo.isEmpty() && sFrom.isEmpty() && sBy.isEmpty(); } @@ -927,7 +927,7 @@ void PPTXAnimationExport::WriteAnimationNodeAnimateInside(bool bSimple, bool bWr } } - mpFS->startElementNS(XML_p, XML_cBhvr, XML_additive, pAdditive, FSEND); + mpFS->startElementNS(XML_p, XML_cBhvr, XML_additive, pAdditive); WriteAnimationNodeCommonPropsStart(); Reference<XIterateContainer> xIterate(rXNode->getParent(), UNO_QUERY); @@ -1041,11 +1041,14 @@ void PPTXAnimationExport::WriteAnimationNodeCommonPropsStart() bool bAutoReverse = rXNode->getAutoReverse(); mpFS->startElementNS( - XML_p, XML_cTn, XML_id, I64S(mrPowerPointExport.GetNextAnimationNodeID()), XML_dur, - fDuration != 0 ? I32S(static_cast<sal_Int32>(fDuration * 1000.0)) : pDuration, XML_autoRev, - bAutoReverse ? "1" : nullptr, XML_restart, pRestart, XML_nodeType, pNodeType, XML_fill, - pFill, XML_presetClass, pPresetClass, XML_presetID, bPresetId ? I64S(nPresetId) : nullptr, - XML_presetSubtype, bPresetSubType ? I64S(nPresetSubType) : nullptr, FSEND); + XML_p, XML_cTn, XML_id, OString::number(mrPowerPointExport.GetNextAnimationNodeID()), + XML_dur, + fDuration != 0 ? OString::number(static_cast<sal_Int32>(fDuration * 1000.0)).getStr() + : pDuration, + XML_autoRev, bAutoReverse ? "1" : nullptr, XML_restart, pRestart, XML_nodeType, pNodeType, + XML_fill, pFill, XML_presetClass, pPresetClass, XML_presetID, + bPresetId ? OString::number(nPresetId).getStr() : nullptr, XML_presetSubtype, + bPresetSubType ? OString::number(nPresetSubType).getStr() : nullptr); WriteAnimationCondList(mpContext->getCondition(true), XML_stCondLst); WriteAnimationCondList(mpContext->getCondition(false), XML_endCondLst); @@ -1057,9 +1060,9 @@ void PPTXAnimationExport::WriteAnimationNodeCommonPropsStart() { const char* sType = convertTextAnimationType(xIterate->getIterateType()); - mpFS->startElementNS(XML_p, XML_iterate, XML_type, sType, FSEND); + mpFS->startElementNS(XML_p, XML_iterate, XML_type, sType); mpFS->singleElementNS(XML_p, XML_tmAbs, XML_val, - I32S(xIterate->getIterateInterval() * 1000), FSEND); + OString::number(xIterate->getIterateInterval() * 1000)); mpFS->endElementNS(XML_p, XML_iterate); } } @@ -1067,7 +1070,7 @@ void PPTXAnimationExport::WriteAnimationNodeCommonPropsStart() const std::vector<NodeContextPtr>& aChildNodes = mpContext->getChildNodes(); if (!aChildNodes.empty()) { - mpFS->startElementNS(XML_p, XML_childTnLst, FSEND); + mpFS->startElementNS(XML_p, XML_childTnLst); for (const NodeContextPtr& pChildContext : aChildNodes) { if (pChildContext->isValid()) @@ -1082,7 +1085,7 @@ void PPTXAnimationExport::WriteAnimationNodeSeq() { SAL_INFO("sd.eppt", "write animation node SEQ"); - mpFS->startElementNS(XML_p, XML_seq, FSEND); + mpFS->startElementNS(XML_p, XML_seq); WriteAnimationNodeCommonPropsStart(); @@ -1101,8 +1104,7 @@ void PPTXAnimationExport::WriteAnimationNodeEffect() const char* pFilter = ::ppt::AnimationExporter::FindTransitionName( xFilter->getTransition(), xFilter->getSubtype(), xFilter->getDirection()); const char* pMode = xFilter->getMode() ? "in" : "out"; - mpFS->startElementNS(XML_p, XML_animEffect, XML_filter, pFilter, XML_transition, pMode, - FSEND); + mpFS->startElementNS(XML_p, XML_animEffect, XML_filter, pFilter, XML_transition, pMode); WriteAnimationNodeAnimateInside(false); @@ -1139,10 +1141,10 @@ void PPTXAnimationExport::WriteAnimationNodeCommand() break; } - mpFS->startElementNS(XML_p, XML_cmd, XML_type, pType, XML_cmd, pCommand, FSEND); + mpFS->startElementNS(XML_p, XML_cmd, XML_type, pType, XML_cmd, pCommand); WriteAnimationNodeAnimateInside(false); - mpFS->startElementNS(XML_p, XML_cBhvr, FSEND); + mpFS->startElementNS(XML_p, XML_cBhvr); WriteAnimationNodeCommonPropsStart(); WriteAnimationTarget(xCommand->getTarget()); mpFS->endElementNS(XML_p, XML_cBhvr); @@ -1165,18 +1167,18 @@ void PPTXAnimationExport::WriteAnimationNodeAudio() mrPowerPointExport.embedEffectAudio(mpFS, sUrl, sRelId, sName); - mpFS->startElementNS(XML_p, XML_audio, FSEND); - mpFS->startElementNS(XML_p, XML_cMediaNode, FSEND); + mpFS->startElementNS(XML_p, XML_audio); + mpFS->startElementNS(XML_p, XML_cMediaNode); - mpFS->startElementNS(XML_p, XML_cTn, FSEND); + mpFS->startElementNS(XML_p, XML_cTn); WriteAnimationCondList(mpContext->getCondition(true), XML_stCondLst); WriteAnimationCondList(mpContext->getCondition(false), XML_endCondLst); mpFS->endElementNS(XML_p, XML_cTn); - mpFS->startElementNS(XML_p, XML_tgtEl, FSEND); + mpFS->startElementNS(XML_p, XML_tgtEl); mpFS->singleElementNS(XML_p, XML_sndTgt, FSNS(XML_r, XML_embed), sRelId.isEmpty() ? nullptr : sRelId.toUtf8().getStr(), XML_name, - sUrl.isEmpty() ? nullptr : sName.toUtf8().getStr(), FSEND); + sUrl.isEmpty() ? nullptr : sName.toUtf8().getStr()); mpFS->endElementNS(XML_p, XML_tgtEl); mpFS->endElementNS(XML_p, XML_cMediaNode); @@ -1196,7 +1198,7 @@ void PPTXAnimationExport::WriteAnimationNode(const NodeContextPtr& pContext) switch (xmlNodeType) { case XML_par: - mpFS->startElementNS(XML_p, xmlNodeType, FSEND); + mpFS->startElementNS(XML_p, xmlNodeType); WriteAnimationNodeCommonPropsStart(); mpFS->endElementNS(XML_p, xmlNodeType); break; @@ -1249,8 +1251,8 @@ void PPTXAnimationExport::WriteAnimations(const Reference<XDrawPage>& rXDrawPage auto pNodeContext = std::make_unique<NodeContext>(xNode, false, false); if (pNodeContext->isValid()) { - mpFS->startElementNS(XML_p, XML_timing, FSEND); - mpFS->startElementNS(XML_p, XML_tnLst, FSEND); + mpFS->startElementNS(XML_p, XML_timing); + mpFS->startElementNS(XML_p, XML_tnLst); WriteAnimationNode(pNodeContext); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index cdc452b7c31d..abe09c4a8964 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -120,11 +120,11 @@ namespace { void WriteSndAc(const FSHelperPtr& pFS, const OUString& sSoundRelId, const OUString& sSoundName) { - pFS->startElementNS(XML_p, XML_sndAc, FSEND); - pFS->startElementNS(XML_p, XML_stSnd, FSEND); + pFS->startElementNS(XML_p, XML_sndAc); + pFS->startElementNS(XML_p, XML_stSnd); pFS->singleElementNS(XML_p, XML_snd, FSNS(XML_r, XML_embed), sSoundRelId.isEmpty() ? nullptr : sSoundRelId.toUtf8().getStr(), - XML_name, sSoundName.isEmpty() ? nullptr : sSoundName.toUtf8().getStr(), FSEND); + XML_name, sSoundName.isEmpty() ? nullptr : sSoundName.toUtf8().getStr()); pFS->endElement(FSNS(XML_p, XML_stSnd)); pFS->endElement(FSNS(XML_p, XML_sndAc)); } @@ -244,7 +244,7 @@ void PowerPointShapeExport::SetPageType(PageType ePageType) ShapeExport& PowerPointShapeExport::WriteNonVisualProperties(const Reference< XShape >&) { - GetFS()->singleElementNS(XML_p, XML_nvPr, FSEND); + GetFS()->singleElementNS(XML_p, XML_nvPr); return *this; } @@ -415,7 +415,7 @@ bool PowerPointExport::exportDocument() oox::getRelationship(Relationship::THEME), "theme/theme1.xml"); - mPresentationFS->startElementNS(XML_p, XML_presentation, PNMSS, FSEND); + mPresentationFS->startElementNS(XML_p, XML_presentation, PNMSS); mXStatusIndicator.set(getStatusIndicator(), UNO_QUERY); @@ -428,14 +428,12 @@ bool PowerPointExport::exportDocument() exportPPT(aProperties); mPresentationFS->singleElementNS(XML_p, XML_sldSz, - XML_cx, IS(PPTtoEMU(maDestPageSize.Width)), - XML_cy, IS(PPTtoEMU(maDestPageSize.Height)), - FSEND); + XML_cx, OString::number(PPTtoEMU(maDestPageSize.Width)), + XML_cy, OString::number(PPTtoEMU(maDestPageSize.Height))); // for some reason if added before slides list it will not load the slides (alas with error reports) in mso mPresentationFS->singleElementNS(XML_p, XML_notesSz, - XML_cx, IS(PPTtoEMU(maNotesPageSize.Width)), - XML_cy, IS(PPTtoEMU(maNotesPageSize.Height)), - FSEND); + XML_cx, OString::number(PPTtoEMU(maNotesPageSize.Width)), + XML_cy, OString::number(PPTtoEMU(maNotesPageSize.Height))); WriteAuthors(); @@ -470,8 +468,8 @@ void PowerPointExport::ImplWriteBackground(const FSHelperPtr& pFS, const Referen aFillStyle == FillStyle_HATCH) return; - pFS->startElementNS(XML_p, XML_bg, FSEND); - pFS->startElementNS(XML_p, XML_bgPr, FSEND); + pFS->startElementNS(XML_p, XML_bg); + pFS->startElementNS(XML_p, XML_bgPr); PowerPointShapeExport aDML(pFS, &maShapeMap, this); aDML.SetBackgroundDark(mbIsBackgroundDark); @@ -833,36 +831,31 @@ void PowerPointExport::WriteTransition(const FSHelperPtr& pFS) { const char* pRequiresNS = (nTransition14 || isTransitionDurationSet) ? "p14" : "p15"; - pFS->startElement(FSNS(XML_mc, XML_AlternateContent), FSEND); - pFS->startElement(FSNS(XML_mc, XML_Choice), XML_Requires, pRequiresNS, FSEND); + pFS->startElement(FSNS(XML_mc, XML_AlternateContent)); + pFS->startElement(FSNS(XML_mc, XML_Choice), XML_Requires, pRequiresNS); if(isTransitionDurationSet && isAdvanceTimingSet) { pFS->startElementNS(XML_p, XML_transition, XML_spd, speed, - XML_advTm, I32S(advanceTiming * 1000), - FSNS(XML_p14, XML_dur), I32S(nTransitionDuration), - FSEND); + XML_advTm, OString::number(advanceTiming * 1000), + FSNS(XML_p14, XML_dur), OString::number(nTransitionDuration)); } else if(isTransitionDurationSet) { pFS->startElementNS(XML_p, XML_transition, XML_spd, speed, - FSNS(XML_p14, XML_dur), I32S(nTransitionDuration), - FSEND); + FSNS(XML_p14, XML_dur), OString::number(nTransitionDuration)); } else if(isAdvanceTimingSet) { pFS->startElementNS(XML_p, XML_transition, XML_spd, speed, - XML_advTm, I32S(advanceTiming * 1000), - FSEND); + XML_advTm, OString::number(advanceTiming * 1000)); } else { - pFS->startElementNS(XML_p, XML_transition, - XML_spd, speed, - FSEND); + pFS->startElementNS(XML_p, XML_transition, XML_spd, speed); } if (nTransition14) @@ -870,14 +863,12 @@ void PowerPointExport::WriteTransition(const FSHelperPtr& pFS) pFS->singleElementNS(XML_p14, nTransition14, XML_isInverted, pInverted, XML_dir, pDirection14, - XML_pattern, pPattern, - FSEND); + XML_pattern, pPattern); } else if (pPresetTransition) { pFS->singleElementNS(XML_p15, XML_prstTrans, - XML_prst, pPresetTransition, - FSEND); + XML_prst, pPresetTransition); } else if (isTransitionDurationSet && nTransition) { @@ -885,8 +876,7 @@ void PowerPointExport::WriteTransition(const FSHelperPtr& pFS) XML_dir, pDirection, XML_orient, pOrientation, XML_spokes, pSpokes, - XML_thruBlk, pThruBlk, - FSEND); + XML_thruBlk, pThruBlk); } if (!sSoundRelId.isEmpty()) @@ -895,13 +885,12 @@ void PowerPointExport::WriteTransition(const FSHelperPtr& pFS) pFS->endElement(FSNS(XML_p, XML_transition)); pFS->endElement(FSNS(XML_mc, XML_Choice)); - pFS->startElement(FSNS(XML_mc, XML_Fallback), FSEND); + pFS->startElement(FSNS(XML_mc, XML_Fallback)); } pFS->startElementNS(XML_p, XML_transition, XML_spd, speed, - XML_advTm, isAdvanceTimingSet ? I32S(advanceTiming * 1000) : nullptr, - FSEND); + XML_advTm, isAdvanceTimingSet ? OString::number(advanceTiming * 1000).getStr() : nullptr); if (nTransition) { @@ -909,8 +898,7 @@ void PowerPointExport::WriteTransition(const FSHelperPtr& pFS) XML_dir, pDirection, XML_orient, pOrientation, XML_spokes, pSpokes, - XML_thruBlk, pThruBlk, - FSEND); + XML_thruBlk, pThruBlk); } if (!sSoundRelId.isEmpty()) @@ -957,18 +945,16 @@ void PowerPointExport::WriteAuthors() "commentAuthors.xml"); pFS->startElementNS(XML_p, XML_cmAuthorLst, - FSNS(XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL(OOX_NS(ppt)), RTL_TEXTENCODING_UTF8), - FSEND); + FSNS(XML_xmlns, XML_p), this->getNamespaceURL(OOX_NS(ppt)).toUtf8()); for (const AuthorsMap::value_type& i : maAuthors) { pFS->singleElementNS(XML_p, XML_cmAuthor, - XML_id, I32S(i.second.nId), + XML_id, OString::number(i.second.nId), XML_name, i.first.toUtf8(), XML_initials, lcl_GetInitials(i.first).toUtf8(), - XML_lastIdx, I32S(i.second.nLastIndex), - XML_clrIdx, I32S(i.second.nId), - FSEND); + XML_lastIdx, OString::number(i.second.nLastIndex), + XML_clrIdx, OString::number(i.second.nId)); } pFS->endElementNS(XML_p, XML_cmAuthorLst); @@ -1008,8 +994,7 @@ bool PowerPointExport::WriteComments(sal_uInt32 nPageNum) "application/vnd.openxmlformats-officedocument.presentationml.comments+xml"); pFS->startElementNS(XML_p, XML_cmLst, - FSNS(XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL(OOX_NS(ppt)), RTL_TEXTENCODING_UTF8), - FSEND); + FSNS(XML_xmlns, XML_p), this->getNamespaceURL(OOX_NS(ppt)).toUtf8()); do { @@ -1025,18 +1010,15 @@ bool PowerPointExport::WriteComments(sal_uInt32 nPageNum) snprintf(cDateTime, sizeof cDateTime, "%02" SAL_PRIdINT32 "-%02" SAL_PRIuUINT32 "-%02" SAL_PRIuUINT32 "T%02" SAL_PRIuUINT32 ":%02" SAL_PRIuUINT32 ":%02" SAL_PRIuUINT32 ".%09" SAL_PRIuUINT32, sal_Int32(aDateTime.Year), sal_uInt32(aDateTime.Month), sal_uInt32(aDateTime.Day), sal_uInt32(aDateTime.Hours), sal_uInt32(aDateTime.Minutes), sal_uInt32(aDateTime.Seconds), aDateTime.NanoSeconds); pFS->startElementNS(XML_p, XML_cm, - XML_authorId, I32S(nId), + XML_authorId, OString::number(nId), XML_dt, cDateTime, - XML_idx, I32S(nLastIndex), - FSEND); + XML_idx, OString::number(nLastIndex)); pFS->singleElementNS(XML_p, XML_pos, - XML_x, I64S(static_cast<sal_Int64>((57600*aRealPoint2D.X + 1270)/2540.0)), - XML_y, I64S(static_cast<sal_Int64>((57600*aRealPoint2D.Y + 1270)/2540.0)), - FSEND); + XML_x, OString::number(static_cast<sal_Int64>((57600*aRealPoint2D.X + 1270)/2540.0)), + XML_y, OString::number(static_cast<sal_Int64>((57600*aRealPoint2D.Y + 1270)/2540.0))); - pFS->startElementNS(XML_p, XML_text, - FSEND); + pFS->startElementNS(XML_p, XML_text); pFS->write(xText->getString()); pFS->endElementNS(XML_p, XML_text); @@ -1087,7 +1069,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum // slides list if (nPageNum == 0) - mPresentationFS->startElementNS(XML_p, XML_sldIdLst, FSEND); + mPresentationFS->startElementNS(XML_p, XML_sldIdLst); // add explicit relation of presentation to this slide OUString sRelId = addRelation(mPresentationFS->getOutputStream(), @@ -1099,9 +1081,8 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum .makeStringAndClear()); mPresentationFS->singleElementNS(XML_p, XML_sldId, - XML_id, I32S(GetNewSlideId()), - FSNS(XML_r, XML_id), sRelId.toUtf8(), - FSEND); + XML_id, OString::number(GetNewSlideId()), + FSNS(XML_r, XML_id), sRelId.toUtf8()); if (nPageNum == mnPages - 1) mPresentationFS->endElementNS(XML_p, XML_sldIdLst); @@ -1126,11 +1107,9 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum pShow = "0"; } - pFS->startElementNS(XML_p, XML_sld, PNMSS, - XML_show, pShow, - FSEND); + pFS->startElementNS(XML_p, XML_sld, PNMSS, XML_show, pShow); - pFS->startElementNS(XML_p, XML_cSld, FSEND); + pFS->startElementNS(XML_p, XML_cSld); // background if (bHasBackground) @@ -1183,9 +1162,9 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) .makeStringAndClear(), "application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"); - pFS->startElementNS(XML_p, XML_notes, PNMSS, FSEND); + pFS->startElementNS(XML_p, XML_notes, PNMSS); - pFS->startElementNS(XML_p, XML_cSld, FSEND); + pFS->startElementNS(XML_p, XML_cSld); WriteShapeTree(pFS, NOTICE, false); @@ -1232,9 +1211,8 @@ void PowerPointExport::AddLayoutIdAndRelation(const FSHelperPtr& pFS, sal_Int32 .makeStringAndClear()); pFS->singleElementNS(XML_p, XML_sldLayoutId, - XML_id, I64S(GetNewSlideMasterId()), - FSNS(XML_r, XML_id), sRelId.toUtf8(), - FSEND); + XML_id, OString::number(GetNewSlideMasterId()), + FSNS(XML_r, XML_id), sRelId.toUtf8()); } void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPropertySet > const& aXBackgroundPropSet) @@ -1243,7 +1221,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro // slides list if (nPageNum == 0) - mPresentationFS->startElementNS(XML_p, XML_sldMasterIdLst, FSEND); + mPresentationFS->startElementNS(XML_p, XML_sldMasterIdLst); OUString sRelId = addRelation(mPresentationFS->getOutputStream(), oox::getRelationship(Relationship::SLIDEMASTER), @@ -1254,9 +1232,8 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro .makeStringAndClear()); mPresentationFS->singleElementNS(XML_p, XML_sldMasterId, - XML_id, OString::number(GetNewSlideMasterId()).getStr(), - FSNS(XML_r, XML_id), sRelId.toUtf8(), - FSEND); + XML_id, OString::number(GetNewSlideMasterId()), + FSNS(XML_r, XML_id), sRelId.toUtf8()); if (nPageNum == mnMasterPages - 1) mPresentationFS->endElementNS(XML_p, XML_sldMasterIdLst); @@ -1281,9 +1258,9 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro .append(".xml") .makeStringAndClear()); - pFS->startElementNS(XML_p, XML_sldMaster, PNMSS, FSEND); + pFS->startElementNS(XML_p, XML_sldMaster, PNMSS); - pFS->startElementNS(XML_p, XML_cSld, FSEND); + pFS->startElementNS(XML_p, XML_cSld); ImplWriteBackground(pFS, aXBackgroundPropSet); WriteShapeTree(pFS, MASTER, true); @@ -1303,11 +1280,10 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro XML_accent5, "accent5", XML_accent6, "accent6", XML_hlink, "hlink", - XML_folHlink, "folHlink", - FSEND); + XML_folHlink, "folHlink"); // use master's id type as they have same range, mso does that as well - pFS->startElementNS(XML_p, XML_sldLayoutIdLst, FSEND); + pFS->startElementNS(XML_p, XML_sldLayoutIdLst); for (int i = 0; i < LAYOUT_SIZE; i++) { @@ -1391,12 +1367,10 @@ void PowerPointExport::ImplWritePPTXLayout(sal_Int32 nOffset, sal_uInt32 nMaster pFS->startElementNS(XML_p, XML_sldLayout, PNMSS, XML_type, aLayoutInfo[ nOffset ].sType, - XML_preserve, "1", - FSEND); + XML_preserve, "1"); pFS->startElementNS(XML_p, XML_cSld, - XML_name, aLayoutInfo[ nOffset ].sName, - FSEND); + XML_name, aLayoutInfo[ nOffset ].sName); //pFS->write( MINIMAL_SPTREE ); // TODO: write actual shape tree WriteShapeTree(pFS, LAYOUT, true); @@ -1418,7 +1392,7 @@ void PowerPointExport::WriteShapeTree(const FSHelperPtr& pFS, PageType ePageType aDML.SetPageType(ePageType); aDML.SetBackgroundDark(mbIsBackgroundDark); - pFS->startElementNS(XML_p, XML_spTree, FSEND); + pFS->startElementNS(XML_p, XML_spTree); pFS->write(MAIN_GROUP); ResetGroupTable(mXShapes->getCount()); @@ -1468,16 +1442,16 @@ bool PowerPointShapeExport::WritePlaceholder(const Reference< XShape >& xShape, ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShape >& xShape, PlaceholderType ePlaceholder) { - mpFS->startElementNS(XML_p, XML_sp, FSEND); + mpFS->startElementNS(XML_p, XML_sp); // non visual shape properties - mpFS->startElementNS(XML_p, XML_nvSpPr, FSEND); + mpFS->startElementNS(XML_p, XML_nvSpPr); const OString aPlaceholderID("PlaceHolder " + OString::number(mnShapeIdMax++)); WriteNonVisualDrawingProperties(xShape, aPlaceholderID.getStr()); - mpFS->startElementNS(XML_p, XML_cNvSpPr, FSEND); - mpFS->singleElementNS(XML_a, XML_spLocks, XML_noGrp, "1", FSEND); + mpFS->startElementNS(XML_p, XML_cNvSpPr); + mpFS->singleElementNS(XML_a, XML_spLocks, XML_noGrp, "1"); mpFS->endElementNS(XML_p, XML_cNvSpPr); - mpFS->startElementNS(XML_p, XML_nvPr, FSEND); + mpFS->startElementNS(XML_p, XML_nvPr); const char* pType = nullptr; switch (ePlaceholder) @@ -1513,12 +1487,12 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap SAL_INFO("sd.eppt", "warning: unhandled placeholder type: " << ePlaceholder); } SAL_INFO("sd.eppt", "write placeholder " << pType); - mpFS->singleElementNS(XML_p, XML_ph, XML_type, pType, FSEND); + mpFS->singleElementNS(XML_p, XML_ph, XML_type, pType); mpFS->endElementNS(XML_p, XML_nvPr); mpFS->endElementNS(XML_p, XML_nvSpPr); // visual shape properties - mpFS->startElementNS(XML_p, XML_spPr, FSEND); + mpFS->startElementNS(XML_p, XML_spPr); WriteShapeTransformation(xShape, XML_a); WritePresetShape("rect"); Reference< XPropertySet > xProps(xShape, UNO_QUERY); @@ -1767,7 +1741,7 @@ void PowerPointExport::WriteDefaultColorSchemes(const FSHelperPtr& pFS) .makeStringAndClear(); pFS->write(sOpenColorScheme); - pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nColor), FSEND); + pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nColor)); OUString sCloseColorScheme = OUStringBuffer() .append("</a:") @@ -1820,7 +1794,7 @@ bool PowerPointExport::WriteColorSchemes(const FSHelperPtr& pFS, const OUString& .makeStringAndClear(); pFS->write(sOpenColorScheme); - pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nColor), FSEND); + pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nColor)); OUString sCloseColorScheme = OUStringBuffer() .append("</a:") @@ -1855,12 +1829,11 @@ void PowerPointExport::WriteTheme(sal_Int32 nThemeNum) "application/vnd.openxmlformats-officedocument.theme+xml"); pFS->startElementNS(XML_a, XML_theme, - FSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8), - XML_name, "Office Theme", - FSEND); + FSNS(XML_xmlns, XML_a), this->getNamespaceURL(OOX_NS(dml)).toUtf8(), + XML_name, "Office Theme"); - pFS->startElementNS(XML_a, XML_themeElements, FSEND); - pFS->startElementNS(XML_a, XML_clrScheme, XML_name, "Office", FSEND); + pFS->startElementNS(XML_a, XML_themeElements); + pFS->startElementNS(XML_a, XML_clrScheme, XML_name, "Office"); pFS->write(SYS_COLOR_SCHEMES); @@ -1906,15 +1879,14 @@ void PowerPointExport::WriteNotesMaster() { SAL_INFO("sd.eppt", "write Notes master\n---------------"); - mPresentationFS->startElementNS(XML_p, XML_notesMasterIdLst, FSEND); + mPresentationFS->startElementNS(XML_p, XML_notesMasterIdLst); OUString sRelId = addRelation(mPresentationFS->getOutputStream(), oox::getRelationship(Relationship::NOTESMASTER), "notesMasters/notesMaster1.xml"); mPresentationFS->singleElementNS(XML_p, XML_notesMasterId, - FSNS(XML_r, XML_id), sRelId.toUtf8(), - FSEND); + FSNS(XML_r, XML_id), sRelId.toUtf8()); mPresentationFS->endElementNS(XML_p, XML_notesMasterIdLst); @@ -1933,9 +1905,9 @@ void PowerPointExport::WriteNotesMaster() .append(".xml") .makeStringAndClear()); - pFS->startElementNS(XML_p, XML_notesMaster, PNMSS, FSEND); + pFS->startElementNS(XML_p, XML_notesMaster, PNMSS); - pFS->startElementNS(XML_p, XML_cSld, FSEND); + pFS->startElementNS(XML_p, XML_cSld); Reference< XPropertySet > aXBackgroundPropSet; if (ImplGetPropertyValue(mXPagePropSet, "Background") && @@ -1959,8 +1931,7 @@ void PowerPointExport::WriteNotesMaster() XML_accent5, "accent5", XML_accent6, "accent6", XML_hlink, "hlink", - XML_folHlink, "folHlink", - FSEND); + XML_folHlink, "folHlink"); pFS->endElementNS(XML_p, XML_notesMaster); @@ -2038,7 +2009,7 @@ OUString PowerPointExport::getImplementationName() void PowerPointExport::WriteDiagram(const FSHelperPtr& pFS, PowerPointShapeExport& rDML, const css::uno::Reference<css::drawing::XShape>& rXShape, int nDiagramId) { SAL_INFO("sd.eppt", "writing Diagram " + OUString::number(nDiagramId)); - pFS->startElementNS(XML_p, XML_graphicFrame, FSEND); + pFS->startElementNS(XML_p, XML_graphicFrame); rDML.WriteDiagram(rXShape, nDiagramId); pFS->endElementNS(XML_p, XML_graphicFrame); } |