include/oox/export/utils.hxx | 12 include/sax/fshelper.hxx | 19 oox/source/core/xmlfilterbase.cxx | 34 oox/source/export/chartexport.cxx | 749 +++++------------ oox/source/export/drawingml.cxx | 508 +++++------- oox/source/export/shapes.cxx | 313 +++---- oox/source/export/vmlexport.cxx | 10 sax/source/tools/fshelper.cxx | 4 sc/source/filter/excel/excdoc.cxx | 10 sc/source/filter/excel/excrecds.cxx | 45 - sc/source/filter/excel/xecontent.cxx | 110 +- sc/source/filter/excel/xedbdata.cxx | 27 sc/source/filter/excel/xeescher.cxx | 59 - sc/source/filter/excel/xeextlst.cxx | 49 - sc/source/filter/excel/xelink.cxx | 60 - sc/source/filter/excel/xename.cxx | 8 sc/source/filter/excel/xepage.cxx | 21 sc/source/filter/excel/xepivotxml.cxx | 113 -- sc/source/filter/excel/xerecord.cxx | 2 sc/source/filter/excel/xestream.cxx | 14 sc/source/filter/excel/xestring.cxx | 10 sc/source/filter/excel/xestyle.cxx | 173 +--- sc/source/filter/excel/xetable.cxx | 104 +- sc/source/filter/excel/xeview.cxx | 38 sc/source/filter/xcl97/XclExpChangeTrack.cxx | 81 - sc/source/filter/xcl97/xcl97rec.cxx | 61 - sd/source/filter/eppt/pptx-animations.cxx | 118 +- sd/source/filter/eppt/pptx-epptooxml.cxx | 173 +--- starmath/source/ooxmlexport.cxx | 193 ++-- sw/source/filter/ww8/docxattributeoutput.cxx | 1086 ++++++++++---------------- sw/source/filter/ww8/docxexport.cxx | 103 +- sw/source/filter/ww8/docxsdrexport.cxx | 167 +-- sw/source/filter/ww8/docxtablestyleexport.cxx | 56 - 33 files changed, 1807 insertions(+), 2723 deletions(-)
New commits: commit 1fe24bb1e2fbe44a4bf2c03297e259b3a18b1235 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Apr 19 02:24:00 2019 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri Apr 19 21:20:46 2019 +0200 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.kagan...@collabora.com> diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx index fa758089136e..357597e7a5d4 100644 --- a/include/oox/export/utils.hxx +++ b/include/oox/export/utils.hxx @@ -24,21 +24,13 @@ #include <rtl/textenc.h> #include <sal/types.h> -inline OString I32S_(sal_Int32 x) { return OString::number(x); } -inline OString I32SHEX_(sal_Int32 x) +inline OString I32SHEX(sal_Int32 x) { OString aStr = OString::number(x, 16); while (aStr.getLength() < 6) aStr = OString("0") + aStr; - return aStr.getStr(); + return aStr; } -inline OString I64S_(sal_Int64 x) { return OString::number(x); } -inline OString DS_(double x) { return OString::number(x); } -#define I32S(x) I32S_(x).getStr() -#define I32SHEX(x) I32SHEX_(x).getStr() -#define I64S(x) I64S_(x).getStr() -#define IS(x) OString::number( x ).getStr() -#define DS(x) DS_(x).getStr() /** * @return const char* literal "true" for true value, or literal "false" diff --git a/include/sax/fshelper.hxx b/include/sax/fshelper.hxx index c5148dcd0b00..7876e48a6c6c 100644 --- a/include/sax/fshelper.hxx +++ b/include/sax/fshelper.hxx @@ -31,13 +31,6 @@ namespace com { namespace sun { namespace star { namespace io { class XOutputStr namespace sax_fastparser { class FastAttributeList; } #define FSNS(namespc, element) ((namespc << 16) | element) -// Backwards compatibility for code that used FSEND to terminate the vararg. -// As soon as no supported LO version has the varargs code, this can be removed entirely -// (otherwise backports might break silently if people didn't add FSEND). -// Ctor is there to get an error when trying to pass it to a vararg by accident. -struct FSEND_t { FSEND_t() {}; }; -static const FSEND_t FSEND = FSEND_t(); -const sal_Int32 FSEND_internal = -1; // same as XML_TOKEN_INVALID namespace sax_fastparser { @@ -69,7 +62,7 @@ public: pushAttributeValue(attribute, value); startElement(elementTokenId, std::forward<Args>(args)...); } - void startElement(sal_Int32 elementTokenId, FSEND_t); + void startElement(sal_Int32 elementTokenId); /// Start an element. After the first two arguments there can be a number of (attribute, value) pairs. template<typename... Args> @@ -85,9 +78,9 @@ public: pushAttributeValue(attribute, value); startElementNS(namespaceTokenId, elementTokenId, std::forward<Args>(args)...); } - void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, FSEND_t) + void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId) { - startElement(FSNS(namespaceTokenId, elementTokenId), FSEND); + startElement(FSNS(namespaceTokenId, elementTokenId)); } /// Create a single element. After the first argument there can be a number of (attribute, value) pairs. @@ -104,7 +97,7 @@ public: pushAttributeValue(attribute, value); singleElement(elementTokenId, std::forward<Args>(args)...); } - void singleElement(sal_Int32 elementTokenId, FSEND_t); + void singleElement(sal_Int32 elementTokenId); /// Create a single element. After the first two arguments there can be a number of (attribute, value) pairs. template<typename... Args> @@ -120,9 +113,9 @@ public: pushAttributeValue(attribute, value); singleElementNS(namespaceTokenId, elementTokenId, std::forward<Args>(args)...); } - void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, FSEND_t) + void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId) { - singleElement(FSNS(namespaceTokenId, elementTokenId), FSEND); + singleElement(FSNS(namespaceTokenId, elementTokenId)); } void endElement(sal_Int32 elementTokenId); diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 632a3ce357b6..738412fb182c 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -545,7 +545,7 @@ OUString XmlFilterBase::addRelation( const Reference< XOutputStream >& rOutputSt static void writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const OUString& sValue ) { - pDoc->startElement( nXmlElement, FSEND ); + pDoc->startElement(nXmlElement); pDoc->writeEscaped( sValue ); pDoc->endElement( nXmlElement ); } @@ -553,7 +553,7 @@ writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const OUString& sV static void writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const sal_Int32 nValue ) { - pDoc->startElement( nXmlElement, FSEND ); + pDoc->startElement(nXmlElement); pDoc->write( nValue ); pDoc->endElement( nXmlElement ); } @@ -565,11 +565,9 @@ writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const util::DateTi return; if ( ( nXmlElement >> 16 ) != XML_dcterms ) - pDoc->startElement( nXmlElement, FSEND ); + pDoc->startElement(nXmlElement); else - pDoc->startElement( nXmlElement, - FSNS( XML_xsi, XML_type ), "dcterms:W3CDTF", - FSEND ); + pDoc->startElement(nXmlElement, FSNS(XML_xsi, XML_type), "dcterms:W3CDTF"); char pStr[200]; snprintf( pStr, sizeof( pStr ), "%d-%02d-%02dT%02d:%02d:%02dZ", @@ -622,12 +620,11 @@ writeCoreProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties "docProps/core.xml", "application/vnd.openxmlformats-package.core-properties+xml" ); pCoreProps->startElementNS( XML_cp, XML_coreProperties, - FSNS( XML_xmlns, XML_cp ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(packageMetaCorePr)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_dc ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(dc)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_dcterms ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(dcTerms)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_dcmitype ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(dcmiType)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_xsi ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(xsi)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + FSNS(XML_xmlns, XML_cp), rSelf.getNamespaceURL(OOX_NS(packageMetaCorePr)).toUtf8(), + FSNS(XML_xmlns, XML_dc), rSelf.getNamespaceURL(OOX_NS(dc)).toUtf8(), + FSNS(XML_xmlns, XML_dcterms), rSelf.getNamespaceURL(OOX_NS(dcTerms)).toUtf8(), + FSNS(XML_xmlns, XML_dcmitype), rSelf.getNamespaceURL(OOX_NS(dcmiType)).toUtf8(), + FSNS(XML_xmlns, XML_xsi), rSelf.getNamespaceURL(OOX_NS(xsi)).toUtf8()); #ifdef OOXTODO writeElement( pCoreProps, FSNS( XML_cp, XML_category ), "category" ); @@ -665,9 +662,8 @@ writeAppProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties > "docProps/app.xml", "application/vnd.openxmlformats-officedocument.extended-properties+xml" ); pAppProps->startElement( XML_Properties, - XML_xmlns, OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeExtPr)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_vt ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + XML_xmlns, rSelf.getNamespaceURL(OOX_NS(officeExtPr)).toUtf8(), + FSNS(XML_xmlns, XML_vt), rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT)).toUtf8()); writeElement( pAppProps, XML_Template, xProperties->getTemplateName() ); #ifdef OOXTODO @@ -778,9 +774,8 @@ writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentPropertie "docProps/custom.xml", "application/vnd.openxmlformats-officedocument.custom-properties+xml" ); pAppProps->startElement( XML_Properties, - XML_xmlns, OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeCustomPr)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_vt ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + XML_xmlns, rSelf.getNamespaceURL(OOX_NS(officeCustomPr)).toUtf8(), + FSNS(XML_xmlns, XML_vt), rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT)).toUtf8()); size_t nIndex = 0; for (const auto& rProp : aprop) @@ -792,8 +787,7 @@ writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentPropertie pAppProps->startElement( XML_property , XML_fmtid, "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}", XML_pid, OString::number(nIndex + 2), - XML_name, aName, - FSEND); + XML_name, aName); switch ( rProp.Value.getValueTypeClass() ) { diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 54379188649e..6d4dc1efa1b3 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -453,9 +453,9 @@ void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nI Reference< XPropertySet > xShapeProps( xShape, UNO_QUERY ); - pFS->startElementNS( mnXmlNamespace, XML_graphicFrame, FSEND ); + pFS->startElementNS(mnXmlNamespace, XML_graphicFrame); - pFS->startElementNS( mnXmlNamespace, XML_nvGraphicFramePr, FSEND ); + pFS->startElementNS(mnXmlNamespace, XML_nvGraphicFramePr); // TODO: get the correct chart name chart id OUString sName = "Object 1"; @@ -464,9 +464,8 @@ void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nI sName = xNamed->getName(); pFS->startElementNS( mnXmlNamespace, XML_cNvPr, - XML_id, I32S( nID ), - XML_name, sName.toUtf8(), - FSEND ); + XML_id, OString::number(nID), + XML_name, sName.toUtf8()); OUString sURL; if ( GetProperty( xShapeProps, "URL" ) ) @@ -479,27 +478,23 @@ void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nI mpURLTransformer->isExternalURL(sURL)); mpFS->singleElementNS( XML_a, XML_hlinkClick, - FSNS( XML_r,XML_id ), sRelId.toUtf8(), - FSEND ); + FSNS( XML_r,XML_id ), sRelId.toUtf8() ); } pFS->endElementNS(mnXmlNamespace, XML_cNvPr); - pFS->singleElementNS( mnXmlNamespace, XML_cNvGraphicFramePr, - FSEND ); + pFS->singleElementNS(mnXmlNamespace, XML_cNvGraphicFramePr); if( GetDocumentType() == DOCUMENT_PPTX ) - pFS->singleElementNS( mnXmlNamespace, XML_nvPr, - FSEND ); + pFS->singleElementNS(mnXmlNamespace, XML_nvPr); pFS->endElementNS( mnXmlNamespace, XML_nvGraphicFramePr ); // visual chart properties WriteShapeTransformation( xShape, mnXmlNamespace ); // writer chart object - pFS->startElement( FSNS( XML_a, XML_graphic ), FSEND ); + pFS->startElement(FSNS(XML_a, XML_graphic)); pFS->startElement( FSNS( XML_a, XML_graphicData ), - XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/chart", - FSEND ); + XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/chart" ); OUString sId; const char* sFullPath = nullptr; const char* sRelativePath = nullptr; @@ -552,8 +547,7 @@ void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nI pFS->singleElement( FSNS( XML_c, XML_chart ), FSNS(XML_xmlns, XML_c), pFB->getNamespaceURL(OOX_NS(dmlChart)).toUtf8(), FSNS(XML_xmlns, XML_r), pFB->getNamespaceURL(OOX_NS(officeRel)).toUtf8(), - FSNS(XML_r, XML_id), sId.toUtf8(), - FSEND ); + FSNS(XML_r, XML_id), sId.toUtf8() ); pFS->endElement( FSNS( XML_a, XML_graphicData ) ); pFS->endElement( FSNS( XML_a, XML_graphic ) ); @@ -626,18 +620,13 @@ void ChartExport::exportChartSpace( const Reference< css::chart::XChartDocument FSHelperPtr pFS = GetFS(); XmlFilterBase* pFB = GetFB(); pFS->startElement( FSNS( XML_c, XML_chartSpace ), - FSNS( XML_xmlns, XML_c ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(dmlChart)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_a ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_r ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + FSNS( XML_xmlns, XML_c ), pFB->getNamespaceURL(OOX_NS(dmlChart)).toUtf8(), + FSNS( XML_xmlns, XML_a ), pFB->getNamespaceURL(OOX_NS(dml)).toUtf8(), + FSNS( XML_xmlns, XML_r ), pFB->getNamespaceURL(OOX_NS(officeRel)).toUtf8()); // TODO: get the correct editing language - pFS->singleElement( FSNS( XML_c, XML_lang ), - XML_val, "en-US", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_lang), XML_val, "en-US"); - pFS->singleElement(FSNS( XML_c, XML_roundedCorners), - XML_val, "0", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_roundedCorners), XML_val, "0"); if( !bIncludeTable ) { @@ -703,9 +692,7 @@ void ChartExport::exportExternalData( const Reference< css::chart::XChartDocumen OUString sRelId = GetFB()->addRelation(pFS->getOutputStream(), type, relationPath); - pFS->singleElementNS( XML_c, XML_externalData, - FSNS(XML_r, XML_id), OUStringToOString(sRelId, RTL_TEXTENCODING_UTF8), - FSEND); + pFS->singleElementNS(XML_c, XML_externalData, FSNS(XML_r, XML_id), sRelId.toUtf8()); } } @@ -741,8 +728,7 @@ void ChartExport::exportChart( const Reference< css::chart::XChartDocument >& xC // chart element FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_chart ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_chart)); // title if( bHasMainTitle ) @@ -751,9 +737,7 @@ void ChartExport::exportChart( const Reference< css::chart::XChartDocument >& xC if( xShape.is() ) { exportTitle( xShape ); - pFS->singleElement( FSNS(XML_c, XML_autoTitleDeleted), - XML_val, "0", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_autoTitleDeleted), XML_val, "0"); } } InitPlotArea( ); @@ -765,8 +749,7 @@ void ChartExport::exportChart( const Reference< css::chart::XChartDocument >& xC Reference< beans::XPropertySet > xFloor( mxNewDiagram->getFloor(), uno::UNO_QUERY ); if( xFloor.is() ) { - pFS->startElement( FSNS( XML_c, XML_floor ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_floor)); exportShapeProps( xFloor ); pFS->endElement( FSNS( XML_c, XML_floor ) ); } @@ -777,14 +760,12 @@ void ChartExport::exportChart( const Reference< css::chart::XChartDocument >& xC if( xWall.is() ) { // sideWall - pFS->startElement( FSNS( XML_c, XML_sideWall ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_sideWall)); exportShapeProps( xWall ); pFS->endElement( FSNS( XML_c, XML_sideWall ) ); // backWall - pFS->startElement( FSNS( XML_c, XML_backWall ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_backWall)); exportShapeProps( xWall ); pFS->endElement( FSNS( XML_c, XML_backWall ) ); } @@ -800,9 +781,7 @@ void ChartExport::exportChart( const Reference< css::chart::XChartDocument >& xC uno::Any aPlotVisOnly = xDiagramPropSet->getPropertyValue("IncludeHiddenCells"); bool bIncludeHiddenCells = false; aPlotVisOnly >>= bIncludeHiddenCells; - pFS->singleElement( FSNS( XML_c, XML_plotVisOnly ), - XML_val, ToPsz10(!bIncludeHiddenCells), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_plotVisOnly), XML_val, ToPsz10(!bIncludeHiddenCells)); exportMissingValueTreatment(Reference<beans::XPropertySet>(mxDiagram, uno::UNO_QUERY)); @@ -837,16 +816,13 @@ void ChartExport::exportMissingValueTreatment(const uno::Reference<beans::XPrope } FSHelperPtr pFS = GetFS(); - pFS->singleElement( FSNS(XML_c, XML_dispBlanksAs), - XML_val, pVal, - FSEND); + pFS->singleElement(FSNS(XML_c, XML_dispBlanksAs), XML_val, pVal); } void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& xChartDoc ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_legend ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_legend)); Reference< beans::XPropertySet > xProp( xChartDoc->getLegend(), uno::UNO_QUERY ); if( xProp.is() ) @@ -886,34 +862,24 @@ void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& x if( strPos != nullptr ) { - pFS->singleElement( FSNS( XML_c, XML_legendPos ), - XML_val, strPos, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_legendPos), XML_val, strPos); } uno::Any aRelativePos = xProp->getPropertyValue("RelativePosition"); if (aRelativePos.hasValue()) { - pFS->startElement(FSNS(XML_c, XML_layout), FSEND); - pFS->startElement(FSNS(XML_c, XML_manualLayout), FSEND); + pFS->startElement(FSNS(XML_c, XML_layout)); + pFS->startElement(FSNS(XML_c, XML_manualLayout)); - pFS->singleElement(FSNS(XML_c, XML_xMode), - XML_val, "edge", - FSEND); - pFS->singleElement(FSNS(XML_c, XML_yMode), - XML_val, "edge", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_xMode), XML_val, "edge"); + pFS->singleElement(FSNS(XML_c, XML_yMode), XML_val, "edge"); chart2::RelativePosition aPos = aRelativePos.get<chart2::RelativePosition>(); const double x = aPos.Primary; const double y = aPos.Secondary; - pFS->singleElement(FSNS(XML_c, XML_x), - XML_val, IS(x), - FSEND); - pFS->singleElement(FSNS(XML_c, XML_y), - XML_val, IS(y), - FSEND); + pFS->singleElement(FSNS(XML_c, XML_x), XML_val, OString::number(x)); + pFS->singleElement(FSNS(XML_c, XML_y), XML_val, OString::number(y)); uno::Any aRelativeSize = xProp->getPropertyValue("RelativeSize"); if (aRelativeSize.hasValue()) @@ -923,13 +889,9 @@ void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& x const double w = aSize.Primary; const double h = aSize.Secondary; - pFS->singleElement(FSNS(XML_c, XML_w), - XML_val, IS(w), - FSEND); + pFS->singleElement(FSNS(XML_c, XML_w), XML_val, OString::number(w)); - pFS->singleElement(FSNS(XML_c, XML_h), - XML_val, IS(h), - FSEND); + pFS->singleElement(FSNS(XML_c, XML_h), XML_val, OString::number(h)); } SAL_WARN_IF(aPos.Anchor != css::drawing::Alignment_TOP_LEFT, "oox", "unsupported anchor position"); @@ -940,9 +902,7 @@ void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& x if (strPos != nullptr) { - pFS->singleElement( FSNS( XML_c, XML_overlay ), - XML_val, "0", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_overlay), XML_val, "0"); } // shape properties @@ -969,13 +929,10 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape ) return; FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_title ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_title)); - pFS->startElement( FSNS( XML_c, XML_tx ), - FSEND ); - pFS->startElement( FSNS( XML_c, XML_rich ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_tx)); + pFS->startElement(FSNS(XML_c, XML_rich)); // TODO: bodyPr const char* sWritingMode = nullptr; @@ -989,17 +946,13 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape ) pFS->singleElement( FSNS( XML_a, XML_bodyPr ), XML_vert, sWritingMode, - XML_rot, oox::drawingml::calcRotationValue(nRotation).getStr(), - FSEND ); + XML_rot, oox::drawingml::calcRotationValue(nRotation) ); // TODO: lstStyle - pFS->singleElement( FSNS( XML_a, XML_lstStyle ), - FSEND ); + pFS->singleElement(FSNS(XML_a, XML_lstStyle)); // FIXME: handle multiple paragraphs to parse aText - pFS->startElement( FSNS( XML_a, XML_p ), - FSEND ); + pFS->startElement(FSNS(XML_a, XML_p)); - pFS->startElement( FSNS( XML_a, XML_pPr ), - FSEND ); + pFS->startElement(FSNS(XML_a, XML_pPr)); bool bDummy = false; sal_Int32 nDummy; @@ -1007,12 +960,10 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape ) pFS->endElement( FSNS( XML_a, XML_pPr ) ); - pFS->startElement( FSNS( XML_a, XML_r ), - FSEND ); + pFS->startElement(FSNS(XML_a, XML_r)); bDummy = false; WriteRunProperties( xPropSet, false, XML_rPr, true, bDummy, nDummy ); - pFS->startElement( FSNS( XML_a, XML_t ), - FSEND ); + pFS->startElement(FSNS(XML_a, XML_t)); pFS->writeEscaped( sText ); pFS->endElement( FSNS( XML_a, XML_t ) ); pFS->endElement( FSNS( XML_a, XML_r ) ); @@ -1025,14 +976,10 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape ) uno::Any aManualLayout = xPropSet->getPropertyValue("RelativePosition"); if (aManualLayout.hasValue()) { - pFS->startElement(FSNS( XML_c, XML_layout ), FSEND); - pFS->startElement(FSNS(XML_c, XML_manualLayout), FSEND); - pFS->singleElement(FSNS(XML_c, XML_xMode), - XML_val, "edge", - FSEND); - pFS->singleElement(FSNS(XML_c, XML_yMode), - XML_val, "edge", - FSEND); + pFS->startElement(FSNS(XML_c, XML_layout)); + pFS->startElement(FSNS(XML_c, XML_manualLayout)); + pFS->singleElement(FSNS(XML_c, XML_xMode), XML_val, "edge"); + pFS->singleElement(FSNS(XML_c, XML_yMode), XML_val, "edge"); Reference<embed::XVisualObject> xVisObject(mxChartModel, uno::UNO_QUERY); awt::Size aPageSize = xVisObject->getVisualAreaSize(embed::Aspects::MSOLE_CONTENT); @@ -1042,34 +989,20 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape ) double x = static_cast<double>(aPos2.X) / static_cast<double>(aPageSize.Width); double y = static_cast<double>(aPos2.Y) / static_cast<double>(aPageSize.Height); /* - pFS->singleElement(FSNS(XML_c, XML_wMode), - XML_val, "edge", - FSEND); - pFS->singleElement(FSNS(XML_c, XML_hMode), - XML_val, "edge", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_wMode), XML_val, "edge"); + pFS->singleElement(FSNS(XML_c, XML_hMode), XML_val, "edge"); */ - pFS->singleElement(FSNS(XML_c, XML_x), - XML_val, IS(x), - FSEND); - pFS->singleElement(FSNS(XML_c, XML_y), - XML_val, IS(y), - FSEND); + pFS->singleElement(FSNS(XML_c, XML_x), XML_val, OString::number(x)); + pFS->singleElement(FSNS(XML_c, XML_y), XML_val, OString::number(y)); /* - pFS->singleElement(FSNS(XML_c, XML_w), - XML_val, "", - FSEND); - pFS->singleElement(FSNS(XML_c, XML_h), - XML_val, "", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_w), XML_val, ""); + pFS->singleElement(FSNS(XML_c, XML_h), XML_val, ""); */ pFS->endElement(FSNS(XML_c, XML_manualLayout)); pFS->endElement(FSNS(XML_c, XML_layout)); } - pFS->singleElement( FSNS(XML_c, XML_overlay), - XML_val, "0", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_overlay), XML_val, "0"); // shape properties if( xPropSet.is() ) @@ -1089,8 +1022,7 @@ void ChartExport::exportPlotArea( const Reference< css::chart::XChartDocument >& // plot-area element FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_plotArea ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_plotArea)); Reference<beans::XPropertySet> xWall(mxNewDiagram, uno::UNO_QUERY); if( xWall.is() ) @@ -1233,22 +1165,16 @@ void ChartExport::exportManualLayout(const css::chart2::RelativePosition& rPos, const bool bIsExcludingDiagramPositioning) { FSHelperPtr pFS = GetFS(); - pFS->startElement(FSNS(XML_c, XML_layout), FSEND); - pFS->startElement(FSNS(XML_c, XML_manualLayout), FSEND); + pFS->startElement(FSNS(XML_c, XML_layout)); + pFS->startElement(FSNS(XML_c, XML_manualLayout)); // By default layoutTarget is set to "outer" and we shouldn't save it in that case if ( bIsExcludingDiagramPositioning ) { - pFS->singleElement(FSNS(XML_c, XML_layoutTarget), - XML_val, "inner", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_layoutTarget), XML_val, "inner"); } - pFS->singleElement(FSNS(XML_c, XML_xMode), - XML_val, "edge", - FSEND); - pFS->singleElement(FSNS(XML_c, XML_yMode), - XML_val, "edge", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_xMode), XML_val, "edge"); + pFS->singleElement(FSNS(XML_c, XML_yMode), XML_val, "edge"); double x = rPos.Primary; double y = rPos.Secondary; @@ -1290,21 +1216,13 @@ void ChartExport::exportManualLayout(const css::chart2::RelativePosition& rPos, SAL_WARN("oox", "unhandled alignment case for manual layout export " << static_cast<sal_uInt16>(rPos.Anchor)); } - pFS->singleElement(FSNS(XML_c, XML_x), - XML_val, IS(x), - FSEND); + pFS->singleElement(FSNS(XML_c, XML_x), XML_val, OString::number(x)); - pFS->singleElement(FSNS(XML_c, XML_y), - XML_val, IS(y), - FSEND); + pFS->singleElement(FSNS(XML_c, XML_y), XML_val, OString::number(y)); - pFS->singleElement(FSNS(XML_c, XML_w), - XML_val, IS(w), - FSEND); + pFS->singleElement(FSNS(XML_c, XML_w), XML_val, OString::number(w)); - pFS->singleElement(FSNS(XML_c, XML_h), - XML_val, IS(h), - FSEND); + pFS->singleElement(FSNS(XML_c, XML_h), XML_val, OString::number(h)); pFS->endElement(FSNS(XML_c, XML_manualLayout)); pFS->endElement(FSNS(XML_c, XML_layout)); @@ -1395,7 +1313,7 @@ void ChartExport::exportGradientFill( const Reference< XPropertySet >& xPropSet uno::Any rValue = xGradient->getByName( sFillGradientName ); if( rValue >>= aGradient ) { - mpFS->startElementNS( XML_a, XML_gradFill, FSEND ); + mpFS->startElementNS(XML_a, XML_gradFill); WriteGradientFill( aGradient ); mpFS->endElementNS( XML_a, XML_gradFill ); } @@ -1427,20 +1345,14 @@ void ChartExport::exportDataTable( ) if (bShowVBorder || bShowHBorder || bShowOutline) { - pFS->startElement( FSNS( XML_c, XML_dTable), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_dTable)); if (bShowHBorder) pFS->singleElement( FSNS( XML_c, XML_showHorzBorder ), - XML_val, "1", - FSEND ); + XML_val, "1" ); if (bShowVBorder) - pFS->singleElement( FSNS( XML_c, XML_showVertBorder ), - XML_val, "1", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_showVertBorder), XML_val, "1"); if (bShowOutline) - pFS->singleElement( FSNS( XML_c, XML_showOutline ), - XML_val, "1", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_showOutline), XML_val, "1"); pFS->endElement( FSNS( XML_c, XML_dTable)); } @@ -1452,8 +1364,7 @@ void ChartExport::exportAreaChart( const Reference< chart2::XChartType >& xChart sal_Int32 nTypeId = XML_areaChart; if( mbIs3DChart ) nTypeId = XML_area3DChart; - pFS->startElement( FSNS( XML_c, nTypeId ), - FSEND ); + pFS->startElement(FSNS(XML_c, nTypeId)); exportGrouping( ); bool bPrimaryAxes = true; @@ -1469,8 +1380,7 @@ void ChartExport::exportBarChart( const Reference< chart2::XChartType >& xChartT if( mbIs3DChart ) nTypeId = XML_bar3DChart; FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, nTypeId ), - FSEND ); + pFS->startElement(FSNS(XML_c, nTypeId)); // bar direction bool bVertical = false; Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY); @@ -1478,9 +1388,7 @@ void ChartExport::exportBarChart( const Reference< chart2::XChartType >& xChartT mAny >>= bVertical; const char* bardir = bVertical? "bar":"col"; - pFS->singleElement( FSNS( XML_c, XML_barDir ), - XML_val, bardir, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_barDir), XML_val, bardir); exportGrouping( true ); @@ -1498,9 +1406,7 @@ void ChartExport::exportBarChart( const Reference< chart2::XChartType >& xChartT if( aBarPositionSequence.getLength() ) { sal_Int32 nGapWidth = aBarPositionSequence[0]; - pFS->singleElement( FSNS( XML_c, XML_gapWidth ), - XML_val, I32S( nGapWidth ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_gapWidth), XML_val, OString::number(nGapWidth)); } } @@ -1527,9 +1433,7 @@ void ChartExport::exportBarChart( const Reference< chart2::XChartType >& xChartT sShapeType = "pyramid"; break; } - pFS->singleElement( FSNS( XML_c, XML_shape ), - XML_val, sShapeType, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_shape), XML_val, sShapeType); } //overlap @@ -1548,15 +1452,11 @@ void ChartExport::exportBarChart( const Reference< chart2::XChartType >& xChartT if( ( mbStacked || mbPercent ) && nOverlap != 100 ) { nOverlap = 100; - pFS->singleElement( FSNS( XML_c, XML_overlap ), - XML_val, I32S( nOverlap ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_overlap), XML_val, OString::number(nOverlap)); } else // Normal bar chart { - pFS->singleElement( FSNS( XML_c, XML_overlap ), - XML_val, I32S( nOverlap ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_overlap), XML_val, OString::number(nOverlap)); } } } @@ -1569,17 +1469,14 @@ void ChartExport::exportBarChart( const Reference< chart2::XChartType >& xChartT void ChartExport::exportBubbleChart( const Reference< chart2::XChartType >& xChartType ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_bubbleChart ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_bubbleChart)); exportVaryColors(xChartType); bool bPrimaryAxes = true; exportAllSeries(xChartType, bPrimaryAxes); - pFS->singleElement(FSNS(XML_c, XML_bubble3D), - XML_val, "0", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_bubble3D), XML_val, "0"); exportAxesId(bPrimaryAxes); @@ -1589,8 +1486,7 @@ void ChartExport::exportBubbleChart( const Reference< chart2::XChartType >& xCha void ChartExport::exportDoughnutChart( const Reference< chart2::XChartType >& xChartType ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_doughnutChart ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_doughnutChart)); exportVaryColors(xChartType); @@ -1599,9 +1495,7 @@ void ChartExport::exportDoughnutChart( const Reference< chart2::XChartType >& xC // firstSliceAng exportFirstSliceAng( ); //FIXME: holeSize - pFS->singleElement( FSNS( XML_c, XML_holeSize ), - XML_val, I32S( 50 ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_holeSize), XML_val, OString::number(50)); pFS->endElement( FSNS( XML_c, XML_doughnutChart ) ); } @@ -1676,8 +1570,7 @@ void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChart sal_Int32 nTypeId = XML_lineChart; if( mbIs3DChart ) nTypeId = XML_line3DChart; - pFS->startElement( FSNS( XML_c, nTypeId ), - FSEND ); + pFS->startElement(FSNS(XML_c, nTypeId)); exportGrouping( ); @@ -1697,9 +1590,7 @@ void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChart exportHiLowLines(); exportUpDownBars(xChartType); const char* marker = nSymbolType == css::chart::ChartSymbolType::NONE? "0":"1"; - pFS->singleElement( FSNS( XML_c, XML_marker ), - XML_val, marker, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_marker), XML_val, marker); } exportAxesId(bPrimaryAxes, true); @@ -1720,8 +1611,7 @@ void ChartExport::exportPieChart( const Reference< chart2::XChartType >& xChartT sal_Int32 nTypeId = XML_pieChart; if( mbIs3DChart ) nTypeId = XML_pie3DChart; - pFS->startElement( FSNS( XML_c, nTypeId ), - FSEND ); + pFS->startElement(FSNS(XML_c, nTypeId)); exportVaryColors(xChartType); @@ -1740,8 +1630,7 @@ void ChartExport::exportPieChart( const Reference< chart2::XChartType >& xChartT void ChartExport::exportRadarChart( const Reference< chart2::XChartType >& xChartType) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_radarChart ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_radarChart)); // radarStyle sal_Int32 eChartType = getChartType( ); @@ -1750,9 +1639,7 @@ void ChartExport::exportRadarChart( const Reference< chart2::XChartType >& xChar radarStyle = "filled"; else radarStyle = "marker"; - pFS->singleElement( FSNS( XML_c, XML_radarStyle ), - XML_val, radarStyle, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_radarStyle), XML_val, radarStyle); exportVaryColors(xChartType); bool bPrimaryAxes = true; @@ -1766,8 +1653,7 @@ void ChartExport::exportScatterChartSeries( const Reference< chart2::XChartType css::uno::Sequence<css::uno::Reference<chart2::XDataSeries>>* pSeries) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_scatterChart ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_scatterChart)); // TODO:scatterStyle sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE; @@ -1781,9 +1667,7 @@ void ChartExport::exportScatterChartSeries( const Reference< chart2::XChartType scatterStyle = "line"; } - pFS->singleElement( FSNS( XML_c, XML_scatterStyle ), - XML_val, scatterStyle, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_scatterStyle), XML_val, scatterStyle); exportVaryColors(xChartType); // FIXME: should export xVal and yVal @@ -1815,8 +1699,7 @@ void ChartExport::exportScatterChart( const Reference< chart2::XChartType >& xCh void ChartExport::exportStockChart( const Reference< chart2::XChartType >& xChartType ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_stockChart ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_stockChart)); bool bPrimaryAxes = true; Reference< chart2::XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY ); @@ -1849,8 +1732,7 @@ void ChartExport::exportHiLowLines() if( !xStockPropSet.is() ) return; - pFS->startElement( FSNS( XML_c, XML_hiLowLines ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_hiLowLines)); exportShapeProps( xStockPropSet ); pFS->endElement( FSNS( XML_c, XML_hiLowLines ) ); } @@ -1866,18 +1748,14 @@ void ChartExport::exportUpDownBars( const Reference< chart2::XChartType >& xChar if(xChartPropProvider.is()) { // updownbar - pFS->startElement( FSNS( XML_c, XML_upDownBars ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_upDownBars)); // TODO: gapWidth - pFS->singleElement( FSNS( XML_c, XML_gapWidth ), - XML_val, I32S( 150 ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_gapWidth), XML_val, OString::number(150)); Reference< beans::XPropertySet > xChartPropSet = xChartPropProvider->getUpBar(); if( xChartPropSet.is() ) { - pFS->startElement( FSNS( XML_c, XML_upBars ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_upBars)); // For Linechart with UpDownBars, spPr is not getting imported // so no need to call the exportShapeProps() for LineChart if(xChartType->getChartType() == "com.sun.star.chart2.CandleStickChartType") @@ -1889,8 +1767,7 @@ void ChartExport::exportUpDownBars( const Reference< chart2::XChartType >& xChar xChartPropSet = xChartPropProvider->getDownBar(); if( xChartPropSet.is() ) { - pFS->startElement( FSNS( XML_c, XML_downBars ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_downBars)); if(xChartType->getChartType() == "com.sun.star.chart2.CandleStickChartType") { exportShapeProps(xChartPropSet); @@ -1907,8 +1784,7 @@ void ChartExport::exportSurfaceChart( const Reference< chart2::XChartType >& xCh sal_Int32 nTypeId = XML_surfaceChart; if( mbIs3DChart ) nTypeId = XML_surface3DChart; - pFS->startElement( FSNS( XML_c, nTypeId ), - FSEND ); + pFS->startElement(FSNS(XML_c, nTypeId)); exportVaryColors(xChartType); bool bPrimaryAxes = true; exportAllSeries(xChartType, bPrimaryAxes); @@ -1958,15 +1834,11 @@ void ChartExport::exportVaryColors(const Reference<chart2::XChartType>& xChartTy Any aAnyVaryColors = xDataSeriesProps->getPropertyValue("VaryColorsByPoint"); bool bVaryColors = false; aAnyVaryColors >>= bVaryColors; - pFS->singleElement(FSNS(XML_c, XML_varyColors), - XML_val, bVaryColors ? "1": "0", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_varyColors), XML_val, ToPsz10(bVaryColors)); } catch (...) { - pFS->singleElement(FSNS(XML_c, XML_varyColors), - XML_val, "0", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_varyColors), XML_val, "0"); } } @@ -2020,16 +1892,13 @@ void ChartExport::exportSeries( const Reference<chart2::XChartType>& xChartType, { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_ser ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_ser)); // TODO: idx and order pFS->singleElement( FSNS( XML_c, XML_idx ), - XML_val, I32S(mnSeriesCount), - FSEND ); + XML_val, OString::number(mnSeriesCount) ); pFS->singleElement( FSNS( XML_c, XML_order ), - XML_val, I32S(mnSeriesCount++), - FSEND ); + XML_val, OString::number(mnSeriesCount++) ); // export label if( xLabelSeq.is() ) @@ -2057,9 +1926,7 @@ void ChartExport::exportSeries( const Reference<chart2::XChartType>& xChartType, case chart::TYPEID_HORBAR: case chart::TYPEID_BAR: { - pFS->singleElement(FSNS(XML_c, XML_invertIfNegative), - XML_val, "0", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_invertIfNegative), XML_val, "0"); } break; case chart::TYPEID_LINE: @@ -2075,8 +1942,7 @@ void ChartExport::exportSeries( const Reference<chart2::XChartType>& xChartType, sal_Int32 nOffset = 0; mAny >>= nOffset; pFS->singleElement( FSNS( XML_c, XML_explosion ), - XML_val, I32S( nOffset ), - FSEND ); + XML_val, OString::number( nOffset ) ); } break; } @@ -2199,17 +2065,14 @@ void ChartExport::exportCandleStickSeries( Reference< chart2::data::XDataSequence > xValueSeq( xLabeledSeq->getValues()); { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_ser ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_ser)); // TODO: idx and order // idx attribute should start from 1 and not from 0. pFS->singleElement( FSNS( XML_c, XML_idx ), - XML_val, I32S(idx+1), - FSEND ); + XML_val, OString::number(idx+1) ); pFS->singleElement( FSNS( XML_c, XML_order ), - XML_val, I32S(idx+1), - FSEND ); + XML_val, OString::number(idx+1) ); // export label if( xLabelSeq.is() ) @@ -2236,30 +2099,21 @@ void ChartExport::exportCandleStickSeries( void ChartExport::exportSeriesText( const Reference< chart2::data::XDataSequence > & xValueSeq ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_tx ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_tx)); OUString aCellRange = xValueSeq->getSourceRangeRepresentation(); aCellRange = parseFormula( aCellRange ); - pFS->startElement( FSNS( XML_c, XML_strRef ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_strRef)); - pFS->startElement( FSNS( XML_c, XML_f ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_f)); pFS->writeEscaped( aCellRange ); pFS->endElement( FSNS( XML_c, XML_f ) ); OUString aLabelString = lcl_getLabelString( xValueSeq ); - pFS->startElement( FSNS( XML_c, XML_strCache ), - FSEND ); - pFS->singleElement( FSNS( XML_c, XML_ptCount ), - XML_val, "1", - FSEND ); - pFS->startElement( FSNS( XML_c, XML_pt ), - XML_idx, "0", - FSEND ); - pFS->startElement( FSNS( XML_c, XML_v ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_strCache)); + pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, "1"); + pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, "0"); + pFS->startElement(FSNS(XML_c, XML_v)); pFS->writeEscaped( aLabelString ); pFS->endElement( FSNS( XML_c, XML_v ) ); pFS->endElement( FSNS( XML_c, XML_pt ) ); @@ -2271,35 +2125,26 @@ void ChartExport::exportSeriesText( const Reference< chart2::data::XDataSequence void ChartExport::exportSeriesCategory( const Reference< chart2::data::XDataSequence > & xValueSeq ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_cat ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_cat)); OUString aCellRange = xValueSeq.is() ? xValueSeq->getSourceRangeRepresentation() : OUString(); aCellRange = parseFormula( aCellRange ); // TODO: need to handle XML_multiLvlStrRef according to aCellRange - pFS->startElement( FSNS( XML_c, XML_strRef ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_strRef)); - pFS->startElement( FSNS( XML_c, XML_f ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_f)); pFS->writeEscaped( aCellRange ); pFS->endElement( FSNS( XML_c, XML_f ) ); ::std::vector< OUString > aCategories; lcl_fillCategoriesIntoStringVector( xValueSeq, aCategories ); sal_Int32 ptCount = aCategories.size(); - pFS->startElement( FSNS( XML_c, XML_strCache ), - FSEND ); - pFS->singleElement( FSNS( XML_c, XML_ptCount ), - XML_val, I32S( ptCount ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_strCache)); + pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, OString::number(ptCount)); for( sal_Int32 i = 0; i < ptCount; i++ ) { - pFS->startElement( FSNS( XML_c, XML_pt ), - XML_idx, I32S( i ), - FSEND ); - pFS->startElement( FSNS( XML_c, XML_v ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, OString::number(i)); + pFS->startElement(FSNS(XML_c, XML_v)); pFS->writeEscaped( aCategories[i] ); pFS->endElement( FSNS( XML_c, XML_v ) ); pFS->endElement( FSNS( XML_c, XML_pt ) ); @@ -2313,32 +2158,25 @@ void ChartExport::exportSeriesCategory( const Reference< chart2::data::XDataSequ void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequence > & xValueSeq, sal_Int32 nValueType ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, nValueType ), - FSEND ); + pFS->startElement(FSNS(XML_c, nValueType)); OUString aCellRange = xValueSeq.is() ? xValueSeq->getSourceRangeRepresentation() : OUString(); aCellRange = parseFormula( aCellRange ); // TODO: need to handle XML_multiLvlStrRef according to aCellRange - pFS->startElement( FSNS( XML_c, XML_numRef ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_numRef)); - pFS->startElement( FSNS( XML_c, XML_f ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_f)); pFS->writeEscaped( aCellRange ); pFS->endElement( FSNS( XML_c, XML_f ) ); ::std::vector< double > aValues = lcl_getAllValuesFromSequence( xValueSeq ); sal_Int32 ptCount = aValues.size(); - pFS->startElement( FSNS( XML_c, XML_numCache ), - FSEND ); - pFS->startElement( FSNS( XML_c, XML_formatCode ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_numCache)); + pFS->startElement(FSNS(XML_c, XML_formatCode)); // TODO: what format code? pFS->writeEscaped( "General" ); pFS->endElement( FSNS( XML_c, XML_formatCode ) ); - pFS->singleElement( FSNS( XML_c, XML_ptCount ), - XML_val, I32S( ptCount ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, OString::number(ptCount)); bool bIsNumberValue = true; bool bXSeriesValue = false; @@ -2349,11 +2187,8 @@ void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequen for( sal_Int32 i = 0; i < ptCount; i++ ) { - pFS->startElement( FSNS( XML_c, XML_pt ), - XML_idx, I32S( i ), - FSEND ); - pFS->startElement( FSNS( XML_c, XML_v ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, OString::number(i)); + pFS->startElement(FSNS(XML_c, XML_v)); if (bIsNumberValue && !rtl::math::isNan(aValues[i])) pFS->write( aValues[i] ); else if(bXSeriesValue) @@ -2375,8 +2210,7 @@ void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequen void ChartExport::exportShapeProps( const Reference< XPropertySet >& xPropSet ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_spPr ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_spPr)); exportFill( xPropSet ); WriteOutline( xPropSet, getModel() ); @@ -2387,7 +2221,7 @@ void ChartExport::exportShapeProps( const Reference< XPropertySet >& xPropSet ) void ChartExport::exportTextProps(const Reference<XPropertySet>& xPropSet) { FSHelperPtr pFS = GetFS(); - pFS->startElement(FSNS(XML_c, XML_txPr), FSEND); + pFS->startElement(FSNS(XML_c, XML_txPr)); sal_Int32 nRotation = 0; if (auto xServiceInfo = uno::Reference<lang::XServiceInfo>(xPropSet, uno::UNO_QUERY)) @@ -2425,14 +2259,14 @@ void ChartExport::exportTextProps(const Reference<XPropertySet>& xPropSet) } if (nRotation) - pFS->singleElement(FSNS(XML_a, XML_bodyPr), XML_rot, I32S(nRotation), FSEND); + pFS->singleElement(FSNS(XML_a, XML_bodyPr), XML_rot, OString::number(nRotation)); else - pFS->singleElement(FSNS(XML_a, XML_bodyPr), FSEND); + pFS->singleElement(FSNS(XML_a, XML_bodyPr)); - pFS->singleElement( FSNS( XML_a, XML_lstStyle ), FSEND ); + pFS->singleElement(FSNS(XML_a, XML_lstStyle)); - pFS->startElement(FSNS(XML_a, XML_p), FSEND); - pFS->startElement(FSNS(XML_a, XML_pPr), FSEND); + pFS->startElement(FSNS(XML_a, XML_p)); + pFS->startElement(FSNS(XML_a, XML_pPr)); WriteRunProperties(xPropSet, false, XML_defRPr, true, o3tl::temporary(false), o3tl::temporary(sal_Int32())); @@ -2642,14 +2476,10 @@ void ChartExport::_exportAxis( const AxisIdPair& rAxisIdPair ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, nAxisType ), - FSEND ); - pFS->singleElement( FSNS( XML_c, XML_axId ), - XML_val, I32S( rAxisIdPair.nAxisId ), - FSEND ); + pFS->startElement(FSNS(XML_c, nAxisType)); + pFS->singleElement(FSNS(XML_c, XML_axId), XML_val, OString::number(rAxisIdPair.nAxisId)); - pFS->startElement( FSNS( XML_c, XML_scaling ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_scaling)); // logBase, min, max if(GetProperty( xAxisProp, "Logarithmic" ) ) @@ -2659,9 +2489,7 @@ void ChartExport::_exportAxis( if( bLogarithmic ) { // default value is 10? - pFS->singleElement( FSNS( XML_c, XML_logBase ), - XML_val, I32S( 10 ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_logBase), XML_val, OString::number(10)); } } @@ -2671,9 +2499,7 @@ void ChartExport::_exportAxis( mAny >>= bReverseDirection; const char* orientation = bReverseDirection ? "maxMin":"minMax"; - pFS->singleElement( FSNS( XML_c, XML_orientation ), - XML_val, orientation, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_orientation), XML_val, orientation); bool bAutoMax = false; if(GetProperty( xAxisProp, "AutoMax" ) ) @@ -2683,9 +2509,7 @@ void ChartExport::_exportAxis( { double dMax = 0; mAny >>= dMax; - pFS->singleElement( FSNS( XML_c, XML_max ), - XML_val, IS( dMax ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_max), XML_val, OString::number(dMax)); } bool bAutoMin = false; @@ -2696,9 +2520,7 @@ void ChartExport::_exportAxis( { double dMin = 0; mAny >>= dMin; - pFS->singleElement( FSNS( XML_c, XML_min ), - XML_val, IS( dMin ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_min), XML_val, OString::number(dMin)); } pFS->endElement( FSNS( XML_c, XML_scaling ) ); @@ -2715,19 +2537,14 @@ void ChartExport::_exportAxis( if (!bDeleted) maExportedAxis.insert(rAxisIdPair.nAxisType); - pFS->singleElement( FSNS( XML_c, XML_delete ), - XML_val, !bDeleted && bVisible ? "0" : "1", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_delete), XML_val, !bDeleted && bVisible ? "0" : "1"); // FIXME: axPos, need to check the property "ReverseDirection" - pFS->singleElement( FSNS( XML_c, XML_axPos ), - XML_val, sAxisPos, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_axPos), XML_val, sAxisPos); // major grid line if( xMajorGrid.is()) { - pFS->startElement( FSNS( XML_c, XML_majorGridlines ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_majorGridlines)); exportShapeProps( xMajorGrid ); pFS->endElement( FSNS( XML_c, XML_majorGridlines ) ); } @@ -2735,8 +2552,7 @@ void ChartExport::_exportAxis( // minor grid line if( xMinorGrid.is()) { - pFS->startElement( FSNS( XML_c, XML_minorGridlines ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_minorGridlines)); exportShapeProps( xMinorGrid ); pFS->endElement( FSNS( XML_c, XML_minorGridlines ) ); } @@ -2760,8 +2576,7 @@ void ChartExport::_exportAxis( OString sNumberFormatString = OUStringToOString(aNumberFormatString, RTL_TEXTENCODING_UTF8); pFS->singleElement(FSNS(XML_c, XML_numFmt), XML_formatCode, sNumberFormatString.getStr(), - XML_sourceLinked, bLinkedNumFmt ? "1" : "0", - FSEND); + XML_sourceLinked, bLinkedNumFmt ? "1" : "0"); // majorTickMark sal_Int32 nValue = 0; @@ -2779,9 +2594,7 @@ void ChartExport::_exportAxis( majorTickMark = "out"; else majorTickMark = "none"; - pFS->singleElement( FSNS( XML_c, XML_majorTickMark ), - XML_val, majorTickMark, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_majorTickMark), XML_val, majorTickMark); } // minorTickMark if(GetProperty( xAxisProp, "HelpMarks" ) ) @@ -2798,9 +2611,7 @@ void ChartExport::_exportAxis( minorTickMark = "out"; else minorTickMark = "none"; - pFS->singleElement( FSNS( XML_c, XML_minorTickMark ), - XML_val, minorTickMark, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_minorTickMark), XML_val, minorTickMark); } // tickLblPos const char* sTickLblPos = nullptr; @@ -2832,18 +2643,14 @@ void ChartExport::_exportAxis( { sTickLblPos = "none"; } - pFS->singleElement( FSNS( XML_c, XML_tickLblPos ), - XML_val, sTickLblPos, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_tickLblPos), XML_val, sTickLblPos); // shape properties exportShapeProps( xAxisProp ); exportTextProps(xAxisProp); - pFS->singleElement( FSNS( XML_c, XML_crossAx ), - XML_val, I32S( rAxisIdPair.nCrossAx ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_crossAx), XML_val, OString::number(rAxisIdPair.nCrossAx)); // crosses & crossesAt bool bCrossesValue = false; @@ -2874,17 +2681,13 @@ void ChartExport::_exportAxis( { double dValue = 0; mAny >>= dValue; - pFS->singleElement( FSNS( XML_c, XML_crossesAt ), - XML_val, IS( dValue ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_crossesAt), XML_val, OString::number(dValue)); } else { if(sCrosses) { - pFS->singleElement(FSNS(XML_c, XML_crosses), - XML_val, sCrosses, - FSEND); + pFS->singleElement(FSNS(XML_c, XML_crosses), XML_val, sCrosses); } } @@ -2893,23 +2696,17 @@ void ChartExport::_exportAxis( { // FIXME: seems not support? use default value, const char* const isAuto = "1"; - pFS->singleElement( FSNS( XML_c, XML_auto ), - XML_val, isAuto, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_auto), XML_val, isAuto); if( nAxisType == XML_catAx ) { // FIXME: seems not support? lblAlgn const char* const sLblAlgn = "ctr"; - pFS->singleElement( FSNS( XML_c, XML_lblAlgn ), - XML_val, sLblAlgn, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_lblAlgn), XML_val, sLblAlgn); } // FIXME: seems not support? lblOffset - pFS->singleElement( FSNS( XML_c, XML_lblOffset ), - XML_val, I32S( 100 ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_lblOffset), XML_val, OString::number(100)); } // TODO: MSO does not support random axis cross position for @@ -2919,9 +2716,7 @@ void ChartExport::_exportAxis( sal_Int32 nChartType = getChartType(); if (nAxisType == XML_valAx && (nChartType == chart::TYPEID_LINE || nChartType == chart::TYPEID_SCATTER)) { - pFS->singleElement( FSNS( XML_c, XML_crossBetween ), - XML_val, "midCat", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_crossBetween), XML_val, "midCat"); } // majorUnit @@ -2933,9 +2728,7 @@ void ChartExport::_exportAxis( { double dMajorUnit = 0; mAny >>= dMajorUnit; - pFS->singleElement( FSNS( XML_c, XML_majorUnit ), - XML_val, IS( dMajorUnit ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_majorUnit), XML_val, OString::number(dMajorUnit)); } // minorUnit bool bAutoStepHelp = false; @@ -2956,8 +2749,7 @@ void ChartExport::_exportAxis( if( dMinorUnitCount != 5 ) { pFS->singleElement( FSNS( XML_c, XML_minorUnit ), - XML_val, IS( dMinorUnit ), - FSEND ); + XML_val, OString::number( dMinorUnit ) ); } } } @@ -2974,15 +2766,11 @@ void ChartExport::_exportAxis( mAny >>= aVal; if(!aVal.isEmpty()) { - pFS->startElement( FSNS( XML_c, XML_dispUnits ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_dispUnits)); - OString aBuiltInUnit = OUStringToOString(aVal, RTL_TEXTENCODING_UTF8); - pFS->singleElement( FSNS( XML_c, XML_builtInUnit ), - XML_val, aBuiltInUnit.getStr(), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_builtInUnit), XML_val, aVal.toUtf8()); - pFS->singleElement(FSNS( XML_c, XML_dispUnitsLbl ),FSEND); + pFS->singleElement(FSNS( XML_c, XML_dispUnitsLbl )); pFS->endElement( FSNS( XML_c, XML_dispUnits ) ); } } @@ -3071,14 +2859,14 @@ void writeRunProperties( ChartExport* pChartExport, Reference<XPropertySet> cons void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport, const Sequence<Reference<chart2::XDataPointCustomLabelField>>& rCustomLabelFields ) { - pFS->startElement(FSNS(XML_c, XML_tx), FSEND); - pFS->startElement(FSNS(XML_c, XML_rich), FSEND); + pFS->startElement(FSNS(XML_c, XML_tx)); + pFS->startElement(FSNS(XML_c, XML_rich)); // TODO: body properties? - pFS->singleElement(FSNS(XML_a, XML_bodyPr), FSEND); + pFS->singleElement(FSNS(XML_a, XML_bodyPr)); OUString sFieldType; - pFS->startElement(FSNS(XML_a, XML_p), FSEND); + pFS->startElement(FSNS(XML_a, XML_p)); for (auto& rField : rCustomLabelFields) { @@ -3095,17 +2883,17 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport, if (bNewParagraph) { pFS->endElement(FSNS(XML_a, XML_p)); - pFS->startElement(FSNS(XML_a, XML_p), FSEND); + pFS->startElement(FSNS(XML_a, XML_p)); continue; } if (sFieldType.isEmpty()) { // Normal text run - pFS->startElement(FSNS(XML_a, XML_r), FSEND); + pFS->startElement(FSNS(XML_a, XML_r)); writeRunProperties(pChartExport, xPropertySet); - pFS->startElement(FSNS(XML_a, XML_t), FSEND); + pFS->startElement(FSNS(XML_a, XML_t)); pFS->writeEscaped(rField->getString()); pFS->endElement(FSNS(XML_a, XML_t)); @@ -3115,10 +2903,10 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport, { // Field pFS->startElement(FSNS(XML_a, XML_fld), XML_id, rField->getGuid().toUtf8(), XML_type, - sFieldType.toUtf8(), FSEND); + sFieldType.toUtf8()); writeRunProperties(pChartExport, xPropertySet); - pFS->startElement(FSNS(XML_a, XML_t), FSEND); + pFS->startElement(FSNS(XML_a, XML_t)); pFS->writeEscaped(rField->getString()); pFS->endElement(FSNS(XML_a, XML_t)); @@ -3149,14 +2937,15 @@ void writeLabelProperties( const FSHelperPtr& pFS, ChartExport* pChartExport, if (nLabelBorderWidth > 0) { - pFS->startElement(FSNS(XML_c, XML_spPr), FSEND); - pFS->startElement(FSNS(XML_a, XML_ln), XML_w, IS(convertHmmToEmu(nLabelBorderWidth)), FSEND); + pFS->startElement(FSNS(XML_c, XML_spPr)); + pFS->startElement(FSNS(XML_a, XML_ln), XML_w, + OString::number(convertHmmToEmu(nLabelBorderWidth))); if (nLabelBorderColor != -1) { - pFS->startElement(FSNS(XML_a, XML_solidFill), FSEND); + pFS->startElement(FSNS(XML_a, XML_solidFill)); OString aStr = OString::number(nLabelBorderColor, 16).toAsciiUpperCase(); - pFS->singleElement(FSNS(XML_a, XML_srgbClr), XML_val, aStr.getStr(), FSEND); + pFS->singleElement(FSNS(XML_a, XML_srgbClr), XML_val, aStr); pFS->endElement(FSNS(XML_a, XML_solidFill)); } @@ -3174,15 +2963,15 @@ void writeLabelProperties( const FSHelperPtr& pFS, ChartExport* pChartExport, { if (!rLabelParam.maAllowedValues.count(nLabelPlacement)) nLabelPlacement = rLabelParam.meDefault; - pFS->singleElement(FSNS(XML_c, XML_dLblPos), XML_val, toOOXMLPlacement(nLabelPlacement), FSEND); + pFS->singleElement(FSNS(XML_c, XML_dLblPos), XML_val, toOOXMLPlacement(nLabelPlacement)); } } - pFS->singleElement(FSNS(XML_c, XML_showLegendKey), XML_val, ToPsz10(aLabel.ShowLegendSymbol), FSEND); - pFS->singleElement(FSNS(XML_c, XML_showVal), XML_val, ToPsz10(aLabel.ShowNumber), FSEND); - pFS->singleElement(FSNS(XML_c, XML_showCatName), XML_val, ToPsz10(aLabel.ShowCategoryName), FSEND); - pFS->singleElement(FSNS(XML_c, XML_showSerName), XML_val, ToPsz10(false), FSEND); - pFS->singleElement(FSNS(XML_c, XML_showPercent), XML_val, ToPsz10(aLabel.ShowNumberInPercent), FSEND); + pFS->singleElement(FSNS(XML_c, XML_showLegendKey), XML_val, ToPsz10(aLabel.ShowLegendSymbol)); + pFS->singleElement(FSNS(XML_c, XML_showVal), XML_val, ToPsz10(aLabel.ShowNumber)); + pFS->singleElement(FSNS(XML_c, XML_showCatName), XML_val, ToPsz10(aLabel.ShowCategoryName)); + pFS->singleElement(FSNS(XML_c, XML_showSerName), XML_val, ToPsz10(false)); + pFS->singleElement(FSNS(XML_c, XML_showPercent), XML_val, ToPsz10(aLabel.ShowNumberInPercent)); // Export the text "separator" if exists uno::Any aAny = xPropSet->getPropertyValue("LabelSeparator"); @@ -3190,7 +2979,7 @@ void writeLabelProperties( const FSHelperPtr& pFS, ChartExport* pChartExport, { OUString nLabelSeparator; aAny >>= nLabelSeparator; - pFS->startElement( FSNS( XML_c, XML_separator ), FSEND ); + pFS->startElement(FSNS(XML_c, XML_separator)); pFS->writeEscaped( nLabelSeparator ); pFS->endElement( FSNS( XML_c, XML_separator ) ); } @@ -3209,7 +2998,7 @@ void ChartExport::exportDataLabels( return; FSHelperPtr pFS = GetFS(); - pFS->startElement(FSNS(XML_c, XML_dLbls), FSEND); + pFS->startElement(FSNS(XML_c, XML_dLbls)); bool bLinkedNumFmt = true; if (GetProperty(xPropSet, "LinkNumberFormatToSource")) @@ -3224,9 +3013,8 @@ void ChartExport::exportDataLabels( OString sNumberFormatString = OUStringToOString(aNumberFormatString, RTL_TEXTENCODING_UTF8); pFS->singleElement(FSNS(XML_c, XML_numFmt), - XML_formatCode, sNumberFormatString.getStr(), - XML_sourceLinked, bLinkedNumFmt ? "1" : "0", - FSEND); + XML_formatCode, sNumberFormatString, + XML_sourceLinked, ToPsz10(bLinkedNumFmt)); } uno::Sequence<sal_Int32> aAttrLabelIndices; @@ -3291,8 +3079,8 @@ void ChartExport::exportDataLabels( if (!xLabelPropSet.is()) continue; - pFS->startElement(FSNS(XML_c, XML_dLbl), FSEND); - pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, I32S(nIdx), FSEND); + pFS->startElement(FSNS(XML_c, XML_dLbl)); + pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, OString::number(nIdx)); if (GetProperty(xLabelPropSet, "NumberFormat") || GetProperty(xLabelPropSet, "PercentageNumberFormat")) { @@ -3303,7 +3091,7 @@ void ChartExport::exportDataLabels( OString sNumberFormatString = OUStringToOString(aNumberFormatString, RTL_TEXTENCODING_UTF8); pFS->singleElement(FSNS(XML_c, XML_numFmt), XML_formatCode, sNumberFormatString.getStr(), - XML_sourceLinked, bLinkedNumFmt ? "1" : "0", FSEND); + XML_sourceLinked, ToPsz10(bLinkedNumFmt)); } // Individual label property that overwrites the baseline. @@ -3316,9 +3104,7 @@ void ChartExport::exportDataLabels( // Baseline label properties for all labels. writeLabelProperties(pFS, this, xPropSet, aParam); - pFS->singleElement(FSNS(XML_c, XML_showLeaderLines), - XML_val, "0", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_showLeaderLines), XML_val, "0"); pFS->endElement(FSNS(XML_c, XML_dLbls)); } @@ -3373,11 +3159,8 @@ void ChartExport::exportDataPoints( if( xPropSet.is() ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_dPt ), - FSEND ); - pFS->singleElement( FSNS( XML_c, XML_idx ), - XML_val, I32S(nElement), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_dPt)); + pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, OString::number(nElement)); switch (eChartType) { @@ -3390,8 +3173,7 @@ void ChartExport::exportDataPoints( mAny >>= nOffset; if (nOffset) pFS->singleElement( FSNS( XML_c, XML_explosion ), - XML_val, I32S( nOffset ), - FSEND ); + XML_val, OString::number( nOffset ) ); } break; } @@ -3431,11 +3213,8 @@ void ChartExport::exportDataPoints( if( xPropSet.is() ) { FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_dPt ), - FSEND ); - pFS->singleElement( FSNS( XML_c, XML_idx ), - XML_val, I32S(nElement), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_dPt)); + pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, OString::number(nElement)); switch( eChartType ) { @@ -3443,9 +3222,7 @@ void ChartExport::exportDataPoints( case chart::TYPEID_HORBAR: case chart::TYPEID_BAR: { - pFS->singleElement(FSNS(XML_c, XML_invertIfNegative), - XML_val, "0", - FSEND); + pFS->singleElement(FSNS(XML_c, XML_invertIfNegative), XML_val, "0"); } break; } @@ -3484,12 +3261,8 @@ void ChartExport::exportAxesId(bool bPrimaryAxes, bool bCheckCombinedAxes) maAxes.emplace_back( eYAxis, nAxisIdy, nAxisIdx ); } FSHelperPtr pFS = GetFS(); - pFS->singleElement( FSNS( XML_c, XML_axId ), - XML_val, I32S( nAxisIdx ), - FSEND ); - pFS->singleElement( FSNS( XML_c, XML_axId ), - XML_val, I32S( nAxisIdy ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_axId), XML_val, OString::number(nAxisIdx)); + pFS->singleElement(FSNS(XML_c, XML_axId), XML_val, OString::number(nAxisIdy)); if (mbHasZAxis) { sal_Int32 nAxisIdz = 0; @@ -3498,9 +3271,7 @@ void ChartExport::exportAxesId(bool bPrimaryAxes, bool bCheckCombinedAxes) nAxisIdz = lcl_generateRandomValue(); maAxes.emplace_back( AXIS_PRIMARY_Z, nAxisIdz, nAxisIdy ); } - pFS->singleElement( FSNS( XML_c, XML_axId ), - XML_val, I32S( nAxisIdz ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_axId), XML_val, OString::number(nAxisIdz)); } } @@ -3528,9 +3299,7 @@ void ChartExport::exportGrouping( bool isBar ) else grouping = "standard"; } - pFS->singleElement( FSNS( XML_c, XML_grouping ), - XML_val, grouping, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_grouping), XML_val, grouping); } void ChartExport::exportTrendlines( const Reference< chart2::XDataSeries >& xSeries ) @@ -3565,13 +3334,13 @@ void ChartExport::exportTrendlines( const Reference< chart2::XDataSeries >& xSer aService != "com.sun.star.chart2.MovingAverageRegressionCurve") continue; - pFS->startElement( FSNS( XML_c, XML_trendline ), FSEND ); + pFS->startElement(FSNS(XML_c, XML_trendline)); OUString aName; xProperties->getPropertyValue("CurveName") >>= aName; if(!aName.isEmpty()) { - pFS->startElement( FSNS( XML_c, XML_name), FSEND); + pFS->startElement(FSNS(XML_c, XML_name)); pFS->writeEscaped(aName); pFS->endElement( FSNS( XML_c, XML_name) ); } @@ -3580,52 +3349,36 @@ void ChartExport::exportTrendlines( const Reference< chart2::XDataSeries >& xSer if( aService == "com.sun.star.chart2.LinearRegressionCurve" ) { - pFS->singleElement( FSNS( XML_c, XML_trendlineType ), - XML_val, "linear", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "linear"); } else if( aService == "com.sun.star.chart2.ExponentialRegressionCurve" ) { - pFS->singleElement( FSNS( XML_c, XML_trendlineType ), - XML_val, "exp", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "exp"); } else if( aService == "com.sun.star.chart2.LogarithmicRegressionCurve" ) { - pFS->singleElement( FSNS( XML_c, XML_trendlineType ), - XML_val, "log", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "log"); } else if( aService == "com.sun.star.chart2.PotentialRegressionCurve" ) { - pFS->singleElement( FSNS( XML_c, XML_trendlineType ), - XML_val, "power", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "power"); } else if( aService == "com.sun.star.chart2.PolynomialRegressionCurve" ) { - pFS->singleElement( FSNS( XML_c, XML_trendlineType ), - XML_val, "poly", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "poly"); sal_Int32 aDegree = 2; xProperties->getPropertyValue( "PolynomialDegree") >>= aDegree; - pFS->singleElement( FSNS( XML_c, XML_order ), - XML_val, I32S(aDegree), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_order), XML_val, OString::number(aDegree)); } else if( aService == "com.sun.star.chart2.MovingAverageRegressionCurve" ) { - pFS->singleElement( FSNS( XML_c, XML_trendlineType ), - XML_val, "movingAvg", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "movingAvg"); sal_Int32 aPeriod = 2; xProperties->getPropertyValue( "MovingAveragePeriod") >>= aPeriod; - pFS->singleElement( FSNS( XML_c, XML_period ), - XML_val, I32S(aPeriod), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_period), XML_val, OString::number(aPeriod)); } else { @@ -3641,12 +3394,10 @@ void ChartExport::exportTrendlines( const Reference< chart2::XDataSeries >& xSer xProperties->getPropertyValue("ExtrapolateBackward") >>= fExtrapolateBackward; pFS->singleElement( FSNS( XML_c, XML_forward ), - XML_val, OString::number(fExtrapolateForward).getStr(), - FSEND ); + XML_val, OString::number(fExtrapolateForward) ); pFS->singleElement( FSNS( XML_c, XML_backward ), - XML_val, OString::number(fExtrapolateBackward).getStr(), - FSEND ); + XML_val, OString::number(fExtrapolateBackward) ); bool bForceIntercept = false; xProperties->getPropertyValue("ForceIntercept") >>= bForceIntercept; @@ -3657,8 +3408,7 @@ void ChartExport::exportTrendlines( const Reference< chart2::XDataSeries >& xSer xProperties->getPropertyValue("InterceptValue") >>= fInterceptValue; pFS->singleElement( FSNS( XML_c, XML_intercept ), - XML_val, OString::number(fInterceptValue).getStr(), - FSEND ); + XML_val, OString::number(fInterceptValue) ); } // Equation properties @@ -3673,12 +3423,9 @@ void ChartExport::exportTrendlines( const Reference< chart2::XDataSeries >& xSer xEquationProperties->getPropertyValue("ShowCorrelationCoefficient") >>= bShowCorrelationCoefficient; pFS->singleElement( FSNS( XML_c, XML_dispRSqr ), - XML_val, bShowCorrelationCoefficient ? "1" : "0", - FSEND ); + XML_val, ToPsz10(bShowCorrelationCoefficient) ); - pFS->singleElement( FSNS( XML_c, XML_dispEq ), - XML_val, bShowEquation ? "1" : "0", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_dispEq), XML_val, ToPsz10(bShowEquation)); pFS->endElement( FSNS( XML_c, XML_trendline ) ); } @@ -3696,8 +3443,7 @@ void ChartExport::exportMarker(const Reference< chart2::XDataSeries >& xSeries) return; FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_marker ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_marker)); sal_Int32 nSymbol = aSymbol.StandardSymbol; // TODO: more properties support for marker @@ -3744,7 +3490,7 @@ void ChartExport::exportMarker(const Reference< chart2::XDataSeries >& xSeries) pSymbolType = "none"; } - pFS->singleElement(FSNS(XML_c, XML_symbol), XML_val, pSymbolType, FSEND); + pFS->singleElement(FSNS(XML_c, XML_symbol), XML_val, pSymbolType); if (!bSkipFormatting) { @@ -3754,12 +3500,9 @@ void ChartExport::exportMarker(const Reference< chart2::XDataSeries >& xSeries) nSize = nSize/250.0*7.0 + 1; // just guessed based on some test cases, //the value is always 1 less than the actual value. nSize = std::min<sal_Int32>( 72, std::max<sal_Int32>( 2, nSize ) ); - pFS->singleElement( FSNS( XML_c, XML_size), - XML_val, I32S(nSize), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_size), XML_val, OString::number(nSize)); - pFS->startElement( FSNS( XML_c, XML_spPr ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_spPr)); util::Color aColor = aSymbol.FillColor; if (GetProperty(xPropSet, "Color")) @@ -3767,7 +3510,7 @@ void ChartExport::exportMarker(const Reference< chart2::XDataSeries >& xSeries) if (aColor == -1) { - pFS->singleElement(FSNS(XML_a, XML_noFill), FSEND); + pFS->singleElement(FSNS(XML_a, XML_noFill)); } else WriteSolidFill(::Color(aColor)); @@ -3786,9 +3529,7 @@ void ChartExport::exportSmooth() if( GetProperty( xPropSet, "SplineType" ) ) mAny >>= nSplineType; const char* pVal = nSplineType != 0 ? "1" : "0"; - pFS->singleElement( FSNS( XML_c, XML_smooth ), - XML_val, pVal, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_smooth), XML_val, pVal); } void ChartExport::exportFirstSliceAng( ) @@ -3801,9 +3542,7 @@ void ChartExport::exportFirstSliceAng( ) // convert to ooxml angle nStartingAngle = (450 - nStartingAngle ) % 360; - pFS->singleElement( FSNS( XML_c, XML_firstSliceAng ), - XML_val, I32S( nStartingAngle ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_firstSliceAng), XML_val, OString::number(nStartingAngle)); } namespace { @@ -3873,11 +3612,8 @@ void ChartExport::exportErrorBar(const Reference< XPropertySet>& xErrorBarProps, return; FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_errBars ), - FSEND ); - pFS->singleElement( FSNS( XML_c, XML_errDir ), - XML_val, bYError ? "y" : "x", - FSEND ); + pFS->startElement(FSNS(XML_c, XML_errBars)); + pFS->singleElement(FSNS(XML_c, XML_errDir), XML_val, bYError ? "y" : "x"); bool bPositive = false, bNegative = false; xErrorBarProps->getPropertyValue("ShowPositiveError") >>= bPositive; xErrorBarProps->getPropertyValue("ShowNegativeError") >>= bNegative; @@ -3894,15 +3630,9 @@ void ChartExport::exportErrorBar(const Reference< XPropertySet>& xErrorBarProps, // at least this makes the file valid pErrBarType = "both"; } - pFS->singleElement( FSNS( XML_c, XML_errBarType ), - XML_val, pErrBarType, - FSEND ); - pFS->singleElement( FSNS( XML_c, XML_errValType ), - XML_val, pErrorBarStyle, - FSEND ); - pFS->singleElement( FSNS( XML_c, XML_noEndCap ), - XML_val, "0", - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_errBarType), XML_val, pErrBarType); + pFS->singleElement(FSNS(XML_c, XML_errValType), XML_val, pErrorBarStyle); + pFS->singleElement(FSNS(XML_c, XML_noEndCap), XML_val, "0"); if(nErrorBarStyle == cssc::ErrorBarStyle::FROM_DATA) { uno::Reference< chart2::data::XDataSource > xDataSource(xErrorBarProps, uno::UNO_QUERY); @@ -3934,11 +3664,7 @@ void ChartExport::exportErrorBar(const Reference< XPropertySet>& xErrorBarProps, xErrorBarProps->getPropertyValue("NegativeError") >>= nVal; } - OString aVal = OString::number(nVal); - - pFS->singleElement( FSNS( XML_c, XML_val ), - XML_val, aVal.getStr(), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_val), XML_val, OString::number(nVal)); } exportShapeProps( xErrorBarProps ); @@ -3952,8 +3678,7 @@ void ChartExport::exportView3D() if( !xPropSet.is() ) return; FSHelperPtr pFS = GetFS(); - pFS->startElement( FSNS( XML_c, XML_view3D ), - FSEND ); + pFS->startElement(FSNS(XML_c, XML_view3D)); sal_Int32 eChartType = getChartType( ); // rotX if( GetProperty( xPropSet, "RotationHorizontal" ) ) @@ -3972,9 +3697,7 @@ void ChartExport::exportView3D() else nRotationX += 360; // X rotation (map Chart2 [-179,180] to OOXML [-90..90]) } - pFS->singleElement( FSNS( XML_c, XML_rotX ), - XML_val, I32S( nRotationX ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_rotX), XML_val, OString::number(nRotationX)); } // rotY if( GetProperty( xPropSet, "RotationVertical" ) ) @@ -3987,9 +3710,7 @@ void ChartExport::exportView3D() mAny >>= nStartingAngle; // convert to ooxml angle nStartingAngle = (450 - nStartingAngle ) % 360; - pFS->singleElement( FSNS( XML_c, XML_rotY ), - XML_val, I32S( nStartingAngle ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_rotY), XML_val, OString::number(nStartingAngle)); } else { @@ -3998,9 +3719,7 @@ void ChartExport::exportView3D() // Y rotation (map Chart2 [-179,180] to OOXML [0..359]) if( nRotationY < 0 ) nRotationY += 360; - pFS->singleElement( FSNS( XML_c, XML_rotY ), - XML_val, I32S( nRotationY ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_rotY), XML_val, OString::number(nRotationY)); } } // rAngAx @@ -4009,9 +3728,7 @@ void ChartExport::exportView3D() bool bRightAngled = false; mAny >>= bRightAngled; const char* sRightAngled = bRightAngled ? "1":"0"; - pFS->singleElement( FSNS( XML_c, XML_rAngAx ), - XML_val, sRightAngled, - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_rAngAx), XML_val, sRightAngled); } // perspective if( GetProperty( xPropSet, "Perspective" ) ) @@ -4020,9 +3737,7 @@ void ChartExport::exportView3D() mAny >>= nPerspective; // map Chart2 [0,100] to OOXML [0..200] nPerspective *= 2; - pFS->singleElement( FSNS( XML_c, XML_perspective ), - XML_val, I32S( nPerspective ), - FSEND ); + pFS->singleElement(FSNS(XML_c, XML_perspective), XML_val, OString::number(nPerspective)); } pFS->endElement( FSNS( XML_c, XML_view3D ) ); } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 15eeda16f4c6..1b3ec2d6986f 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -168,7 +168,7 @@ namespace { void WriteRadialGradientPath(const awt::Gradient& rGradient, const FSHelperPtr& pFS) { - pFS->startElementNS(XML_a, XML_path, XML_path, "circle", FSEND); + pFS->startElementNS(XML_a, XML_path, XML_path, "circle"); // Write the focus rectangle. Work with the focus point, and assume // that it extends 50% in all directions. The below @@ -257,14 +257,14 @@ void DrawingML::WriteColor( ::Color nColor, sal_Int32 nAlpha ) } if( nAlpha < MAX_PERCENT ) { - mpFS->startElementNS( XML_a, XML_srgbClr, XML_val, sColor.getStr(), FSEND ); - mpFS->singleElementNS( XML_a, XML_alpha, XML_val, OString::number(nAlpha), FSEND ); + mpFS->startElementNS(XML_a, XML_srgbClr, XML_val, sColor); + mpFS->singleElementNS(XML_a, XML_alpha, XML_val, OString::number(nAlpha)); mpFS->endElementNS( XML_a, XML_srgbClr ); } else { - mpFS->singleElementNS( XML_a, XML_srgbClr, XML_val, sColor.getStr(), FSEND ); + mpFS->singleElementNS(XML_a, XML_srgbClr, XML_val, sColor); } } @@ -276,17 +276,13 @@ void DrawingML::WriteColor( const OUString& sColorSchemeName, const Sequence< Pr if( aTransformations.hasElements() ) { - mpFS->startElementNS( XML_a, XML_schemeClr, - XML_val, sColorSchemeName.toUtf8(), - FSEND ); + mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, sColorSchemeName.toUtf8()); WriteColorTransformations( aTransformations ); mpFS->endElementNS( XML_a, XML_schemeClr ); } else { - mpFS->singleElementNS( XML_a, XML_schemeClr, - XML_val, sColorSchemeName.toUtf8(), - FSEND ); + mpFS->singleElementNS(XML_a, XML_schemeClr, XML_val, sColorSchemeName.toUtf8()); } } @@ -298,21 +294,21 @@ void DrawingML::WriteColorTransformations( const Sequence< PropertyValue >& aTra if( nToken != XML_TOKEN_INVALID && aTransformations[i].Value.hasValue() ) { sal_Int32 nValue = aTransformations[i].Value.get<sal_Int32>(); - mpFS->singleElementNS( XML_a, nToken, XML_val, I32S( nValue ), FSEND ); + mpFS->singleElementNS(XML_a, nToken, XML_val, OString::number(nValue)); } } } void DrawingML::WriteSolidFill( ::Color nColor, sal_Int32 nAlpha ) { - mpFS->startElementNS( XML_a, XML_solidFill, FSEND ); + mpFS->startElementNS(XML_a, XML_solidFill); WriteColor( nColor, nAlpha ); mpFS->endElementNS( XML_a, XML_solidFill ); } void DrawingML::WriteSolidFill( const OUString& sSchemeName, const Sequence< PropertyValue >& aTransformations ) { - mpFS->startElementNS( XML_a, XML_solidFill, FSEND ); + mpFS->startElementNS(XML_a, XML_solidFill); WriteColor( sSchemeName, aTransformations ); mpFS->endElementNS( XML_a, XML_solidFill ); } @@ -391,9 +387,7 @@ void DrawingML::WriteSolidFill( const Reference< XPropertySet >& rXPropSet ) void DrawingML::WriteGradientStop( sal_uInt16 nStop, ::Color nColor ) { - mpFS->startElementNS( XML_a, XML_gs, - XML_pos, I32S( nStop * 1000 ), - FSEND ); + mpFS->startElementNS(XML_a, XML_gs, XML_pos, OString::number(nStop * 1000)); WriteColor( nColor ); mpFS->endElementNS( XML_a, XML_gs ); } @@ -448,14 +442,14 @@ void DrawingML::WriteGradientFill( const Reference< XPropertySet >& rXPropSet ) // If we have no gradient stops that means original gradient were defined by a theme. if( aGradientStops.hasElements() ) { - mpFS->startElementNS( XML_a, XML_gradFill, XML_rotWithShape, "0", FSEND ); + mpFS->startElementNS(XML_a, XML_gradFill, XML_rotWithShape, "0"); WriteGrabBagGradientFill(aGradientStops, aGradient); mpFS->endElementNS( XML_a, XML_gradFill ); } } else { - mpFS->startElementNS( XML_a, XML_gradFill, XML_rotWithShape, "0", FSEND ); + mpFS->startElementNS(XML_a, XML_gradFill, XML_rotWithShape, "0"); WriteGradientFill(aGradient); mpFS->endElementNS( XML_a, XML_gradFill ); } @@ -465,7 +459,7 @@ void DrawingML::WriteGradientFill( const Reference< XPropertySet >& rXPropSet ) void DrawingML::WriteGrabBagGradientFill( const Sequence< PropertyValue >& aGradientStops, awt::Gradient rGradient ) { // write back the original gradient - mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); + mpFS->startElementNS(XML_a, XML_gsLst); // get original stops and write them for( sal_Int32 i=0; i < aGradientStops.getLength(); ++i ) @@ -493,9 +487,7 @@ void DrawingML::WriteGrabBagGradientFill( const Sequence< PropertyValue >& aGrad aGradientStop[j].Value >>= aTransformations; } // write stop - mpFS->startElementNS( XML_a, XML_gs, - XML_pos, OString::number( nPos * 100000.0 ).getStr(), - FSEND ); + mpFS->startElementNS(XML_a, XML_gs, XML_pos, OString::number(nPos * 100000.0).getStr()); if( sSchemeClr.isEmpty() ) { // Calculate alpha value (see oox/source/drawingml/color.cxx : getTransparency()) @@ -513,9 +505,9 @@ void DrawingML::WriteGrabBagGradientFill( const Sequence< PropertyValue >& aGrad switch (rGradient.Style) { default: - mpFS->singleElementNS( XML_a, XML_lin, - XML_ang, I32S( ( ( ( 3600 - rGradient.Angle + 900 ) * 6000 ) % 21600000 ) ), - FSEND ); + mpFS->singleElementNS( + XML_a, XML_lin, XML_ang, + OString::number((((3600 - rGradient.Angle + 900) * 6000) % 21600000))); break; case awt::GradientStyle_RADIAL: WriteRadialGradientPath(rGradient, mpFS); @@ -529,29 +521,29 @@ void DrawingML::WriteGradientFill( awt::Gradient rGradient ) { default: case awt::GradientStyle_LINEAR: - mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); + mpFS->startElementNS(XML_a, XML_gsLst); WriteGradientStop( 0, ColorWithIntensity( rGradient.StartColor, rGradient.StartIntensity ) ); WriteGradientStop( 100, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); mpFS->endElementNS( XML_a, XML_gsLst ); - mpFS->singleElementNS( XML_a, XML_lin, - XML_ang, I32S( ( ( ( 3600 - rGradient.Angle + 900 ) * 6000 ) % 21600000 ) ), - FSEND ); + mpFS->singleElementNS( + XML_a, XML_lin, XML_ang, + OString::number((((3600 - rGradient.Angle + 900) * 6000) % 21600000))); break; case awt::GradientStyle_AXIAL: - mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); + mpFS->startElementNS(XML_a, XML_gsLst); WriteGradientStop( 0, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); WriteGradientStop( 50, ColorWithIntensity( rGradient.StartColor, rGradient.StartIntensity ) ); WriteGradientStop( 100, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); mpFS->endElementNS( XML_a, XML_gsLst ); - mpFS->singleElementNS( XML_a, XML_lin, - XML_ang, I32S( ( ( ( 3600 - rGradient.Angle + 900 ) * 6000 ) % 21600000 ) ), - FSEND ); + mpFS->singleElementNS( + XML_a, XML_lin, XML_ang, + OString::number((((3600 - rGradient.Angle + 900) * 6000) % 21600000))); break; case awt::GradientStyle_RADIAL: { - mpFS->startElementNS(XML_a, XML_gsLst, FSEND); + mpFS->startElementNS(XML_a, XML_gsLst); WriteGradientStop(0, ColorWithIntensity(rGradient.EndColor, rGradient.EndIntensity)); if (rGradient.Border > 0 && rGradient.Border < 100) // Map border to an additional gradient stop, which has the @@ -572,13 +564,12 @@ void DrawingML::WriteGradientFill( awt::Gradient rGradient ) case awt::GradientStyle_ELLIPTICAL: case awt::GradientStyle_RECT: case awt::GradientStyle_SQUARE: - mpFS->startElementNS( XML_a, XML_gsLst, FSEND ); + mpFS->startElementNS(XML_a, XML_gsLst); WriteGradientStop( 0, ColorWithIntensity( rGradient.EndColor, rGradient.EndIntensity ) ); WriteGradientStop( 100, ColorWithIntensity( rGradient.StartColor, rGradient.StartIntensity ) ); mpFS->endElementNS( XML_a, XML_gsLst ); mpFS->singleElementNS( XML_a, XML_path, - XML_path, ( rGradient.Style == awt::GradientStyle_RADIAL || rGradient.Style == awt::GradientStyle_ELLIPTICAL ) ? "circle" : "rect", - FSEND ); + XML_path, ( rGradient.Style == awt::GradientStyle_RADIAL || rGradient.Style == awt::GradientStyle_ELLIPTICAL ) ? "circle" : "rect" ); break; } } @@ -649,8 +640,7 @@ void DrawingML::WriteLineArrow( const Reference< XPropertySet >& rXPropSet, bool mpFS->singleElementNS( XML_a, bLineStart ? XML_headEnd : XML_tailEnd, XML_len, len, XML_type, type, - XML_w, width, - FSEND ); + XML_w, width ); } } @@ -776,8 +766,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc mpFS->startElementNS( XML_a, XML_ln, XML_cap, cap, XML_w, nLineWidth > 1 && nStyleLineWidth != nLineWidth ? - I64S( oox::drawingml::convertHmmToEmu( nLineWidth ) ) :nullptr, - FSEND ); + OString::number(oox::drawingml::convertHmmToEmu(nLineWidth)).getStr() : nullptr ); if( bColorSet ) { @@ -821,43 +810,43 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc // keep default mso preset linestyles (instead of custdash) if (aLineDash.Dots == 1 && relDotLen == 1 && aLineDash.Dashes == 0 && relDashLen == 0 && relDistance == 3) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dot", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dot"); } else if (aLineDash.Dots == 0 && relDotLen == 0 && aLineDash.Dashes == 1 && relDashLen == 4 && relDistance == 3) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash"); } else if (aLineDash.Dots == 1 && relDotLen == 1 && aLineDash.Dashes == 1 && relDashLen == 4 && relDistance == 3) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dashDot", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dashDot"); } else if (aLineDash.Dots == 0 && relDotLen == 0 && aLineDash.Dashes == 1 && relDashLen == 8 && relDistance == 3) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDash", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDash"); } else if (aLineDash.Dots == 1 && relDotLen == 1 && aLineDash.Dashes == 1 && relDashLen == 8 && relDistance == 3) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDot", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDot"); } else if (aLineDash.Dots == 2 && relDotLen == 1 && aLineDash.Dashes == 1 && relDashLen == 8 && relDistance == 3) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDotDot", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDotDot"); } else if (aLineDash.Dots == 1 && relDotLen == 1 && aLineDash.Dashes == 0 && relDashLen == 0 && relDistance == 1) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDot", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDot"); } else if (aLineDash.Dots == 0 && relDotLen == 0 && aLineDash.Dashes == 1 && relDashLen == 3 && relDistance == 1) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDash", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDash"); } else if (aLineDash.Dots == 1 && relDotLen == 1 && aLineDash.Dashes == 1 && relDashLen == 3 && relDistance == 1) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDot", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDot"); } else if (aLineDash.Dots == 2 && relDotLen == 1 && aLineDash.Dashes == 1 && relDashLen == 3 && relDistance == 1) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDotDot", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDotDot"); } /*convert some LO preset dashes to MSO preset dashes for oox interoperability LO preset dashes which don't have equivalent in MSO preset dashes: 2 Dots 3 Dashes, Line with Fine Dots, 3 Dashes 3 Dots*/ @@ -865,32 +854,32 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc else if ((aLineDash.Dots == 1 && aLineDash.DotLen == 51 && aLineDash.Dashes == 1 && aLineDash.DashLen == 51 && aLineDash.Distance == 51) || (aLineDash.Dots == 1 && aLineDash.DotLen == 0 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 50)) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDot", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDot"); } //Fine Dashed -> dash else if (aLineDash.Dots == 1 && aLineDash.DotLen == 197 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 197) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash"); } //Fine Dotted -> dot else if (aLineDash.Dots == 1 && aLineDash.DotLen == 0 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 457) { - mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dot", FSEND); + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dot"); } //Line Style 9, Dashed -> sysDash ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits