summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorEike Rathke <erack@erack.de>2011-09-11 14:56:32 +0200
committerEike Rathke <erack@erack.de>2011-09-11 15:21:03 +0200
commit34c9a01b075788653b89c244eb8b3fcee54bfa68 (patch)
treed657756d986979ab6b631a70678b0325cba55933 /sc/source
parent59b36fc62e21cce62fd63f0dcc79ff9cb66b35b8 (diff)
fix fdo#40590 stop abusing regular string token for XML import
During XML import formulas of defined names and conditional formatting were remembered as regular svString tokens that then later were retrieved without quotes for compilation. This didn't go along with the new ScRangeData::CompileUnresolvedXML() that recreates the formula string from an already tokenized form of the formula. Introduced FormulaToken::AddStringXML() with ocStringXML to sort those out and removed the IsImportingXML() hack from FormulaCompiler::AppendString(), the ocStringXML case is handled in FormulaCompiler::CreateStringFromToken().
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/conditio.cxx4
-rw-r--r--sc/source/core/tool/compiler.cxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx4
3 files changed, 4 insertions, 8 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 923f90d87e09..757b7387db63 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -319,7 +319,7 @@ void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2,
// temporary formula string as string tokens
//! merge with lcl_ScDocFunc_CreateTokenArrayXML
pFormula1 = new ScTokenArray;
- pFormula1->AddString( rExpr1 );
+ pFormula1->AddStringXML( rExpr1 );
// bRelRef1 is set when the formula is compiled again (CompileXML)
}
else
@@ -356,7 +356,7 @@ void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2,
// temporary formula string as string tokens
//! merge with lcl_ScDocFunc_CreateTokenArrayXML
pFormula2 = new ScTokenArray;
- pFormula2->AddString( rExpr2 );
+ pFormula2->AddStringXML( rExpr2 );
// bRelRef2 is set when the formula is compiled again (CompileXML)
}
else
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 3f227b4d08a9..cc6d69fffda5 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -5206,10 +5206,6 @@ void ScCompiler::LocalizeString( String& rName )
ScGlobal::GetAddInCollection()->LocalizeString( rName );
}
// -----------------------------------------------------------------------------
-bool ScCompiler::IsImportingXML() const
-{
- return pDoc->IsImportingXML();
-}
// Put quotes around string if non-alphanumeric characters are contained,
// quote characters contained within are escaped by '\\'.
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 7410da8f224e..dbb567ff455f 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1010,9 +1010,9 @@ sal_Bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngi
ScTokenArray* lcl_ScDocFunc_CreateTokenArrayXML( const String& rText, const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar )
{
ScTokenArray* pCode = new ScTokenArray;
- pCode->AddString( rText );
+ pCode->AddStringXML( rText );
if( (eGrammar == formula::FormulaGrammar::GRAM_EXTERNAL) && (rFormulaNmsp.Len() > 0) )
- pCode->AddString( rFormulaNmsp );
+ pCode->AddStringXML( rFormulaNmsp );
return pCode;
}