summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/file/fcomp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/file/fcomp.cxx')
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx35
1 files changed, 15 insertions, 20 deletions
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 982d0266b949..45c9022340a9 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -22,9 +22,6 @@
#include <connectivity/sqlparse.hxx>
#include <file/fanalyzer.hxx>
#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/Time.hpp>
#include <connectivity/dbexception.hxx>
#include <connectivity/dbconversion.hxx>
#include <com/sun/star/sdb/SQLFilterOperator.hpp>
@@ -32,7 +29,7 @@
#include <file/FDateFunctions.hxx>
#include <file/FNumericFunctions.hxx>
#include <file/FConnection.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sqlbison.hxx>
#include <strings.hrc>
@@ -353,29 +350,29 @@ void OPredicateCompiler::execute_BETWEEN(OSQLParseNode const * pPredicateNode)
break;
case DataType::DECIMAL:
case DataType::NUMERIC:
- pOb1->setValue(static_cast<double>(pOb1->getValue()));
- pOb2->setValue(static_cast<double>(pOb2->getValue()));
+ pOb1->setValue(pOb1->getValue().getDouble());
+ pOb2->setValue(pOb2->getValue().getDouble());
break;
case DataType::FLOAT:
- pOb1->setValue(static_cast<float>(pOb1->getValue()));
- pOb2->setValue(static_cast<float>(pOb2->getValue()));
+ pOb1->setValue(pOb1->getValue().getFloat());
+ pOb2->setValue(pOb2->getValue().getFloat());
break;
case DataType::DOUBLE:
case DataType::REAL:
- pOb1->setValue(static_cast<double>(pOb1->getValue()));
- pOb2->setValue(static_cast<double>(pOb2->getValue()));
+ pOb1->setValue(pOb1->getValue().getDouble());
+ pOb2->setValue(pOb2->getValue().getDouble());
break;
case DataType::DATE:
- pOb1->setValue(static_cast<util::Date>(pOb1->getValue()));
- pOb2->setValue(static_cast<util::Date>(pOb2->getValue()));
+ pOb1->setValue(pOb1->getValue().getDate());
+ pOb2->setValue(pOb2->getValue().getDate());
break;
case DataType::TIME:
- pOb1->setValue(static_cast<util::Time>(pOb1->getValue()));
- pOb2->setValue(static_cast<util::Time>(pOb2->getValue()));
+ pOb1->setValue(pOb1->getValue().getTime());
+ pOb2->setValue(pOb2->getValue().getTime());
break;
case DataType::TIMESTAMP:
- pOb1->setValue(static_cast<util::DateTime>(pOb1->getValue()));
- pOb2->setValue(static_cast<util::DateTime>(pOb2->getValue()));
+ pOb1->setValue(pOb1->getValue().getDateTime());
+ pOb2->setValue(pOb2->getValue().getDateTime());
break;
}
}
@@ -457,7 +454,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode const * pPredicateNo
}
else if (SQL_ISRULE(pPredicateNode,parameter))
{
- pOperand = new OOperandParam(pPredicateNode, ++m_nParamCounter);
+ pOperand = new OOperandParam(++m_nParamCounter);
}
else if (pPredicateNode->getNodeType() == SQLNodeType::String ||
pPredicateNode->getNodeType() == SQLNodeType::IntNum ||
@@ -533,8 +530,6 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode const * pPredicateNo
bool OPredicateInterpreter::evaluate(OCodeList& rCodeList)
{
- static bool bResult;
-
if (!(rCodeList[0]))
return true; // no Predicate
@@ -553,7 +548,7 @@ bool OPredicateInterpreter::evaluate(OCodeList& rCodeList)
DBG_ASSERT(m_aStack.empty(), "Stack error");
DBG_ASSERT(pOperand, "Stack error");
- bResult = pOperand->isValid();
+ const bool bResult = pOperand->isValid();
if (typeid(OOperandResult) == typeid(*pOperand))
delete pOperand;
return bResult;