summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-04-19 02:24:00 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-04-19 21:20:46 +0200
commit1fe24bb1e2fbe44a4bf2c03297e259b3a18b1235 (patch)
treee237d906174ec0646fef5051e5f6940da31e28cf /oox
parent2a6450cbe8b57cae240d8cfea02e508cfac78dbe (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 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx34
-rw-r--r--oox/source/export/chartexport.cxx749
-rw-r--r--oox/source/export/drawingml.cxx508
-rw-r--r--oox/source/export/shapes.cxx313
-rw-r--r--oox/source/export/vmlexport.cxx10
5 files changed, 611 insertions, 1003 deletions
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
else if ((aLineDash.Dots == 1 && aLineDash.DotLen == 197 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 120) ||
(aLineDash.Dots == 1 && aLineDash.DotLen == 197 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 127))
{
- mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDash", FSEND);
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDash");
}
//2 Dots 1 Dash -> sysDashDotDot
else if (aLineDash.Dots == 2 && aLineDash.DotLen == 0 && aLineDash.Dashes == 1 && aLineDash.DashLen == 203 && aLineDash.Distance == 203)
{
- mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDotDot", FSEND);
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDotDot");
}
else
{
- mpFS->startElementNS( XML_a, XML_custDash, FSEND );
+ mpFS->startElementNS(XML_a, XML_custDash);
// Check that line-width is positive and distance between dashes\dots is positive
if ( nLineWidth > 0 && aLineDash.Distance > 0 )
@@ -905,8 +894,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc
{
mpFS->singleElementNS( XML_a , XML_ds,
XML_d , write1000thOfAPercent(nD),
- XML_sp, write1000thOfAPercent(nSp),
- FSEND );
+ XML_sp, write1000thOfAPercent(nSp) );
}
}
if ( aLineDash.Dots > 0 )
@@ -916,8 +904,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc
{
mpFS->singleElementNS( XML_a, XML_ds,
XML_d , write1000thOfAPercent(nD),
- XML_sp, write1000thOfAPercent(nSp),
- FSEND );
+ XML_sp, write1000thOfAPercent(nSp) );
}
}
}
@@ -950,15 +937,15 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc
{
case LineJoint_NONE:
case LineJoint_BEVEL:
- mpFS->singleElementNS( XML_a, XML_bevel, FSEND );
+ mpFS->singleElementNS(XML_a, XML_bevel);
break;
default:
case LineJoint_MIDDLE:
case LineJoint_MITER:
- mpFS->singleElementNS( XML_a, XML_miter, FSEND );
+ mpFS->singleElementNS(XML_a, XML_miter);
break;
case LineJoint_ROUND:
- mpFS->singleElementNS( XML_a, XML_round, FSEND );
+ mpFS->singleElementNS(XML_a, XML_round);
break;
}
}
@@ -971,7 +958,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc
}
else
{
- mpFS->singleElementNS( XML_a, XML_noFill, FSEND );
+ mpFS->singleElementNS(XML_a, XML_noFill);
}
mpFS->endElementNS( XML_a, XML_ln );
@@ -1196,20 +1183,17 @@ void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::dra
aMediaRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::MEDIA), rURL);
}
- GetFS()->startElementNS(XML_p, XML_nvPr, FSEND);
+ GetFS()->startElementNS(XML_p, XML_nvPr);
GetFS()->singleElementNS(XML_a, eMediaType == Relationship::VIDEO ? XML_videoFile : XML_audioFile,
- FSNS(XML_r, XML_link), aVideoFileRelId.toUtf8(),
- FSEND);
+ FSNS(XML_r, XML_link), aVideoFileRelId.toUtf8());
- GetFS()->startElementNS(XML_p, XML_extLst, FSEND);
- GetFS()->startElementNS(XML_p, XML_ext,
- XML_uri, "{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}", // media extensions; google this ID for details
- FSEND);
+ GetFS()->startElementNS(XML_p, XML_extLst);
+ // media extensions; google this ID for details
+ GetFS()->startElementNS(XML_p, XML_ext, XML_uri, "{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}");
GetFS()->singleElementNS(XML_p14, XML_media,
- bEmbed? FSNS(XML_r, XML_embed): FSNS(XML_r, XML_link), aMediaRelId.toUtf8(),
- FSEND);
+ bEmbed? FSNS(XML_r, XML_embed): FSNS(XML_r, XML_link), aMediaRelId.toUtf8());
GetFS()->endElementNS(XML_p, XML_ext);
GetFS()->endElementNS(XML_p, XML_extLst);
@@ -1234,16 +1218,14 @@ void DrawingML::WriteImageBrightnessContrastTransparence(uno::Reference<beans::X
if (nBright || nContrast)
{
mpFS->singleElementNS(XML_a, XML_lum,
- XML_bright, nBright ? I32S(nBright * 1000) : nullptr,
- XML_contrast, nContrast ? I32S(nContrast * 1000) : nullptr,
- FSEND);
+ XML_bright, nBright ? OString::number(nBright * 1000).getStr() : nullptr,
+ XML_contrast, nContrast ? OString::number(nContrast * 1000).getStr() : nullptr);
}
if (nTransparence)
{
sal_Int32 nAlphaMod = (100 - nTransparence ) * PER_PERCENT;
- mpFS->singleElementNS(XML_a, XML_alphaModFix,
- XML_amt, I32S(nAlphaMod), FSEND);
+ mpFS->singleElementNS(XML_a, XML_alphaModFix, XML_amt, OString::number(nAlphaMod));
}
}
@@ -1272,9 +1254,7 @@ OUString DrawingML::WriteXGraphicBlip(uno::Reference<beans::XPropertySet> const
}
}
- mpFS->startElementNS(XML_a, XML_blip,
- FSNS(XML_r, XML_embed), sRelId.toUtf8().getStr(),
- FSEND);
+ mpFS->startElementNS(XML_a, XML_blip, FSNS(XML_r, XML_embed), sRelId.toUtf8());
WriteImageBrightnessContrastTransparence(rXPropSet);
@@ -1297,7 +1277,7 @@ void DrawingML::WriteXGraphicBlipMode(uno::Reference<beans::XPropertySet> const
switch (eBitmapMode)
{
case BitmapMode_REPEAT:
- mpFS->singleElementNS(XML_a, XML_tile, FSEND);
+ mpFS->singleElementNS(XML_a, XML_tile);
break;
case BitmapMode_STRETCH:
WriteXGraphicStretch(rXPropSet, rxGraphic);
@@ -1356,7 +1336,7 @@ void DrawingML::WriteXGraphicBlipFill(uno::Reference<beans::XPropertySet> const
if (!rxGraphic.is() )
return;
- mpFS->startElementNS(nXmlNamespace , XML_blipFill, XML_rotWithShape, "0", FSEND);
+ mpFS->startElementNS(nXmlNamespace , XML_blipFill, XML_rotWithShape, "0");
WriteXGraphicBlip(rXPropSet, rxGraphic, bRelPathToMedia);
@@ -1388,9 +1368,9 @@ void DrawingML::WritePattFill( const Reference< XPropertySet >& rXPropSet )
void DrawingML::WritePattFill(const Reference<XPropertySet>& rXPropSet, const css::drawing::Hatch& rHatch)
{
- mpFS->startElementNS( XML_a , XML_pattFill, XML_prst, GetHatchPattern(rHatch), FSEND );
+ mpFS->startElementNS(XML_a, XML_pattFill, XML_prst, GetHatchPattern(rHatch));
- mpFS->startElementNS( XML_a , XML_fgClr, FSEND );
+ mpFS->startElementNS(XML_a, XML_fgClr);
WriteColor(::Color(rHatch.Color));
mpFS->endElementNS( XML_a , XML_fgClr );
@@ -1412,7 +1392,7 @@ void DrawingML::WritePattFill(const Reference<XPropertySet>& rXPropSet, const cs
}
}
- mpFS->startElementNS( XML_a , XML_bgClr, FSEND );
+ mpFS->startElementNS(XML_a, XML_bgClr);
WriteColor(nColor, nAlpha);
mpFS->endElementNS( XML_a , XML_bgClr );
@@ -1435,11 +1415,10 @@ void DrawingML::WriteGraphicCropProperties(uno::Reference<beans::XPropertySet> c
if ( (0 != aGraphicCropStruct.Left) || (0 != aGraphicCropStruct.Top) || (0 != aGraphicCropStruct.Right) || (0 != aGraphicCropStruct.Bottom) )
{
mpFS->singleElementNS( XML_a, XML_srcRect,
- XML_l, I32S(rtl::math::round(static_cast<double>(aGraphicCropStruct.Left) * 100000 / aOriginalSize.Width())),
- XML_t, I32S(rtl::math::round(static_cast<double>(aGraphicCropStruct.Top) * 100000 / aOriginalSize.Height())),
- XML_r, I32S(rtl::math::round(static_cast<double>(aGraphicCropStruct.Right) * 100000 / aOriginalSize.Width())),
- XML_b, I32S(rtl::math::round(static_cast<double>(aGraphicCropStruct.Bottom) * 100000 / aOriginalSize.Height())),
- FSEND );
+ XML_l, OString::number(rtl::math::round(aGraphicCropStruct.Left * 100000.0 / aOriginalSize.Width())),
+ XML_t, OString::number(rtl::math::round(aGraphicCropStruct.Top * 100000.0 / aOriginalSize.Height())),
+ XML_r, OString::number(rtl::math::round(aGraphicCropStruct.Right * 100000.0 / aOriginalSize.Width())),
+ XML_b, OString::number(rtl::math::round(aGraphicCropStruct.Bottom * 100000.0 / aOriginalSize.Height())) );
}
}
}
@@ -1456,7 +1435,7 @@ void DrawingML::WriteSrcRectXGraphic(uno::Reference<beans::XPropertySet> const &
void DrawingML::WriteXGraphicStretch(uno::Reference<beans::XPropertySet> const & rXPropSet,
uno::Reference<graphic::XGraphic> const & rxGraphic)
{
- mpFS->startElementNS(XML_a, XML_stretch, FSEND);
+ mpFS->startElementNS(XML_a, XML_stretch);
bool bCrop = false;
if (GetProperty(rXPropSet, "GraphicCrop"))
@@ -1472,18 +1451,17 @@ void DrawingML::WriteXGraphicStretch(uno::Reference<beans::XPropertySet> const &
Graphic aGraphic(rxGraphic);
Size aOriginalSize(aGraphic.GetPrefSize());
mpFS->singleElementNS(XML_a, XML_fillRect,
- XML_l, I32S(((aGraphicCropStruct.Left) * 100000) / aOriginalSize.Width()),
- XML_t, I32S(((aGraphicCropStruct.Top) * 100000) / aOriginalSize.Height()),
- XML_r, I32S(((aGraphicCropStruct.Right) * 100000) / aOriginalSize.Width()),
- XML_b, I32S(((aGraphicCropStruct.Bottom) * 100000) / aOriginalSize.Height()),
- FSEND);
+ XML_l, OString::number(((aGraphicCropStruct.Left) * 100000) / aOriginalSize.Width()),
+ XML_t, OString::number(((aGraphicCropStruct.Top) * 100000) / aOriginalSize.Height()),
+ XML_r, OString::number(((aGraphicCropStruct.Right) * 100000) / aOriginalSize.Width()),
+ XML_b, OString::number(((aGraphicCropStruct.Bottom) * 100000) / aOriginalSize.Height()));
bCrop = true;
}
}
if (!bCrop)
{
- mpFS->singleElementNS(XML_a, XML_fillRect, FSEND);
+ mpFS->singleElementNS(XML_a, XML_fillRect);
}
mpFS->endElementNS(XML_a, XML_stretch);
@@ -1496,8 +1474,7 @@ void DrawingML::WriteTransformation(const tools::Rectangle& rRect,
mpFS->startElementNS( nXmlNamespace, XML_xfrm,
XML_flipH, bFlipH ? "1" : nullptr,
XML_flipV, bFlipV ? "1" : nullptr,
- XML_rot, (nRotation % 21600000) ? I32S( nRotation ) : nullptr,
- FSEND );
+ XML_rot, (nRotation % 21600000) ? OString::number(nRotation).getStr() : nullptr );
sal_Int32 nLeft = rRect.Left();
sal_Int32 nTop = rRect.Top();
@@ -1507,13 +1484,21 @@ void DrawingML::WriteTransformation(const tools::Rectangle& rRect,
nTop = 0;
}
- mpFS->singleElementNS( XML_a, XML_off, XML_x, IS( oox::drawingml::convertHmmToEmu( nLeft ) ), XML_y, IS( oox::drawingml::convertHmmToEmu( nTop ) ), FSEND );
- mpFS->singleElementNS( XML_a, XML_ext, XML_cx, IS( oox::drawingml::convertHmmToEmu( rRect.GetWidth() ) ), XML_cy, IS( oox::drawingml::convertHmmToEmu( rRect.GetHeight() ) ), FSEND );
+ mpFS->singleElementNS(XML_a, XML_off,
+ XML_x, OString::number(oox::drawingml::convertHmmToEmu(nLeft)),
+ XML_y, OString::number(oox::drawingml::convertHmmToEmu(nTop)));
+ mpFS->singleElementNS(XML_a, XML_ext,
+ XML_cx, OString::number(oox::drawingml::convertHmmToEmu(rRect.GetWidth())),
+ XML_cy, OString::number(oox::drawingml::convertHmmToEmu(rRect.GetHeight())));
if (GetDocumentType() != DOCUMENT_DOCX && bIsGroupShape)
{
- mpFS->singleElementNS(XML_a, XML_chOff, XML_x, IS(oox::drawingml::convertHmmToEmu(nLeft)), XML_y, IS(oox::drawingml::convertHmmToEmu(nTop)), FSEND);
- mpFS->singleElementNS(XML_a, XML_chExt, XML_cx, IS(oox::drawingml::convertHmmToEmu(rRect.GetWidth())), XML_cy, IS(oox::drawingml::convertHmmToEmu(rRect.GetHeight())), FSEND);
+ mpFS->singleElementNS(XML_a, XML_chOff,
+ XML_x, OString::number(oox::drawingml::convertHmmToEmu(nLeft)),
+ XML_y, OString::number(oox::drawingml::convertHmmToEmu(nTop)));
+ mpFS->singleElementNS(XML_a, XML_chExt,
+ XML_cx, OString::number(oox::drawingml::convertHmmToEmu(rRect.GetWidth())),
+ XML_cy, OString::number(oox::drawingml::convertHmmToEmu(rRect.GetHeight())));
}
mpFS->endElementNS( nXmlNamespace, XML_xfrm );
@@ -1757,14 +1742,13 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
XML_b, bold,
XML_i, italic,
XML_lang, usLanguage.isEmpty() ? nullptr : usLanguage.toUtf8().getStr(),
- XML_sz, IS( nSize ),
+ XML_sz, OString::number(nSize),
// For Condensed character spacing spc value is negative.
- XML_spc, nCharKerning ? IS(nCharKerning) : nullptr,
+ XML_spc, nCharKerning ? OString::number(nCharKerning).getStr() : nullptr,
XML_strike, strikeout,
XML_u, underline,
- XML_baseline, nCharEscapement == 0 ? nullptr : IS( nCharEscapement*1000 ),
- XML_cap, cap,
- FSEND );
+ XML_baseline, nCharEscapement == 0 ? nullptr : OString::number(nCharEscapement*1000).getStr(),
+ XML_cap, cap );
// mso doesn't like text color to be placed after typeface
if ((bCheckDirect && GetPropertyAndState(rXPropSet, rXPropState, "CharColor", eState)
@@ -1794,13 +1778,13 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
// if color is automatic, then we shouldn't write information about color but to take color from character
if( color != COL_AUTO )
{
- mpFS->startElementNS( XML_a, XML_uFill, FSEND);
+ mpFS->startElementNS(XML_a, XML_uFill);
WriteSolidFill( color );
mpFS->endElementNS( XML_a, XML_uFill );
}
else
{
- mpFS->singleElementNS( XML_a, XML_uFillTx, FSEND );
+ mpFS->singleElementNS(XML_a, XML_uFillTx);
}
}
@@ -1818,8 +1802,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
mpFS->singleElementNS( XML_a, XML_latin,
XML_typeface, usTypeface.toUtf8(),
XML_pitchFamily, pitch,
- XML_charset, charset,
- FSEND );
+ XML_charset, charset );
}
if ((bComplex
@@ -1841,8 +1824,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
mpFS->singleElementNS( XML_a, bComplex ? XML_cs : XML_ea,
XML_typeface, usTypeface.toUtf8(),
XML_pitchFamily, pitch,
- XML_charset, charset,
- FSEND );
+ XML_charset, charset );
}
if( bIsField )
@@ -1865,9 +1847,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
oox::getRelationship(Relationship::HYPERLINK),
sURL, true );
- mpFS->singleElementNS( XML_a, XML_hlinkClick,
- FSNS(XML_r, XML_id), sRelId.toUtf8(),
- FSEND );
+ mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId.toUtf8());
}
}
@@ -2024,8 +2004,7 @@ void DrawingML::WriteRun( const Reference< XTextRange >& rRun,
if (sText == "\n")
{
- mpFS->singleElementNS( XML_a, XML_br,
- FSEND );
+ mpFS->singleElementNS(XML_a, XML_br);
}
else
{
@@ -2034,17 +2013,16 @@ void DrawingML::WriteRun( const Reference< XTextRange >& rRun,
OString sUUID(comphelper::xml::generateGUIDString());
mpFS->startElementNS( XML_a, XML_fld,
XML_id, sUUID.getStr(),
- XML_type, OUStringToOString( sFieldValue, RTL_TEXTENCODING_UTF8 ).getStr(),
- FSEND );
+ XML_type, sFieldValue.toUtf8() );
}
else
{
- mpFS->startElementNS( XML_a, XML_r, FSEND );
+ mpFS->startElementNS(XML_a, XML_r);
}
Reference< XPropertySet > xPropSet( rRun, uno::UNO_QUERY );
WriteRunProperties( xPropSet, bIsURLField, XML_rPr, true, rbOverridingCharHeight, rnCharHeight );
- mpFS->startElementNS( XML_a, XML_t, FSEND );
+ mpFS->startElementNS(XML_a, XML_t);
mpFS->writeEscaped( sText );
mpFS->endElementNS( XML_a, XML_t );
@@ -2232,9 +2210,9 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS
}
mpFS->singleElementNS( XML_a, XML_buSzPct,
- XML_val, IS( std::min(static_cast<sal_Int32>(std::lround(100000.f * fBulletSizeRel)), static_cast<sal_Int32>(400000))), FSEND);
- mpFS->startElementNS( XML_a, XML_buBlip, FSEND );
- mpFS->singleElementNS(XML_a, XML_blip, FSNS(XML_r, XML_embed), sRelationId.toUtf8(), FSEND);
+ XML_val, OString::number(std::min<sal_Int32>(std::lround(100000.f * fBulletSizeRel), 400000)));
+ mpFS->startElementNS(XML_a, XML_buBlip);
+ mpFS->singleElementNS(XML_a, XML_blip, FSNS(XML_r, XML_embed), sRelationId.toUtf8());
mpFS->endElementNS( XML_a, XML_buBlip );
}
else
@@ -2245,22 +2223,21 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS
{
nBulletColor = ::Color(mbIsBackgroundDark ? 0xffffff : 0x000000);
}
- mpFS->startElementNS( XML_a, XML_buClr, FSEND );
+ mpFS->startElementNS(XML_a, XML_buClr);
WriteColor( nBulletColor );
mpFS->endElementNS( XML_a, XML_buClr );
}
if( nBulletRelSize && nBulletRelSize != 100 )
mpFS->singleElementNS( XML_a, XML_buSzPct,
- XML_val, IS( std::max( sal_Int32(25000), std::min( sal_Int32(400000), 1000*( static_cast<sal_Int32>(nBulletRelSize) ) ) ) ), FSEND );
+ XML_val, OString::number(std::clamp<sal_Int32>(1000*nBulletRelSize, 25000, 400000)));
if( bHasFontDesc )
{
if ( SVX_NUM_CHAR_SPECIAL == nNumberingType )
aBulletChar = SubstituteBullet( aBulletChar, aFontDesc );
mpFS->singleElementNS( XML_a, XML_buFont,
- XML_typeface, aFontDesc.Name.toUtf8().getStr(),
- XML_charset, (aFontDesc.CharSet == awt::CharSet::SYMBOL) ? "2" : nullptr,
- FSEND );
+ XML_typeface, aFontDesc.Name.toUtf8(),
+ XML_charset, (aFontDesc.CharSet == awt::CharSet::SYMBOL) ? "2" : nullptr );
}
OUString aAutoNumType = GetAutoNumType( nNumberingType, bSDot, bPBehind, bPBoth );
@@ -2268,13 +2245,12 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS
if (!aAutoNumType.isEmpty())
{
mpFS->singleElementNS(XML_a, XML_buAutoNum,
- XML_type, OUStringToOString(aAutoNumType, RTL_TEXTENCODING_UTF8).getStr(),
- XML_startAt, nStartWith > 1 ? IS(nStartWith) : nullptr,
- FSEND);
+ XML_type, aAutoNumType.toUtf8(),
+ XML_startAt, nStartWith > 1 ? OString::number(nStartWith).getStr() : nullptr);
}
else
{
- mpFS->singleElementNS(XML_a, XML_buChar, XML_char, OUString(aBulletChar).toUtf8(), FSEND);
+ mpFS->singleElementNS(XML_a, XML_buChar, XML_char, OUString(aBulletChar).toUtf8());
}
}
}
@@ -2375,14 +2351,12 @@ void DrawingML::WriteLinespacing( const LineSpacing& rSpacing )
if( rSpacing.Mode == LineSpacingMode::PROP )
{
mpFS->singleElementNS( XML_a, XML_spcPct,
- XML_val, I32S( (static_cast<sal_Int32>(rSpacing.Height))*1000 ),
- FSEND );
+ XML_val, OString::number(static_cast<sal_Int32>(rSpacing.Height)*1000));
}
else
{
mpFS->singleElementNS( XML_a, XML_spcPts,
- XML_val, I32S( std::lround(rSpacing.Height / 25.4 * 72) ),
- FSEND );
+ XML_val, OString::number(std::lround(rSpacing.Height / 25.4 * 72)));
}
}
@@ -2445,47 +2419,43 @@ void DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rPara
{
if (nParaLeftMargin) // For Paragraph
mpFS->startElementNS( XML_a, XML_pPr,
- XML_lvl, nLevel > 0 ? I32S( nLevel ) : nullptr,
- XML_marL, nParaLeftMargin > 0 ? I32S( oox::drawingml::convertHmmToEmu( nParaLeftMargin ) ) : nullptr,
- XML_indent, nParaFirstLineIndent ? I32S( oox::drawingml::convertHmmToEmu( nParaFirstLineIndent ) ) : nullptr,
+ XML_lvl, nLevel > 0 ? OString::number(nLevel).getStr() : nullptr,
+ XML_marL, nParaLeftMargin > 0 ? OString::number(oox::drawingml::convertHmmToEmu(nParaLeftMargin)).getStr() : nullptr,
+ XML_indent, nParaFirstLineIndent ? OString::number(oox::drawingml::convertHmmToEmu(nParaFirstLineIndent)).getStr() : nullptr,
XML_algn, GetAlignment( nAlignment ),
- XML_rtl, bRtl ? ToPsz10(bRtl) : nullptr,
- FSEND );
+ XML_rtl, bRtl ? ToPsz10(bRtl) : nullptr );
else
mpFS->startElementNS( XML_a, XML_pPr,
- XML_lvl, nLevel > 0 ? I32S( nLevel ) : nullptr,
- XML_marL, nLeftMargin > 0 ? I32S( oox::drawingml::convertHmmToEmu( nLeftMargin ) ) : nullptr,
- XML_indent, nLineIndentation ? I32S( oox::drawingml::convertHmmToEmu( nLineIndentation ) ) : nullptr,
+ XML_lvl, nLevel > 0 ? OString::number(nLevel).getStr() : nullptr,
+ XML_marL, nLeftMargin > 0 ? OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)).getStr() : nullptr,
+ XML_indent, nLineIndentation ? OString::number(oox::drawingml::convertHmmToEmu(nLineIndentation)).getStr() : nullptr,
XML_algn, GetAlignment( nAlignment ),
- XML_rtl, bRtl ? ToPsz10(bRtl) : nullptr,
- FSEND );
+ XML_rtl, bRtl ? ToPsz10(bRtl) : nullptr );
if( bHasLinespacing )
{
- mpFS->startElementNS( XML_a, XML_lnSpc, FSEND );
+ mpFS->startElementNS(XML_a, XML_lnSpc);
WriteLinespacing( aLineSpacing );
mpFS->endElementNS( XML_a, XML_lnSpc );
}
if( nParaTopMargin != 0 )
{
- mpFS->startElementNS( XML_a, XML_spcBef, FSEND );
+ mpFS->startElementNS(XML_a, XML_spcBef);
{
mpFS->singleElementNS( XML_a, XML_spcPts,
- XML_val, I32S( std::lround( nParaTopMargin / 25.4 * 72 ) ),
- FSEND );
+ XML_val, OString::number(std::lround(nParaTopMargin / 25.4 * 72)));
}
mpFS->endElementNS( XML_a, XML_spcBef );
}
if( nParaBottomMargin != 0 )
{
- mpFS->startElementNS( XML_a, XML_spcAft, FSEND );
+ mpFS->startElementNS(XML_a, XML_spcAft);
{
mpFS->singleElementNS( XML_a, XML_spcPts,
- XML_val, I32S( std::lround( nParaBottomMargin / 25.4 * 72 ) ),
- FSEND );
+ XML_val, OString::number(std::lround(nParaBottomMargin / 25.4 * 72)));
}
mpFS->endElementNS( XML_a, XML_spcAft );
}
@@ -2507,7 +2477,7 @@ void DrawingML::WriteParagraph( const Reference< XTextContent >& rParagraph,
if( !enumeration.is() )
return;
- mpFS->startElementNS( XML_a, XML_p, FSEND );
+ mpFS->startElementNS(XML_a, XML_p);
bool bPropertiesWritten = false;
while( enumeration->hasMoreElements() )
@@ -2640,26 +2610,24 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
}
mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr,
XML_wrap, pWrap,
- XML_lIns, (nLeft != DEFLRINS) ? IS( oox::drawingml::convertHmmToEmu( nLeft ) ) : nullptr,
- XML_rIns, (nRight != DEFLRINS) ? IS( oox::drawingml::convertHmmToEmu( nRight ) ) : nullptr,
- XML_tIns, (nTop != DEFTBINS) ? IS( oox::drawingml::convertHmmToEmu( nTop ) ) : nullptr,
- XML_bIns, (nBottom != DEFTBINS) ? IS( oox::drawingml::convertHmmToEmu( nBottom ) ) : nullptr,
+ XML_lIns, (nLeft != DEFLRINS) ? OString::number(oox::drawingml::convertHmmToEmu(nLeft)).getStr() : nullptr,
+ XML_rIns, (nRight != DEFLRINS) ? OString::number(oox::drawingml::convertHmmToEmu(nRight)).getStr() : nullptr,
+ XML_tIns, (nTop != DEFTBINS) ? OString::number(oox::drawingml::convertHmmToEmu(nTop)).getStr() : nullptr,
+ XML_bIns, (nBottom != DEFTBINS) ? OString::number(oox::drawingml::convertHmmToEmu(nBottom)).getStr() : nullptr,
XML_anchor, sVerticalAlignment,
XML_anchorCtr, bHorizontalCenter ? "1" : nullptr,
XML_vert, sWritingMode,
- XML_rot, (nTextRotateAngle != 0) ? oox::drawingml::calcRotationValue( nTextRotateAngle * 100 ).getStr() : nullptr,
- FSEND );
+ XML_rot, (nTextRotateAngle != 0) ? oox::drawingml::calcRotationValue( nTextRotateAngle * 100 ).getStr() : nullptr );
if( !presetWarp.isEmpty())
{
- mpFS->singleElementNS(XML_a, XML_prstTxWarp, XML_prst, presetWarp.toUtf8().getStr(),
- FSEND );
+ mpFS->singleElementNS(XML_a, XML_prstTxWarp, XML_prst, presetWarp.toUtf8());
}
if (GetDocumentType() == DOCUMENT_DOCX || GetDocumentType() == DOCUMENT_XLSX)
{
bool bTextAutoGrowHeight = false;
if (GetProperty(rXPropSet, "TextAutoGrowHeight"))
mAny >>= bTextAutoGrowHeight;
- mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit), FSEND);
+ mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit));
}
if (GetDocumentType() == DOCUMENT_PPTX)
{
@@ -2683,14 +2651,14 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
}
mpFS->singleElementNS(XML_a, XML_normAutofit, XML_fontScale,
- ( nFontScale < MAX_SCALE_VAL && nFontScale > 0 ) ? I32S(nFontScale) : nullptr, FSEND);
+ ( nFontScale < MAX_SCALE_VAL && nFontScale > 0 ) ? OString::number(nFontScale).getStr() : nullptr);
}
else
{
bool bTextAutoGrowHeight = false;
if (GetProperty(rXPropSet, "TextAutoGrowHeight"))
mAny >>= bTextAutoGrowHeight;
- mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit), FSEND);
+ mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit));
}
}
mpFS->endElementNS((nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr);
@@ -2750,37 +2718,30 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
void DrawingML::WritePresetShape( const char* pShape , std::vector< std::pair<sal_Int32,sal_Int32>> & rAvList )
{
- mpFS->startElementNS( XML_a, XML_prstGeom,
- XML_prst, pShape,
- FSEND );
+ mpFS->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape);
if ( !rAvList.empty() )
{
- mpFS->startElementNS( XML_a, XML_avLst, FSEND );
+ mpFS->startElementNS(XML_a, XML_avLst);
for (auto const& elem : rAvList)
{
OString sName = OString("adj") + ( ( elem.first > 0 ) ? OString::number(elem.first) : OString() );
OString sFmla = OString("val ") + OString::number( elem.second );
- mpFS->singleElementNS( XML_a, XML_gd,
- XML_name, sName.getStr(),
- XML_fmla, sFmla.getStr(),
- FSEND );
+ mpFS->singleElementNS(XML_a, XML_gd, XML_name, sName, XML_fmla, sFmla);
}
mpFS->endElementNS( XML_a, XML_avLst );
}
else
- mpFS->singleElementNS( XML_a, XML_avLst, FSEND );
+ mpFS->singleElementNS(XML_a, XML_avLst);
mpFS->endElementNS( XML_a, XML_prstGeom );
}
void DrawingML::WritePresetShape( const char* pShape )
{
- mpFS->startElementNS( XML_a, XML_prstGeom,
- XML_prst, pShape,
- FSEND );
- mpFS->singleElementNS( XML_a, XML_avLst, FSEND );
+ mpFS->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape);
+ mpFS->singleElementNS(XML_a, XML_avLst);
mpFS->endElementNS( XML_a, XML_prstGeom );
}
@@ -2815,10 +2776,8 @@ void DrawingML::WritePresetShape( const char* pShape, MSO_SPT eShapeType, bool b
if (aAdjMap.find(OString(pShape)) != aAdjMap.end())
aAdjustments = aAdjMap[OString(pShape)];
- mpFS->startElementNS( XML_a, XML_prstGeom,
- XML_prst, pShape,
- FSEND );
- mpFS->startElementNS( XML_a, XML_avLst, FSEND );
+ mpFS->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape);
+ mpFS->startElementNS(XML_a, XML_avLst);
Sequence< drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq;
if ( ( rProp.Value >>= aAdjustmentSeq )
@@ -2848,8 +2807,7 @@ void DrawingML::WritePresetShape( const char* pShape, MSO_SPT eShapeType, bool b
mpFS->singleElementNS( XML_a, XML_gd,
XML_name, aAdjName,
- XML_fmla, OString("val " + OString::number(nValue)),
- FSEND );
+ XML_fmla, "val " + OString::number(nValue));
}
}
}
@@ -2935,20 +2893,19 @@ bool DrawingML::WriteCustomGeometry(
return false;
}
- mpFS->startElementNS( XML_a, XML_custGeom, FSEND );
- mpFS->singleElementNS( XML_a, XML_avLst, FSEND );
- mpFS->singleElementNS( XML_a, XML_gdLst, FSEND );
- mpFS->singleElementNS( XML_a, XML_ahLst, FSEND );
- mpFS->singleElementNS( XML_a, XML_rect, XML_l, "l", XML_t, "t",
- XML_r, "r", XML_b, "b", FSEND );
- mpFS->startElementNS( XML_a, XML_pathLst, FSEND );
+ mpFS->startElementNS(XML_a, XML_custGeom);
+ mpFS->singleElementNS(XML_a, XML_avLst);
+ mpFS->singleElementNS(XML_a, XML_gdLst);
+ mpFS->singleElementNS(XML_a, XML_ahLst);
+ mpFS->singleElementNS(XML_a, XML_rect, XML_l, "l", XML_t, "t",
+ XML_r, "r", XML_b, "b");
+ mpFS->startElementNS(XML_a, XML_pathLst);
if ( aPathSize.hasElements() )
{
mpFS->startElementNS( XML_a, XML_path,
- XML_w, I64S( aPathSize[0].Width ),
- XML_h, I64S( aPathSize[0].Height ),
- FSEND );
+ XML_w, OString::number(aPathSize[0].Width),
+ XML_h, OString::number(aPathSize[0].Height) );
}
else
{
@@ -2973,9 +2930,8 @@ bool DrawingML::WriteCustomGeometry(
nYMax = nY;
}
mpFS->startElementNS( XML_a, XML_path,
- XML_w, I64S( nXMax - nXMin ),
- XML_h, I64S( nYMax - nYMin ),
- FSEND );
+ XML_w, OString::number(nXMax - nXMin),
+ XML_h, OString::number(nYMax - nYMin) );
}
@@ -2985,7 +2941,7 @@ bool DrawingML::WriteCustomGeometry(
{
if ( aSegments[ j ].Command == drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH )
{
- mpFS->singleElementNS( XML_a, XML_close, FSEND );
+ mpFS->singleElementNS(XML_a, XML_close);
}
for (int k = 0; k < aSegments[j].Count && bOK; ++k)
{
@@ -2997,7 +2953,7 @@ bool DrawingML::WriteCustomGeometry(
bOK = false;
else
{
- mpFS->startElementNS( XML_a, XML_moveTo, FSEND );
+ mpFS->startElementNS(XML_a, XML_moveTo);
WriteCustomGeometryPoint(aPairs[nPairIndex], rSdrObjCustomShape);
mpFS->endElementNS( XML_a, XML_moveTo );
nPairIndex++;
@@ -3010,7 +2966,7 @@ bool DrawingML::WriteCustomGeometry(
bOK = false;
else
{
- mpFS->startElementNS( XML_a, XML_lnTo, FSEND );
+ mpFS->startElementNS(XML_a, XML_lnTo);
WriteCustomGeometryPoint(aPairs[nPairIndex], rSdrObjCustomShape);
mpFS->endElementNS( XML_a, XML_lnTo );
nPairIndex++;
@@ -3023,7 +2979,7 @@ bool DrawingML::WriteCustomGeometry(
bOK = false;
else
{
- mpFS->startElementNS( XML_a, XML_cubicBezTo, FSEND );
+ mpFS->startElementNS(XML_a, XML_cubicBezTo);
for( sal_uInt8 l = 0; l <= 2; ++l )
{
WriteCustomGeometryPoint(aPairs[nPairIndex+l], rSdrObjCustomShape);
@@ -3059,7 +3015,7 @@ bool DrawingML::WriteCustomGeometry(
bOK = false;
else
{
- mpFS->startElementNS( XML_a, XML_quadBezTo, FSEND );
+ mpFS->startElementNS(XML_a, XML_quadBezTo);
for( sal_uInt8 l = 0; l < 2; ++l )
{
WriteCustomGeometryPoint(aPairs[nPairIndex+l], rSdrObjCustomShape);
@@ -3097,10 +3053,7 @@ void DrawingML::WriteCustomGeometryPoint(
sal_Int32 nX = GetCustomGeometryPointValue(rParamPair.First, rSdrObjCustomShape);
sal_Int32 nY = GetCustomGeometryPointValue(rParamPair.Second, rSdrObjCustomShape);
- mpFS->singleElementNS( XML_a, XML_pt,
- XML_x, OString::number(nX).getStr(),
- XML_y, OString::number(nY).getStr(),
- FSEND );
+ mpFS->singleElementNS(XML_a, XML_pt, XML_x, OString::number(nX), XML_y, OString::number(nY));
}
sal_Int32 DrawingML::GetCustomGeometryPointValue(
@@ -3122,27 +3075,21 @@ void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon )
if (rPolyPolygon.Count() < 1 && GetDocumentType() != DOCUMENT_DOCX)
return;
- mpFS->startElementNS( XML_a, XML_custGeom, FSEND );
- mpFS->singleElementNS( XML_a, XML_avLst, FSEND );
- mpFS->singleElementNS( XML_a, XML_gdLst, FSEND );
- mpFS->singleElementNS( XML_a, XML_ahLst, FSEND );
- mpFS->singleElementNS( XML_a, XML_rect,
- XML_l, "0",
- XML_t, "0",
- XML_r, "r",
- XML_b, "b",
- FSEND );
+ mpFS->startElementNS(XML_a, XML_custGeom);
+ mpFS->singleElementNS(XML_a, XML_avLst);
+ mpFS->singleElementNS(XML_a, XML_gdLst);
+ mpFS->singleElementNS(XML_a, XML_ahLst);
+ mpFS->singleElementNS(XML_a, XML_rect, XML_l, "0", XML_t, "0", XML_r, "r", XML_b, "b");
- mpFS->startElementNS( XML_a, XML_pathLst, FSEND );
+ mpFS->startElementNS( XML_a, XML_pathLst );
const tools::Rectangle aRect( rPolyPolygon.GetBoundRect() );
// Put all polygons of rPolyPolygon in the same path element
// to subtract the overlapped areas.
mpFS->startElementNS( XML_a, XML_path,
- XML_w, I64S( aRect.GetWidth() ),
- XML_h, I64S( aRect.GetHeight() ),
- FSEND );
+ XML_w, OString::number(aRect.GetWidth()),
+ XML_h, OString::number(aRect.GetHeight()) );
for( sal_uInt16 i = 0; i < rPolyPolygon.Count(); i ++ )
{
@@ -3151,12 +3098,11 @@ void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon )
if( rPoly.GetSize() > 0 )
{
- mpFS->startElementNS( XML_a, XML_moveTo, FSEND );
+ mpFS->startElementNS(XML_a, XML_moveTo);
mpFS->singleElementNS( XML_a, XML_pt,
- XML_x, I64S( rPoly[ 0 ].X() - aRect.Left() ),
- XML_y, I64S( rPoly[ 0 ].Y() - aRect.Top() ),
- FSEND );
+ XML_x, OString::number(rPoly[0].X() - aRect.Left()),
+ XML_y, OString::number(rPoly[0].Y() - aRect.Top()) );
mpFS->endElementNS( XML_a, XML_moveTo );
}
@@ -3170,13 +3116,12 @@ void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon )
if( j+2 < rPoly.GetSize() && rPoly.GetFlags(j+1) == PolyFlags::Control && rPoly.GetFlags(j+2) != PolyFlags::Control )
{
- mpFS->startElementNS( XML_a, XML_cubicBezTo, FSEND );
+ mpFS->startElementNS(XML_a, XML_cubicBezTo);
for( sal_uInt8 k = 0; k <= 2; ++k )
{
- mpFS->singleElementNS( XML_a, XML_pt,
- XML_x, I64S( rPoly[j+k].X() - aRect.Left() ),
- XML_y, I64S( rPoly[j+k].Y() - aRect.Top() ),
- FSEND );
+ mpFS->singleElementNS(XML_a, XML_pt,
+ XML_x, OString::number(rPoly[j+k].X() - aRect.Left()),
+ XML_y, OString::number(rPoly[j+k].Y() - aRect.Top()));
}
mpFS->endElementNS( XML_a, XML_cubicBezTo );
@@ -3185,11 +3130,10 @@ void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon )
}
else if( flags == PolyFlags::Normal )
{
- mpFS->startElementNS( XML_a, XML_lnTo, FSEND );
+ mpFS->startElementNS(XML_a, XML_lnTo);
mpFS->singleElementNS( XML_a, XML_pt,
- XML_x, I64S( rPoly[j].X() - aRect.Left() ),
- XML_y, I64S( rPoly[j].Y() - aRect.Top() ),
- FSEND );
+ XML_x, OString::number(rPoly[j].X() - aRect.Left()),
+ XML_y, OString::number(rPoly[j].Y() - aRect.Top()) );
mpFS->endElementNS( XML_a, XML_lnTo );
}
}
@@ -3206,16 +3150,14 @@ void DrawingML::WriteConnectorConnections( EscherConnectorListEntry& rConnectorE
if( nStartID != -1 )
{
mpFS->singleElementNS( XML_a, XML_stCxn,
- XML_id, I32S( nStartID ),
- XML_idx, I64S( rConnectorEntry.GetConnectorRule( true ) ),
- FSEND );
+ XML_id, OString::number(nStartID),
+ XML_idx, OString::number(rConnectorEntry.GetConnectorRule(true)) );
}
if( nEndID != -1 )
{
mpFS->singleElementNS( XML_a, XML_endCxn,
- XML_id, I32S( nEndID ),
- XML_idx, I64S( rConnectorEntry.GetConnectorRule( false ) ),
- FSEND );
+ XML_id, OString::number(nEndID),
+ XML_idx, OString::number(rConnectorEntry.GetConnectorRule(false)) );
}
}
@@ -3284,7 +3226,7 @@ void DrawingML::WriteFill( const Reference< XPropertySet >& xPropSet )
WritePattFill( xPropSet );
break;
case FillStyle_NONE:
- mpFS->singleElementNS( XML_a, XML_noFill, FSEND );
+ mpFS->singleElementNS(XML_a, XML_noFill);
break;
default:
;
@@ -3307,14 +3249,14 @@ void DrawingML::WriteStyleProperties( sal_Int32 nTokenId, const Sequence< Proper
else if( aProperties[i].Name == "Transformations" )
aProperties[i].Value >>= aTransformations;
}
- mpFS->startElementNS( XML_a, nTokenId, XML_idx, I32S( nIdx ), FSEND );
+ mpFS->startElementNS(XML_a, nTokenId, XML_idx, OString::number(nIdx));
WriteColor(sSchemeClr, aTransformations);
mpFS->endElementNS( XML_a, nTokenId );
}
else
{
// write mock <a:*Ref> tag
- mpFS->singleElementNS( XML_a, nTokenId, XML_idx, I32S( 0 ), FSEND );
+ mpFS->singleElementNS(XML_a, nTokenId, XML_idx, OString::number(0));
}
}
@@ -3343,7 +3285,7 @@ void DrawingML::WriteShapeStyle( const Reference< XPropertySet >& xPropSet )
WriteStyleProperties( XML_effectRef, aEffectRefProperties );
// write mock <a:fontRef>
- mpFS->singleElementNS( XML_a, XML_fontRef, XML_idx, "minor", FSEND );
+ mpFS->singleElementNS(XML_a, XML_fontRef, XML_idx, "minor");
}
void DrawingML::WriteShapeEffect( const OUString& sName, const Sequence< PropertyValue >& aEffectProps )
@@ -3586,7 +3528,7 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet )
aShadowGrabBag[2].Name = "RgbClrTransparency";
aShadowGrabBag[2].Value = rXPropSet->getPropertyValue( "ShadowTransparence" );
- mpFS->startElementNS(XML_a, XML_effectLst, FSEND);
+ mpFS->startElementNS(XML_a, XML_effectLst);
WriteShapeEffect( "outerShdw", aShadowGrabBag );
mpFS->endElementNS(XML_a, XML_effectLst);
}
@@ -3628,7 +3570,7 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet )
}
}
- mpFS->startElementNS(XML_a, XML_effectLst, FSEND);
+ mpFS->startElementNS(XML_a, XML_effectLst);
for( sal_Int32 i=0; i < aEffects.getLength(); ++i )
{
if( aEffects[i].Name == "outerShdw" )
@@ -3753,7 +3695,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
}
}
- mpFS->startElementNS( XML_a, XML_scene3d, FSEND );
+ mpFS->startElementNS(XML_a, XML_scene3d);
if( aEffectProps.getLength() > 0 )
{
@@ -3767,7 +3709,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
else
{
// a:camera with Word default values - Word won't open the document if this is not present
- mpFS->singleElementNS( XML_a, XML_camera, XML_prst, "orthographicFront", FSEND );
+ mpFS->singleElementNS(XML_a, XML_camera, XML_prst, "orthographicFront");
}
if( aEffectProps.getLength() > 0 )
@@ -3782,7 +3724,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
else
{
// a:lightRig with Word default values - Word won't open the document if this is not present
- mpFS->singleElementNS( XML_a, XML_lightRig, XML_rig, "threePt", XML_dir, "t", FSEND );
+ mpFS->singleElementNS(XML_a, XML_lightRig, XML_rig, "threePt", XML_dir, "t");
}
mpFS->endElementNS( XML_a, XML_scene3d );
@@ -3893,7 +3835,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
else if( aExtrusionColorProps[i].Name == "rgbClrTransparency" )
aExtrusionColorProps[i].Value >>= nTransparency;
}
- mpFS->startElementNS( XML_a, XML_extrusionClr, FSEND );
+ mpFS->startElementNS(XML_a, XML_extrusionClr);
if( sSchemeClr.isEmpty() )
WriteColor( nColor, MAX_PERCENT - ( PER_PERCENT * nTransparency ) );
@@ -3919,7 +3861,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
else if( aContourColorProps[i].Name == "rgbClrTransparency" )
aContourColorProps[i].Value >>= nTransparency;
}
- mpFS->startElementNS( XML_a, XML_contourClr, FSEND );
+ mpFS->startElementNS(XML_a, XML_contourClr);
if( sSchemeClr.isEmpty() )
WriteColor( nColor, MAX_PERCENT - ( PER_PERCENT * nTransparency ) );
@@ -3981,17 +3923,12 @@ void DrawingML::WriteArtisticEffect( const Reference< XPropertySet >& rXPropSet
}
}
- mpFS->startElementNS( XML_a, XML_extLst, FSEND );
- mpFS->startElementNS( XML_a, XML_ext,
- XML_uri, "{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}",
- FSEND );
+ mpFS->startElementNS(XML_a, XML_extLst);
+ mpFS->startElementNS(XML_a, XML_ext, XML_uri, "{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}");
mpFS->startElementNS( XML_a14, XML_imgProps,
- FSNS( XML_xmlns, XML_a14 ), OUStringToOString(mpFB->getNamespaceURL(OOX_NS(a14)), RTL_TEXTENCODING_UTF8).getStr(),
- FSEND );
- mpFS->startElementNS( XML_a14, XML_imgLayer,
- FSNS( XML_r, XML_embed), sRelId.getStr(),
- FSEND );
- mpFS->startElementNS( XML_a14, XML_imgEffect, FSEND );
+ FSNS(XML_xmlns, XML_a14), mpFB->getNamespaceURL(OOX_NS(a14)).toUtf8() );
+ mpFS->startElementNS(XML_a14, XML_imgLayer, FSNS(XML_r, XML_embed), sRelId);
+ mpFS->startElementNS(XML_a14, XML_imgEffect);
sax_fastparser::XFastAttributeListRef xAttrList( aAttrList );
mpFS->singleElementNS( XML_a14, nEffectToken, xAttrList );
@@ -4083,31 +4020,27 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX
if (GetDocumentType() == DOCUMENT_DOCX)
{
mpFS->singleElementNS(XML_wp, XML_docPr, xDocPrAttrListRef);
- mpFS->singleElementNS(XML_wp, XML_cNvGraphicFramePr, FSEND);
+ mpFS->singleElementNS(XML_wp, XML_cNvGraphicFramePr);
mpFS->startElementNS(
XML_a, XML_graphic, FSNS(XML_xmlns, XML_a),
- OUStringToOString(mpFB->getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8).getStr(),
- FSEND);
+ mpFB->getNamespaceURL(OOX_NS(dml)).toUtf8());
}
else
{
- mpFS->startElementNS(XML_p, XML_nvGraphicFramePr, FSEND);
+ mpFS->startElementNS(XML_p, XML_nvGraphicFramePr);
mpFS->singleElementNS(XML_p, XML_cNvPr, xDocPrAttrListRef);
- mpFS->singleElementNS(XML_p, XML_cNvGraphicFramePr, FSEND);
+ mpFS->singleElementNS(XML_p, XML_cNvGraphicFramePr);
- mpFS->startElementNS(XML_p, XML_nvPr, FSEND);
- mpFS->startElementNS(XML_p, XML_extLst, FSEND);
+ mpFS->startElementNS(XML_p, XML_nvPr);
+ mpFS->startElementNS(XML_p, XML_extLst);
// change tracking extension - required in PPTX
- mpFS->startElementNS(XML_p, XML_ext, XML_uri, "{D42A27DB-BD31-4B8C-83A1-F6EECF244321}",
- FSEND);
- mpFS->singleElementNS(
- XML_p14, XML_modId, FSNS(XML_xmlns, XML_p14),
- OUStringToOString(mpFB->getNamespaceURL(OOX_NS(p14)), RTL_TEXTENCODING_UTF8).getStr(),
+ mpFS->startElementNS(XML_p, XML_ext, XML_uri, "{D42A27DB-BD31-4B8C-83A1-F6EECF244321}");
+ mpFS->singleElementNS(XML_p14, XML_modId,
+ FSNS(XML_xmlns, XML_p14), mpFB->getNamespaceURL(OOX_NS(p14)).toUtf8(),
XML_val,
- OString::number(comphelper::rng::uniform_uint_distribution(1, SAL_MAX_UINT32)).getStr(),
- FSEND);
+ OString::number(comphelper::rng::uniform_uint_distribution(1, SAL_MAX_UINT32)));
mpFS->endElementNS(XML_p, XML_ext);
mpFS->endElementNS(XML_p, XML_extLst);
mpFS->endElementNS(XML_p, XML_nvPr);
@@ -4119,11 +4052,11 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX
WriteTransformation(tools::Rectangle(Point(aPos.X, aPos.Y), Size(aSize.Width, aSize.Height)),
XML_p, false, false, 0, false);
- mpFS->startElementNS(XML_a, XML_graphic, FSEND);
+ mpFS->startElementNS(XML_a, XML_graphic);
}
mpFS->startElementNS(XML_a, XML_graphicData, XML_uri,
- "http://schemas.openxmlformats.org/drawingml/2006/diagram", FSEND);
+ "http://schemas.openxmlformats.org/drawingml/2006/diagram");
OUString sRelationCompPrefix = OUString::createFromAscii(GetRelationCompPrefix());
@@ -4185,14 +4118,11 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX
relIdNode->setNodeValue(drawingRelId);
}
- mpFS->singleElementNS(
- XML_dgm, XML_relIds, FSNS(XML_xmlns, XML_dgm),
- OUStringToOString(mpFB->getNamespaceURL(OOX_NS(dmlDiagram)), RTL_TEXTENCODING_UTF8)
- .getStr(),
- FSNS(XML_xmlns, XML_r),
- OUStringToOString(mpFB->getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(),
- FSNS(XML_r, XML_dm), dataRelId.getStr(), FSNS(XML_r, XML_lo), layoutRelId.getStr(),
- FSNS(XML_r, XML_qs), styleRelId.getStr(), FSNS(XML_r, XML_cs), colorRelId.getStr(), FSEND);
+ mpFS->singleElementNS(XML_dgm, XML_relIds,
+ FSNS(XML_xmlns, XML_dgm), mpFB->getNamespaceURL(OOX_NS(dmlDiagram)).toUtf8(),
+ FSNS(XML_xmlns, XML_r), mpFB->getNamespaceURL(OOX_NS(officeRel)).toUtf8(),
+ FSNS(XML_r, XML_dm), dataRelId, FSNS(XML_r, XML_lo), layoutRelId,
+ FSNS(XML_r, XML_qs), styleRelId, FSNS(XML_r, XML_cs), colorRelId);
mpFS->endElementNS(XML_a, XML_graphicData);
mpFS->endElementNS(XML_a, XML_graphic);
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index b89f1d966868..5005459ffddf 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -118,7 +118,7 @@ using ::css::frame::XModel;
using ::oox::core::XmlFilterBase;
using ::sax_fastparser::FSHelperPtr;
-#define IDS(x) OString(OStringLiteral(#x " ") + OString::number( mnShapeIdMax++ )).getStr()
+#define IDS(x) OString(#x " " + OString::number(mnShapeIdMax++)).getStr()
namespace oox {
@@ -423,7 +423,7 @@ ShapeExport& ShapeExport::WritePolyPolygonShape( const Reference< XShape >& xSha
SAL_INFO("oox.shape", "write polypolygon shape");
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND );
+ pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp));
tools::PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon( xShape );
tools::Rectangle aRect( aPolyPolygon.GetBoundRect() );
@@ -437,13 +437,12 @@ ShapeExport& ShapeExport::WritePolyPolygonShape( const Reference< XShape >& xSha
// non visual shape properties
if (GetDocumentType() != DOCUMENT_DOCX)
{
- pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_nvSpPr);
pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
- XML_name, IDS( Freeform ),
- FSEND );
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, IDS( Freeform ) );
}
- pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND );
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr);
if (GetDocumentType() != DOCUMENT_DOCX)
{
WriteNonVisualProperties( xShape );
@@ -451,7 +450,7 @@ ShapeExport& ShapeExport::WritePolyPolygonShape( const Reference< XShape >& xSha
}
// visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_spPr);
WriteTransformation( aRect, XML_a );
WritePolyPolygon( aPolyPolygon );
Reference< XPropertySet > xProps( xShape, UNO_QUERY );
@@ -494,25 +493,24 @@ ShapeExport& ShapeExport::WriteGroupShape(const uno::Reference<drawing::XShape>&
mnXmlNamespace = XML_wpg;
}
- pFS->startElementNS(mnXmlNamespace, nGroupShapeToken, FSEND);
+ pFS->startElementNS(mnXmlNamespace, nGroupShapeToken);
// non visual properties
if (GetDocumentType() != DOCUMENT_DOCX)
{
- pFS->startElementNS(mnXmlNamespace, XML_nvGrpSpPr, FSEND);
+ pFS->startElementNS(mnXmlNamespace, XML_nvGrpSpPr);
pFS->singleElementNS(mnXmlNamespace, XML_cNvPr,
- XML_id, I32S(GetNewShapeID(xShape)),
- XML_name, IDS(Group),
- FSEND);
- pFS->singleElementNS(mnXmlNamespace, XML_cNvGrpSpPr, FSEND);
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, IDS(Group));
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvGrpSpPr);
WriteNonVisualProperties(xShape );
pFS->endElementNS(mnXmlNamespace, XML_nvGrpSpPr);
}
else
- pFS->singleElementNS(mnXmlNamespace, XML_cNvGrpSpPr, FSEND);
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvGrpSpPr);
// visual properties
- pFS->startElementNS(mnXmlNamespace, XML_grpSpPr, FSEND);
+ pFS->startElementNS(mnXmlNamespace, XML_grpSpPr);
WriteShapeTransformation(xShape, XML_a, false, false, true);
pFS->endElementNS(mnXmlNamespace, XML_grpSpPr);
@@ -763,7 +761,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
}
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND );
+ pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp));
// non visual shape properties
if (GetDocumentType() != DOCUMENT_DOCX)
@@ -773,12 +771,11 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
{
mAny >>= isVisible;
}
- pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+ pFS->startElementNS( mnXmlNamespace, XML_nvSpPr );
pFS->startElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
+ XML_id, OString::number(GetNewShapeID(xShape)),
XML_name, IDS( CustomShape ),
- XML_hidden, isVisible ? nullptr : "1",
- FSEND );
+ XML_hidden, isVisible ? nullptr : "1" );
if( GETA( URL ) )
{
@@ -791,21 +788,19 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
mpURLTransformer->getTransformedString(sURL),
mpURLTransformer->isExternalURL(sURL));
- mpFS->singleElementNS( XML_a, XML_hlinkClick,
- FSNS(XML_r,XML_id), sRelId.toUtf8(),
- FSEND );
+ mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId.toUtf8());
}
}
pFS->endElementNS(mnXmlNamespace, XML_cNvPr);
- pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND );
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr);
WriteNonVisualProperties( xShape );
pFS->endElementNS( mnXmlNamespace, XML_nvSpPr );
}
else
- pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr, FSEND);
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr);
// visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_spPr);
// moon is flipped in MSO, and mso-spt89 (right up arrow) is mapped to leftUpArrow
if ( sShapeType == "moon" || sShapeType == "mso-spt89" )
bFlipH = !bFlipH;
@@ -1000,7 +995,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
pFS->endElementNS( mnXmlNamespace, XML_spPr );
- pFS->startElementNS( mnXmlNamespace, XML_style, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_style);
WriteShapeStyle( rXPropSet );
pFS->endElementNS( mnXmlNamespace, XML_style );
@@ -1018,27 +1013,26 @@ ShapeExport& ShapeExport::WriteEllipseShape( const Reference< XShape >& xShape )
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND );
+ pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp));
// TODO: arc, section, cut, connector
// non visual shape properties
if (GetDocumentType() != DOCUMENT_DOCX)
{
- pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_nvSpPr);
pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
- XML_name, IDS( Ellipse ),
- FSEND );
- pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND );
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, IDS( Ellipse ) );
+ pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr );
WriteNonVisualProperties( xShape );
pFS->endElementNS( mnXmlNamespace, XML_nvSpPr );
}
else
- pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr, FSEND);
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr);
// visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
+ pFS->startElementNS( mnXmlNamespace, XML_spPr );
WriteShapeTransformation( xShape, XML_a );
WritePresetShape( "ellipse" );
Reference< XPropertySet > xProps( xShape, UNO_QUERY );
@@ -1111,13 +1105,12 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
XmlFilterBase* pFB = GetFB();
if (GetDocumentType() != DOCUMENT_DOCX)
- pFS->startElementNS( mnXmlNamespace, XML_pic, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_pic);
else
- pFS->startElementNS( mnXmlNamespace, XML_pic,
- FSNS(XML_xmlns, XML_pic), OUStringToOString(pFB->getNamespaceURL(OOX_NS(dmlPicture)), RTL_TEXTENCODING_UTF8).getStr(),
- FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_pic,
+ FSNS(XML_xmlns, XML_pic), pFB->getNamespaceURL(OOX_NS(dmlPicture)).toUtf8());
- pFS->startElementNS( mnXmlNamespace, XML_nvPicPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_nvPicPr);
OUString sName, sDescr, sURL;
bool bHaveName, bHaveDesc, bHaveURL;
@@ -1130,19 +1123,17 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
mAny >>= sURL;
pFS->startElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
+ XML_id, OString::number(GetNewShapeID(xShape)),
XML_name, bHaveName
? sName.toUtf8()
: OString("Picture " + OString::number(mnPictureIdMax++)),
- XML_descr, bHaveDesc ? sDescr.toUtf8().getStr() : nullptr,
- FSEND );
+ XML_descr, bHaveDesc ? sDescr.toUtf8().getStr() : nullptr );
// OOXTODO: //cNvPr children: XML_extLst, XML_hlinkHover
if (bHasMediaURL)
pFS->singleElementNS(XML_a, XML_hlinkClick,
FSNS(XML_r, XML_id), "",
- XML_action, "ppaction://media",
- FSEND);
+ XML_action, "ppaction://media");
if( !sURL.isEmpty() )
{
OUString sRelId = mpFB->addRelation( mpFS->getOutputStream(),
@@ -1150,15 +1141,13 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
mpURLTransformer->getTransformedString(sURL),
mpURLTransformer->isExternalURL(sURL));
- mpFS->singleElementNS( XML_a, XML_hlinkClick,
- FSNS( XML_r,XML_id ), sRelId.toUtf8(),
- FSEND );
+ mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId.toUtf8());
}
pFS->endElementNS(mnXmlNamespace, XML_cNvPr);
- pFS->singleElementNS( mnXmlNamespace, XML_cNvPicPr,
- // OOXTODO: XML_preferRelativeSize
- FSEND );
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvPicPr
+ // OOXTODO: XML_preferRelativeSize
+ );
if (bHasMediaURL)
WriteMediaNonVisualProperties(xShape);
else
@@ -1166,7 +1155,7 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
pFS->endElementNS( mnXmlNamespace, XML_nvPicPr );
- pFS->startElementNS( mnXmlNamespace, XML_blipFill, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_blipFill);
if (xGraphic.is())
{
@@ -1193,12 +1182,12 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
mAny >>= bStretch;
if ( pGraphic || bStretch )
- pFS->singleElementNS( XML_a, XML_stretch, FSEND );
+ pFS->singleElementNS(XML_a, XML_stretch);
pFS->endElementNS( mnXmlNamespace, XML_blipFill );
// visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_spPr);
bool bFlipH = false;
if( xShapeProps->getPropertySetInfo()->hasPropertyByName("IsMirrored") )
{
@@ -1275,23 +1264,22 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape
aRect.setHeight( aStartPoint.Y - aEndPoint.Y );
}
- pFS->startElementNS( mnXmlNamespace, XML_cxnSp, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_cxnSp);
// non visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_nvCxnSpPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_nvCxnSpPr);
pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
- XML_name, IDS( Line ),
- FSEND );
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, IDS( Line ) );
// non visual connector shape drawing properties
- pFS->startElementNS( mnXmlNamespace, XML_cNvCxnSpPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_cNvCxnSpPr);
WriteConnectorConnections( aConnectorEntry, GetShapeID( rXShapeA ), GetShapeID( rXShapeB ) );
pFS->endElementNS( mnXmlNamespace, XML_cNvCxnSpPr );
- pFS->singleElementNS( mnXmlNamespace, XML_nvPr, FSEND );
+ pFS->singleElementNS(mnXmlNamespace, XML_nvPr);
pFS->endElementNS( mnXmlNamespace, XML_nvCxnSpPr );
// visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_spPr);
WriteTransformation( aRect, XML_a, bFlipH, bFlipV );
// TODO: write adjustments (ppt export doesn't work well there either)
WritePresetShape( sGeometry );
@@ -1317,7 +1305,7 @@ ShapeExport& ShapeExport::WriteLineShape( const Reference< XShape >& xShape )
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND );
+ pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp));
tools::PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon( xShape );
if( aPolyPolygon.Count() == 1 && aPolyPolygon[ 0 ].GetSize() == 2)
@@ -1331,13 +1319,12 @@ ShapeExport& ShapeExport::WriteLineShape( const Reference< XShape >& xShape )
// non visual shape properties
if (GetDocumentType() != DOCUMENT_DOCX)
{
- pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_nvSpPr);
pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
- XML_name, IDS( Line ),
- FSEND );
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, IDS( Line ) );
}
- pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND );
+ pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr );
if (GetDocumentType() != DOCUMENT_DOCX)
{
WriteNonVisualProperties( xShape );
@@ -1345,7 +1332,7 @@ ShapeExport& ShapeExport::WriteLineShape( const Reference< XShape >& xShape )
}
// visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_spPr);
WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV, true);
WritePresetShape( "line" );
Reference< XPropertySet > xShapeProps( xShape, UNO_QUERY );
@@ -1354,7 +1341,7 @@ ShapeExport& ShapeExport::WriteLineShape( const Reference< XShape >& xShape )
pFS->endElementNS( mnXmlNamespace, XML_spPr );
//write style
- pFS->startElementNS( mnXmlNamespace, XML_style, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_style);
WriteShapeStyle( xShapeProps );
pFS->endElementNS( mnXmlNamespace, XML_style );
@@ -1369,9 +1356,8 @@ ShapeExport& ShapeExport::WriteLineShape( const Reference< XShape >& xShape )
ShapeExport& ShapeExport::WriteNonVisualDrawingProperties( const Reference< XShape >& xShape, const char* pName )
{
GetFS()->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
- XML_name, pName,
- FSEND );
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, pName );
return *this;
}
@@ -1388,7 +1374,7 @@ ShapeExport& ShapeExport::WriteRectangleShape( const Reference< XShape >& xShape
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND );
+ pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp));
sal_Int32 nRadius = 0;
@@ -1407,18 +1393,17 @@ ShapeExport& ShapeExport::WriteRectangleShape( const Reference< XShape >& xShape
// non visual shape properties
if (GetDocumentType() == DOCUMENT_DOCX)
- pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND );
- pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr);
+ pFS->startElementNS(mnXmlNamespace, XML_nvSpPr);
pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
- XML_name, IDS( Rectangle ),
- FSEND );
- pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND );
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, IDS( Rectangle ) );
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr);
WriteNonVisualProperties( xShape );
pFS->endElementNS( mnXmlNamespace, XML_nvSpPr );
// visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_spPr);
WriteShapeTransformation( xShape, XML_a );
WritePresetShape( nRadius == 0 ? "rect" : "roundRect" );
Reference< XPropertySet > xProps( xShape, UNO_QUERY );
@@ -1515,14 +1500,15 @@ ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, s
{
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( nXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_txBody : XML_txbx), FSEND );
+ pFS->startElementNS(nXmlNamespace,
+ (GetDocumentType() != DOCUMENT_DOCX ? XML_txBody : XML_txbx));
WriteText( xIface, m_presetWarp, /*bBodyPr=*/(GetDocumentType() != DOCUMENT_DOCX) );
pFS->endElementNS( nXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_txBody : XML_txbx) );
if (GetDocumentType() == DOCUMENT_DOCX)
WriteText( xIface, m_presetWarp, /*bBodyPr=*/true, /*bText=*/false, /*nXmlNamespace=*/nXmlNamespace );
}
else if (GetDocumentType() == DOCUMENT_DOCX)
- mpFS->singleElementNS(nXmlNamespace, XML_bodyPr, FSEND);
+ mpFS->singleElementNS(nXmlNamespace, XML_bodyPr);
return *this;
}
@@ -1532,20 +1518,21 @@ void ShapeExport::WriteTable( const Reference< XShape >& rXShape )
Reference< XTable > xTable;
Reference< XPropertySet > xPropSet( rXShape, UNO_QUERY );
- mpFS->startElementNS( XML_a, XML_graphic, FSEND );
- mpFS->startElementNS( XML_a, XML_graphicData, XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/table", FSEND );
+ mpFS->startElementNS(XML_a, XML_graphic);
+ mpFS->startElementNS(XML_a, XML_graphicData,
+ XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/table");
if ( xPropSet.is() && ( xPropSet->getPropertyValue( "Model" ) >>= xTable ) )
{
- mpFS->startElementNS( XML_a, XML_tbl, FSEND );
- mpFS->singleElementNS( XML_a, XML_tblPr, FSEND );
+ mpFS->startElementNS(XML_a, XML_tbl);
+ mpFS->singleElementNS(XML_a, XML_tblPr);
Reference< container::XIndexAccess > xColumns( xTable->getColumns(), UNO_QUERY_THROW );
Reference< container::XIndexAccess > xRows( xTable->getRows(), UNO_QUERY_THROW );
sal_uInt16 nRowCount = static_cast< sal_uInt16 >( xRows->getCount() );
sal_uInt16 nColumnCount = static_cast< sal_uInt16 >( xColumns->getCount() );
- mpFS->startElementNS( XML_a, XML_tblGrid, FSEND );
+ mpFS->startElementNS(XML_a, XML_tblGrid);
for ( sal_Int32 x = 0; x < nColumnCount; x++ )
{
@@ -1553,7 +1540,8 @@ void ShapeExport::WriteTable( const Reference< XShape >& rXShape )
sal_Int32 nWidth(0);
xColPropSet->getPropertyValue( "Width" ) >>= nWidth;
- mpFS->singleElementNS( XML_a, XML_gridCol, XML_w, I64S(oox::drawingml::convertHmmToEmu(nWidth)), FSEND );
+ mpFS->singleElementNS(XML_a, XML_gridCol,
+ XML_w, OString::number(oox::drawingml::convertHmmToEmu(nWidth)));
}
mpFS->endElementNS( XML_a, XML_tblGrid );
@@ -1569,7 +1557,8 @@ void ShapeExport::WriteTable( const Reference< XShape >& rXShape )
xRowPropSet->getPropertyValue( "Height" ) >>= nRowHeight;
- mpFS->startElementNS( XML_a, XML_tr, XML_h, I64S( oox::drawingml::convertHmmToEmu( nRowHeight ) ), FSEND );
+ mpFS->startElementNS(XML_a, XML_tr,
+ XML_h, OString::number(oox::drawingml::convertHmmToEmu(nRowHeight)));
for( sal_Int32 nColumn = 0; nColumn < nColumnCount; nColumn++ )
{
Reference< XMergeableCell > xCell( xTable->getCellByPosition( nColumn, nRow ),
@@ -1582,10 +1571,9 @@ void ShapeExport::WriteTable( const Reference< XShape >& rXShape )
if(xCell->getColumnSpan() > 1 && xCell->getRowSpan() > 1)
{
// having both : horizontal and vertical merge
- mpFS->startElementNS(XML_a, XML_tc, XML_gridSpan,
- I32S(xCell->getColumnSpan()),
- XML_rowSpan, I32S(xCell->getRowSpan()),
- FSEND);
+ mpFS->startElementNS(XML_a, XML_tc,
+ XML_gridSpan, OString::number(xCell->getColumnSpan()),
+ XML_rowSpan, OString::number(xCell->getRowSpan()));
// since, XMergeableCell doesn't have the information about
// cell having hMerge or vMerge.
// So, Populating the merged cell map in-order to use it to
@@ -1605,8 +1593,8 @@ void ShapeExport::WriteTable( const Reference< XShape >& rXShape )
else if(xCell->getColumnSpan() > 1)
{
// having : horizontal merge
- mpFS->startElementNS(XML_a, XML_tc, XML_gridSpan,
- I32S(xCell->getColumnSpan()), FSEND);
+ mpFS->startElementNS(XML_a, XML_tc,
+ XML_gridSpan, OString::number(xCell->getColumnSpan()));
for(sal_Int32 columnIndex = nColumn; columnIndex < nColumn + xCell->getColumnSpan(); ++columnIndex) {
sal_Int32 transposeIndexForMergeCell = (nRow*nColumnCount) + columnIndex;
mergedCellMap[transposeIndexForMergeCell] =
@@ -1616,8 +1604,8 @@ void ShapeExport::WriteTable( const Reference< XShape >& rXShape )
else if(xCell->getRowSpan() > 1)
{
// having : vertical merge
- mpFS->startElementNS(XML_a, XML_tc, XML_rowSpan,
- I32S(xCell->getRowSpan()), FSEND);
+ mpFS->startElementNS(XML_a, XML_tc,
+ XML_rowSpan, OString::number(xCell->getRowSpan()));
for(sal_Int32 rowIndex = nRow; rowIndex < nRow + xCell->getRowSpan(); ++rowIndex) {
sal_Int32 transposeIndexForMergeCell = (rowIndex*nColumnCount) + nColumn;
@@ -1632,7 +1620,7 @@ void ShapeExport::WriteTable( const Reference< XShape >& rXShape )
if(!xCell->isMerged())
{
// independent cell
- mpFS->startElementNS( XML_a, XML_tc, FSEND );
+ mpFS->startElementNS(XML_a, XML_tc);
}
else
{
@@ -1652,16 +1640,15 @@ void ShapeExport::WriteTable( const Reference< XShape >& rXShape )
if(parentCell->getColumnSpan() > 1)
{
// vMerge and has gridSpan
- mpFS->startElementNS( XML_a, XML_tc,
- XML_vMerge, I32S(1),
- XML_gridSpan, I32S(xCell->getColumnSpan()),
- FSEND );
+ mpFS->startElementNS(XML_a, XML_tc,
+ XML_vMerge, OString::number(1),
+ XML_gridSpan, OString::number(xCell->getColumnSpan()));
}
else
{
// only vMerge
- mpFS->startElementNS( XML_a, XML_tc,
- XML_vMerge, I32S(1), FSEND );
+ mpFS->startElementNS(XML_a, XML_tc,
+ XML_vMerge, OString::number(1));
}
}
else if(nRow == parentRowIndex)
@@ -1670,25 +1657,23 @@ void ShapeExport::WriteTable( const Reference< XShape >& rXShape )
if(parentCell->getRowSpan() > 1)
{
// hMerge and has rowspan
- mpFS->startElementNS( XML_a, XML_tc,
- XML_hMerge, I32S(1),
- XML_rowSpan, I32S(xCell->getRowSpan()),
- FSEND );
+ mpFS->startElementNS(XML_a, XML_tc,
+ XML_hMerge, OString::number(1),
+ XML_rowSpan, OString::number(xCell->getRowSpan()));
}
else
{
// only hMerge
- mpFS->startElementNS( XML_a, XML_tc,
- XML_hMerge, I32S(1), FSEND );
+ mpFS->startElementNS(XML_a, XML_tc,
+ XML_hMerge, OString::number(1));
}
}
else
{
// has hMerge and vMerge
- mpFS->startElementNS( XML_a, XML_tc,
- XML_vMerge, I32S(1),
- XML_hMerge, I32S(1),
- FSEND );
+ mpFS->startElementNS(XML_a, XML_tc,
+ XML_vMerge, OString::number(1),
+ XML_hMerge, OString::number(1));
}
}
else
@@ -1727,10 +1712,9 @@ void ShapeExport::WriteTableCellProperties(const Reference< XPropertySet>& xCell
Any aRightMargin = xCellPropSet->getPropertyValue("TextRightDistance");
aRightMargin >>= nRightMargin;
- mpFS->startElementNS( XML_a, XML_tcPr,
- XML_marL, nLeftMargin > 0 ? I32S( oox::drawingml::convertHmmToEmu( nLeftMargin ) ) : nullptr,
- XML_marR, nRightMargin > 0 ? I32S( oox::drawingml::convertHmmToEmu( nRightMargin ) ): nullptr,
- FSEND );
+ mpFS->startElementNS(XML_a, XML_tcPr,
+ XML_marL, nLeftMargin > 0 ? OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)).getStr() : nullptr,
+ XML_marR, nRightMargin > 0 ? OString::number(oox::drawingml::convertHmmToEmu(nRightMargin)).getStr() : nullptr);
// Write background fill for table cell.
// TODO
@@ -1750,9 +1734,9 @@ void ShapeExport::WriteBorderLine(const sal_Int32 XML_line, const BorderLine2& r
if ( nBorderWidth > 0 )
{
- mpFS->startElementNS( XML_a, XML_line, XML_w, I32S(nBorderWidth), FSEND );
+ mpFS->startElementNS(XML_a, XML_line, XML_w, OString::number(nBorderWidth));
if ( rBorderLine.Color == sal_Int32( COL_AUTO ) )
- mpFS->singleElementNS( XML_a, XML_noFill, FSEND );
+ mpFS->singleElementNS(XML_a, XML_noFill);
else
DrawingML::WriteSolidFill( ::Color(rBorderLine.Color) );
mpFS->endElementNS( XML_a, XML_line );
@@ -1784,21 +1768,18 @@ ShapeExport& ShapeExport::WriteTableShape( const Reference< XShape >& xShape )
{
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( mnXmlNamespace, XML_graphicFrame, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_graphicFrame);
- pFS->startElementNS( mnXmlNamespace, XML_nvGraphicFramePr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_nvGraphicFramePr);
pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
- XML_name, IDS(Table),
- FSEND );
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, IDS(Table) );
- 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 );
WriteShapeTransformation( xShape, mnXmlNamespace );
@@ -1813,15 +1794,15 @@ ShapeExport& ShapeExport::WriteTextShape( const Reference< XShape >& xShape )
{
FSHelperPtr pFS = GetFS();
- pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND );
+ pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp));
// non visual shape properties
if (GetDocumentType() != DOCUMENT_DOCX)
{
- pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_nvSpPr);
WriteNonVisualDrawingProperties( xShape, IDS( TextShape ) );
}
- pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, XML_txBox, "1", FSEND );
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr, XML_txBox, "1");
if (GetDocumentType() != DOCUMENT_DOCX)
{
WriteNonVisualProperties( xShape );
@@ -1829,7 +1810,7 @@ ShapeExport& ShapeExport::WriteTextShape( const Reference< XShape >& xShape )
}
// visual shape properties
- pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
+ pFS->startElementNS(mnXmlNamespace, XML_spPr);
WriteShapeTransformation( xShape, XML_a );
WritePresetShape( "rect" );
uno::Reference<beans::XPropertySet> xPropertySet(xShape, UNO_QUERY);
@@ -1857,29 +1838,27 @@ void ShapeExport::WriteMathShape(Reference<XShape> const& xShape)
// ECMA standard does not actually allow oMath outside of
// WordProcessingML so write a MCE like PPT 2010 does
- mpFS->startElementNS(XML_mc, XML_AlternateContent, FSEND);
+ mpFS->startElementNS(XML_mc, XML_AlternateContent);
mpFS->startElementNS(XML_mc, XML_Choice,
- FSNS(XML_xmlns, XML_a14), OUStringToOString(mpFB->getNamespaceURL(OOX_NS(a14)), RTL_TEXTENCODING_UTF8).getStr(),
- XML_Requires, "a14",
- FSEND);
- mpFS->startElementNS(mnXmlNamespace, XML_sp, FSEND);
- mpFS->startElementNS(mnXmlNamespace, XML_nvSpPr, FSEND);
+ FSNS(XML_xmlns, XML_a14), mpFB->getNamespaceURL(OOX_NS(a14)).toUtf8(),
+ XML_Requires, "a14");
+ mpFS->startElementNS(mnXmlNamespace, XML_sp);
+ mpFS->startElementNS(mnXmlNamespace, XML_nvSpPr);
mpFS->singleElementNS(mnXmlNamespace, XML_cNvPr,
- XML_id, OString::number(GetNewShapeID(xShape)).getStr(),
- XML_name, OString("Formula " + OString::number(mnShapeIdMax++)).getStr(),
- FSEND);
- mpFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr, XML_txBox, "1", FSEND);
- mpFS->singleElementNS(mnXmlNamespace, XML_nvPr, FSEND);
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, IDS(Formula));
+ mpFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr, XML_txBox, "1");
+ mpFS->singleElementNS(mnXmlNamespace, XML_nvPr);
mpFS->endElementNS(mnXmlNamespace, XML_nvSpPr);
- mpFS->startElementNS(mnXmlNamespace, XML_spPr, FSEND);
+ mpFS->startElementNS(mnXmlNamespace, XML_spPr);
WriteShapeTransformation(xShape, XML_a);
WritePresetShape("rect");
mpFS->endElementNS(mnXmlNamespace, XML_spPr);
- mpFS->startElementNS(mnXmlNamespace, XML_txBody, FSEND);
- mpFS->startElementNS(XML_a, XML_bodyPr, FSEND);
+ mpFS->startElementNS(mnXmlNamespace, XML_txBody);
+ mpFS->startElementNS(XML_a, XML_bodyPr);
mpFS->endElementNS(XML_a, XML_bodyPr);
- mpFS->startElementNS(XML_a, XML_p, FSEND);
- mpFS->startElementNS(XML_a14, XML_m, FSEND);
+ mpFS->startElementNS(XML_a, XML_p);
+ mpFS->startElementNS(XML_a14, XML_m);
oox::FormulaExportBase *const pMagic(dynamic_cast<oox::FormulaExportBase*>(xMathModel.get()));
assert(pMagic);
@@ -1890,7 +1869,7 @@ void ShapeExport::WriteMathShape(Reference<XShape> const& xShape)
mpFS->endElementNS(mnXmlNamespace, XML_txBody);
mpFS->endElementNS(mnXmlNamespace, XML_sp);
mpFS->endElementNS(XML_mc, XML_Choice);
- mpFS->startElementNS(XML_mc, XML_Fallback, FSEND);
+ mpFS->startElementNS(XML_mc, XML_Fallback);
// TODO: export bitmap shape as fallback
mpFS->endElementNS(XML_mc, XML_Fallback);
mpFS->endElementNS(XML_mc, XML_AlternateContent);
@@ -2034,36 +2013,31 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )
mpFS->getOutputStream(), sRelationType,
OUString::createFromAscii(GetRelationCompPrefix()) + sFileName);
- mpFS->startElementNS( mnXmlNamespace, XML_graphicFrame, FSEND );
+ mpFS->startElementNS(mnXmlNamespace, XML_graphicFrame);
- mpFS->startElementNS( mnXmlNamespace, XML_nvGraphicFramePr, FSEND );
+ mpFS->startElementNS(mnXmlNamespace, XML_nvGraphicFramePr);
mpFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, I32S( GetNewShapeID( xShape ) ),
- XML_name, IDS(Object),
- FSEND );
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, IDS(Object) );
- mpFS->singleElementNS( mnXmlNamespace, XML_cNvGraphicFramePr,
- FSEND );
+ mpFS->singleElementNS(mnXmlNamespace, XML_cNvGraphicFramePr);
if (GetDocumentType() == DOCUMENT_PPTX)
- mpFS->singleElementNS( mnXmlNamespace, XML_nvPr,
- FSEND );
+ mpFS->singleElementNS(mnXmlNamespace, XML_nvPr);
mpFS->endElementNS( mnXmlNamespace, XML_nvGraphicFramePr );
WriteShapeTransformation( xShape, mnXmlNamespace );
- mpFS->startElementNS( XML_a, XML_graphic, FSEND );
- mpFS->startElementNS( XML_a, XML_graphicData,
- XML_uri, "http://schemas.openxmlformats.org/presentationml/2006/ole",
- FSEND );
+ mpFS->startElementNS(XML_a, XML_graphic);
+ mpFS->startElementNS(XML_a, XML_graphicData,
+ XML_uri, "http://schemas.openxmlformats.org/presentationml/2006/ole");
if (pProgID)
{
mpFS->startElementNS( mnXmlNamespace, XML_oleObj,
XML_progId, pProgID,
FSNS(XML_r, XML_id), sRelId.toUtf8(),
- XML_spid, "",
- FSEND );
+ XML_spid, "" );
}
else
{
@@ -2071,11 +2045,10 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )
//? XML_name, "Document",
FSNS(XML_r, XML_id), sRelId.toUtf8(),
// The spec says that this is a required attribute, but PowerPoint can only handle an empty value.
- XML_spid, "",
- FSEND );
+ XML_spid, "" );
}
- mpFS->singleElementNS( mnXmlNamespace, XML_embed, FSEND );
+ mpFS->singleElementNS( mnXmlNamespace, XML_embed );
// pic element
SdrObject* pSdrOLE2( GetSdrObjectFromXShape( xShape ) );
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index ff3631236868..9eed6c69e261 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -425,9 +425,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
case ESCHER_WrapThrough: pWrapType = "through"; break;
}
if ( pWrapType )
- m_pSerializer->singleElementNS( XML_w10, XML_wrap,
- XML_type, pWrapType,
- FSEND );
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, pWrapType);
}
bAlreadyWritten[ ESCHER_Prop_WrapText ] = true;
break;
@@ -907,9 +905,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
OUString aTextPathString = SvxMSDffManager::MSDFFReadZString(aStream, opt.nProp.size(), true);
aStream.Seek(0);
- m_pSerializer->singleElementNS( XML_v, XML_path,
- XML_textpathok, "t",
- FSEND );
+ m_pSerializer->singleElementNS(XML_v, XML_path, XML_textpathok, "t");
sax_fastparser::FastAttributeList* pAttrList = FastSerializerHelper::createAttrList();
pAttrList->add(XML_on, "t");
@@ -1374,7 +1370,7 @@ sal_Int32 VMLExport::StartShape()
if( pParaObj )
{
// this is reached only in case some text is attached to the shape
- m_pSerializer->startElementNS(XML_v, XML_textbox, FSEND);
+ m_pSerializer->startElementNS(XML_v, XML_textbox);
m_pTextExport->WriteOutliner(*pParaObj);
m_pSerializer->endElementNS(XML_v, XML_textbox);
if( bOwnParaObj )