diff options
Diffstat (limited to 'sc/source/filter/excel')
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/excel/xeextlst.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xestream.cxx | 7 | ||||
-rw-r--r-- | sc/source/filter/excel/xetable.cxx | 2 |
4 files changed, 13 insertions, 10 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 5e5f9cd074cb..b7d5f3675bac 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -937,13 +937,13 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm ) if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation)) { rWorksheet->startElement( XML_formula, FSEND ); - rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), + rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetCompileFormulaContext(), mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry(0))); rWorksheet->endElement( XML_formula ); if (bFmla2) { rWorksheet->startElement( XML_formula, FSEND ); - rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), + rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetCompileFormulaContext(), mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry(1))); rWorksheet->endElement( XML_formula ); } @@ -1082,7 +1082,7 @@ void XclExpCfvo::SaveXml( XclExpXmlStream& rStrm ) OString aValue; if(mrEntry.GetType() == COLORSCALE_FORMULA) { - OUString aFormula = XclXmlUtils::ToOUString( GetRoot().GetDoc(), maSrcPos, + OUString aFormula = XclXmlUtils::ToOUString( GetCompileFormulaContext(), maSrcPos, mrEntry.GetFormula()->Clone()); aValue = OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8 ); } @@ -1583,7 +1583,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : Formula compiler supports this by offering two different functions CreateDataValFormula() and CreateListValFormula(). */ mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_LISTVAL, *xScTokArr ); - msFormula1 = XclXmlUtils::ToOUString( GetDoc(), pValData->GetSrcPos(), + msFormula1 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(), xScTokArr.get()); } } @@ -1591,7 +1591,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : { // no list validation -> convert the formula mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr ); - msFormula1 = XclXmlUtils::ToOUString( GetDoc(), pValData->GetSrcPos(), + msFormula1 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(), xScTokArr.get()); } } @@ -1601,7 +1601,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : if( xScTokArr.get() ) { mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr ); - msFormula2 = XclXmlUtils::ToOUString( GetDoc(), pValData->GetSrcPos(), + msFormula2 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(), xScTokArr.get()); } } diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx index 852647c33cfc..bb96e2753acc 100644 --- a/sc/source/filter/excel/xeextlst.cxx +++ b/sc/source/filter/excel/xeextlst.cxx @@ -62,7 +62,7 @@ XclExpExtCfvo::XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& OUString aFormula; if(pArr) { - aFormula = XclXmlUtils::ToOUString( GetRoot().GetDoc(), rSrcPos, + aFormula = XclXmlUtils::ToOUString( GetCompileFormulaContext(), rSrcPos, pArr->Clone()); } maValue = OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8 ); diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 31e39c7d3e47..9d1adb00f8f2 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -39,6 +39,7 @@ #include "compiler.hxx" #include "formulacell.hxx" #include "tokenarray.hxx" +#include "tokenstringcontext.hxx" #include "refreshtimerprotector.hxx" #include "globstr.hrc" @@ -810,9 +811,10 @@ OUString XclXmlUtils::ToOUString( const ScfUInt16Vec& rBuf, sal_Int32 nStart, sa } OUString XclXmlUtils::ToOUString( - ScDocument& rDocument, const ScAddress& rAddress, const ScTokenArray* pTokenArray ) + sc::CompileFormulaContext& rCtx, const ScAddress& rAddress, const ScTokenArray* pTokenArray ) { - ScCompiler aCompiler( &rDocument, rAddress, const_cast<ScTokenArray&>(*pTokenArray)); + ScCompiler aCompiler( rCtx, rAddress, const_cast<ScTokenArray&>(*pTokenArray)); + aCompiler.SetGrammar(FormulaGrammar::GRAM_OOXML); OUStringBuffer aBuffer( pTokenArray->GetLen() * 5 ); @@ -1077,6 +1079,7 @@ bool XclExpXmlStream::exportDocument() aData.maMaxPos.SetCol( ::std::min( aData.maScMaxPos.Col(), aData.maXclMaxPos.Col() ) ); aData.maMaxPos.SetRow( ::std::min( aData.maScMaxPos.Row(), aData.maXclMaxPos.Row() ) ); aData.maMaxPos.SetTab( ::std::min( aData.maScMaxPos.Tab(), aData.maXclMaxPos.Tab() ) ); + aData.mpCompileFormulaCxt.reset( new sc::CompileFormulaContext(&rDoc) ); XclExpRoot aRoot( aData ); diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 97a31c693eb1..cae6460d61ff 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -946,7 +946,7 @@ void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm ) // OOXTODO: XML_bx bool FSEND ); rWorksheet->writeEscaped( XclXmlUtils::ToOUString( - *mrScFmlaCell.GetDocument(), mrScFmlaCell.aPos, mrScFmlaCell.GetCode())); + rStrm.GetRoot().GetCompileFormulaContext(), mrScFmlaCell.aPos, mrScFmlaCell.GetCode())); rWorksheet->endElement( XML_f ); if( strcmp( sType, "inlineStr" ) == 0 ) { |