summaryrefslogtreecommitdiffstats
path: root/sc/source/filter/excel/xetable.cxx
diff options
context:
space:
mode:
authorLászló Németh <laszlo.nemeth@collabora.com>2015-01-27 09:17:50 +0100
committerLászló Németh <laszlo.nemeth@collabora.com>2015-01-27 09:20:14 +0100
commit779581feed4886313746a71e9e738d736977be1b (patch)
tree9b630f18061d7b07cb743866dfd1eb5e2747ee7d /sc/source/filter/excel/xetable.cxx
parentExtract SwPosition::dumpAsXml() from MarkManager (diff)
downloadcore-779581feed4886313746a71e9e738d736977be1b.tar.gz
core-779581feed4886313746a71e9e738d736977be1b.zip
tdf#88810 avoid unnecessary massive O(U)String allocations in XLSX export
Using OStringBuffer instead of fixed size character arrays. Change-Id: I06b705e2159a1ef5990f9eb0ffedd20fe277c616
Diffstat (limited to 'sc/source/filter/excel/xetable.cxx')
-rw-r--r--sc/source/filter/excel/xetable.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 70f3373771b4..5919c6145c01 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -631,8 +631,9 @@ static OString lcl_GetStyleId( XclExpXmlStream& rStrm, const XclExpCellBase& rCe
void XclExpNumberCell::SaveXml( XclExpXmlStream& rStrm )
{
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
+ OStringBuffer rBuf = rStrm.GetRoot().GetStringBuf();
rWorksheet->startElement( XML_c,
- XML_r, XclXmlUtils::ToOString( GetXclPos() ).getStr(),
+ XML_r, XclXmlUtils::TryToOString( rBuf, GetXclPos() ) ? rBuf.getStr() : XclXmlUtils::ToOString( GetXclPos() ).getStr(),
XML_s, lcl_GetStyleId( rStrm, *this ).getStr(),
XML_t, "n",
// OOXTODO: XML_cm, XML_vm, XML_ph
@@ -923,11 +924,11 @@ void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm )
{
const char* sType = NULL;
OUString sValue;
-
XclXmlUtils::GetFormulaTypeAndValue( mrScFmlaCell, sType, sValue );
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
+ OStringBuffer rBuf = rStrm.GetRoot().GetStringBuf();
rWorksheet->startElement( XML_c,
- XML_r, XclXmlUtils::ToOString( GetXclPos() ).getStr(),
+ XML_r, XclXmlUtils::TryToOString( rBuf, GetXclPos() ) ? rBuf.getStr() : XclXmlUtils::ToOString( GetXclPos() ).getStr(),
XML_s, lcl_GetStyleId( rStrm, *this ).getStr(),
XML_t, sType,
// OOXTODO: XML_cm, XML_vm, XML_ph
@@ -1308,8 +1309,9 @@ bool XclExpRkCell::TryMerge( const XclExpCellBase& rCell )
void XclExpRkCell::WriteXmlContents( XclExpXmlStream& rStrm, const XclAddress& rAddress, sal_uInt32 nXFId, sal_uInt16 nRelCol )
{
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
+ OStringBuffer rBuf = rStrm.GetRoot().GetStringBuf();
rWorksheet->startElement( XML_c,
- XML_r, XclXmlUtils::ToOString( rAddress ).getStr(),
+ XML_r, XclXmlUtils::TryToOString( rBuf, rAddress ) ? rBuf.getStr() : XclXmlUtils::ToOString( rAddress ).getStr(),
XML_s, lcl_GetStyleId( rStrm, nXFId ).getStr(),
XML_t, "n",
// OOXTODO: XML_cm, XML_vm, XML_ph