diff --git a/main/SS/Formula/Functions/Text/Text.cs b/main/SS/Formula/Functions/Text/Text.cs index 8df3c734c..d172c3543 100644 --- a/main/SS/Formula/Functions/Text/Text.cs +++ b/main/SS/Formula/Functions/Text/Text.cs @@ -17,7 +17,9 @@ public class Text : Fixed2ArgFunction public static DataFormatter Formatter = new DataFormatter(); public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { - double s0; + if (arg0 is StringEval) return arg0; + + double s0; String s1; try { @@ -130,4 +132,4 @@ public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEva // } //} } -} \ No newline at end of file +} diff --git a/testcases/main/SS/Formula/Functions/TestText.cs b/testcases/main/SS/Formula/Functions/TestText.cs index 1b384dab1..65cc5b280 100644 --- a/testcases/main/SS/Formula/Functions/TestText.cs +++ b/testcases/main/SS/Formula/Functions/TestText.cs @@ -42,7 +42,7 @@ public void TestTextWithStringFirstArg() ValueEval formatArg = new StringEval("abc"); ValueEval[] args = { strArg, formatArg }; ValueEval result = TextFunction.TEXT.Evaluate(args, -1, (short)-1); - Assert.AreEqual(ErrorEval.VALUE_INVALID, result); + Assert.AreEqual(strArg, result); } [Test] public void TestTextWithDeciamlFormatSecondArg()