summaryrefslogtreecommitdiff
path: root/sc/source/core/tool
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool')
-rw-r--r--sc/source/core/tool/dbcolect.cxx4
-rw-r--r--sc/source/core/tool/interpr1.cxx7
-rw-r--r--sc/source/core/tool/interpr4.cxx33
3 files changed, 28 insertions, 16 deletions
diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx
index 4eea4db97a0a..7f94cb64c827 100644
--- a/sc/source/core/tool/dbcolect.cxx
+++ b/sc/source/core/tool/dbcolect.cxx
@@ -155,6 +155,7 @@ ScDBData::ScDBData( const ScDBData& rData ) :
nQueryField[i] = rData.nQueryField[i];
eQueryOp[i] = rData.eQueryOp[i];
bQueryByString[i] = rData.bQueryByString[i];
+ bQueryByDate[i] = rData.bQueryByDate[i];
pQueryStr[i] = new String( *(rData.pQueryStr[i]) );
nQueryVal[i] = rData.nQueryVal[i];
eQueryConnect[i] = rData.eQueryConnect[i];
@@ -244,6 +245,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData)
nQueryField[i] = rData.nQueryField[i];
eQueryOp[i] = rData.eQueryOp[i];
bQueryByString[i] = rData.bQueryByString[i];
+ bQueryByDate[i] = rData.bQueryByDate[i];
*pQueryStr[i] = *rData.pQueryStr[i];
nQueryVal[i] = rData.nQueryVal[i];
eQueryConnect[i] = rData.eQueryConnect[i];
@@ -512,6 +514,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const
rEntry.nField = nQueryField[i];
rEntry.eOp = eQueryOp[i];
rEntry.bQueryByString = bQueryByString[i];
+ rEntry.bQueryByDate = bQueryByDate[i];
*rEntry.pStr = *pQueryStr[i];
rEntry.nVal = nQueryVal[i];
rEntry.eConnect = eQueryConnect[i];
@@ -543,6 +546,7 @@ void ScDBData::SetQueryParam(const ScQueryParam& rQueryParam)
nQueryField[i] = rEntry.nField;
eQueryOp[i] = rEntry.eOp;
bQueryByString[i] = rEntry.bQueryByString;
+ bQueryByDate[i] = rEntry.bQueryByDate;
*pQueryStr[i] = *rEntry.pStr;
nQueryVal[i] = rEntry.nVal;
eQueryConnect[i] = rEntry.eConnect;
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 94cd5c1a02e9..30aa0b8aa13e 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2488,7 +2488,14 @@ void ScInterpreter::ScN()
Pop();
}
else
+ {
+ // Temporarily override the ConvertStringToValue() error for
+ // GetCellValue() / GetCellValueOrZero()
+ USHORT nSErr = mnStringNoValueError;
+ mnStringNoValueError = errCellNoValue;
fVal = GetDouble();
+ mnStringNoValueError = nSErr;
+ }
if ( nGlobalError == NOTAVAILABLE || nGlobalError == errIllegalArgument )
nGlobalError = 0; // N(#NA) and N("text") are ok
if ( !nGlobalError && nErr != NOTAVAILABLE )
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index ffba9aafc511..c576cd5ca6c3 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -261,7 +261,7 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
while (p < pStop && *p == ' ')
++p;
if (p < pStop)
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
break;
case '-':
case ':':
@@ -281,7 +281,7 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
while (p < pStop && *p == ' ')
++p;
if (p < pStop && !CharClass::isAsciiDigit(*p))
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
p = pLastStart;
while (p < pStop && !nGlobalError && eState < blank)
{
@@ -291,7 +291,7 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
{
// Maximum 2 digits per unit, except fractions.
if (p - pLastStart >= 2 && eState != fraction)
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
}
else if (p > pLastStart)
{
@@ -300,7 +300,7 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
{
nUnit[eState] = aStr.copy( pLastStart - pStart, p - pLastStart).toInt32();
if (nLimit[eState] && nLimit[eState] < nUnit[eState])
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
}
pLastStart = p + 1; // hypothetical next start
// Delimiters must match, a trailing delimiter
@@ -311,11 +311,11 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
// Month must be followed by separator and
// day, no trailing blanks.
if (*p != '-' || (p+1 == pStop))
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
break;
case day:
if ((*p != 'T' || (p+1 == pStop)) && *p != ' ')
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
// Take one blank as a valid delimiter
// between date and time.
break;
@@ -323,17 +323,17 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
// Hour must be followed by separator and
// minute, no trailing blanks.
if (*p != ':' || (p+1 == pStop))
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
break;
case minute:
if ((*p != ':' || (p+1 == pStop)) && *p != ' ')
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
if (*p == ' ')
eState = done;
break;
case second:
if (((*p != ',' && *p != '.') || (p+1 == pStop)) && *p != ' ')
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
if (*p == ' ')
eState = done;
break;
@@ -344,13 +344,13 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
case done:
case blank:
case stop:
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
break;
}
eState = static_cast<State>(eState + 1);
}
else
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
++p;
}
if (eState == blank)
@@ -358,14 +358,14 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
while (p < pStop && *p == ' ')
++p;
if (p < pStop)
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
eState = stop;
}
// Month without day, or hour without minute.
if (eState == month || (eState == day && p <= pLastStart) ||
eState == hour || (eState == minute && p <= pLastStart))
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
if (!nGlobalError)
{
@@ -374,10 +374,10 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
{
nUnit[eState] = aStr.copy( pLastStart - pStart, p - pLastStart).toInt32();
if (nLimit[eState] && nLimit[eState] < nUnit[eState])
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
}
if (bDate && nUnit[hour] > 23)
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
if (!nGlobalError)
{
if (bDate && nUnit[day] == 0)
@@ -396,7 +396,7 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
}
break;
default:
- SetError( errNoValue);
+ SetError( mnStringNoValueError);
}
if (nGlobalError)
fValue = 0.0;
@@ -3549,6 +3549,7 @@ ScInterpreter::ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc,
pTokenMatrixMap( NULL ),
pMyFormulaCell( pCell ),
pFormatter( pDoc->GetFormatTable() ),
+ mnStringNoValueError( errNoValue),
bCalcAsShown( pDoc->GetDocOptions().IsCalcAsShown() )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTTT" );