summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-12 17:07:46 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-12 17:20:16 +0100
commit22ea08bdb5d64636cf76a58d6b34be01f5f50791 (patch)
tree2e556a7db63e3cc7a579f93996e866a8929d9803
parent867bf5b48eeae3925de2196d38554518938f9c1a (diff)
fix memory leak in cond format export
Change-Id: I3c0379dfa972cb552382153f3d363eaf3bfe604d
-rw-r--r--sc/source/filter/excel/xecontent.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 71a380932ab2..f8162b4e1122 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -945,14 +945,16 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation))
{
rWorksheet->startElement( XML_formula, FSEND );
+ std::unique_ptr<ScTokenArray> pTokenArray(mrFormatEntry.CreateTokenArry(0));
rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetCompileFormulaContext(), mrFormatEntry.GetValidSrcPos(),
- mrFormatEntry.CreateTokenArry(0)));
+ pTokenArray.get()));
rWorksheet->endElement( XML_formula );
if (bFmla2)
{
rWorksheet->startElement( XML_formula, FSEND );
+ std::unique_ptr<ScTokenArray> pTokenArray2(mrFormatEntry.CreateTokenArry(1));
rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetCompileFormulaContext(), mrFormatEntry.GetValidSrcPos(),
- mrFormatEntry.CreateTokenArry(1)));
+ pTokenArray2.get()));
rWorksheet->endElement( XML_formula );
}
}
@@ -1091,7 +1093,7 @@ void XclExpCfvo::SaveXml( XclExpXmlStream& rStrm )
if(mrEntry.GetType() == COLORSCALE_FORMULA)
{
OUString aFormula = XclXmlUtils::ToOUString( GetCompileFormulaContext(), maSrcPos,
- mrEntry.GetFormula()->Clone());
+ mrEntry.GetFormula());
aValue = OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8 );
}
else