summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/tool/compiler.cxx22
-rw-r--r--sc/source/core/tool/interpr2.cxx2
2 files changed, 14 insertions, 10 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 2ed3d597f45e..8cb953476864 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4408,17 +4408,19 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
default:
break;
}
- if( (eLastOp == ocSep ||
- eLastOp == ocArrayRowSep ||
- eLastOp == ocArrayColSep ||
- eLastOp == ocArrayOpen) &&
- (eOp == ocSep ||
- eOp == ocClose ||
- eOp == ocArrayRowSep ||
- eOp == ocArrayColSep ||
- eOp == ocArrayClose) )
+ if (!(eLastOp == ocOpen && eOp == ocClose) &&
+ (eLastOp == ocOpen ||
+ eLastOp == ocSep ||
+ eLastOp == ocArrayRowSep ||
+ eLastOp == ocArrayColSep ||
+ eLastOp == ocArrayOpen) &&
+ (eOp == ocSep ||
+ eOp == ocClose ||
+ eOp == ocArrayRowSep ||
+ eOp == ocArrayColSep ||
+ eOp == ocArrayClose))
{
- // FIXME: should we check for known functions with optional empty
+ // TODO: should we check for known functions with optional empty
// args so the correction dialog can do better?
if ( !static_cast<ScTokenArray*>(pArr)->Add( new FormulaMissingToken ) )
{
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 458236ebca7e..9c8f5e355c5f 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -646,6 +646,8 @@ void ScInterpreter::ScGetDate()
{
sal_Int16 nDay = GetInt16();
sal_Int16 nMonth = GetInt16();
+ if (IsMissing())
+ SetError( errParameterExpected); // Year must be given.
sal_Int16 nYear = GetInt16();
if (nGlobalError || nYear < 0)
PushIllegalArgument();