summaryrefslogtreecommitdiff
path: root/connectivity/source/commontools/DateConversion.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-31 12:57:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-01 07:12:36 +0100
commit8c9b5a901dcbb430bbf225ed0a2d7a286b1d5185 (patch)
treeedf76ea7647609264260d20d86dca9357aa662db /connectivity/source/commontools/DateConversion.cxx
parentc45a3488af6455a3b307f9e64bed41d23b3bae53 (diff)
loplugin:constantparam in connectivity
Change-Id: Ia13d0931bbdf642fe04119ea1112788fb143eba8 Reviewed-on: https://gerrit.libreoffice.org/44110 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/commontools/DateConversion.cxx')
-rw-r--r--connectivity/source/commontools/DateConversion.cxx26
1 files changed, 9 insertions, 17 deletions
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index e51339378526..39acab5c1092 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -44,7 +44,7 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::uno;
-OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool bQuote,
+OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal,
const Reference< XTypeConverter >& _rxTypeConverter)
{
OUStringBuffer aRet;
@@ -76,8 +76,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b
case DataType::CHAR:
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
- if (bQuote)
- aRet.append("'");
+ aRet.append("'");
{
OUString aTemp;
_rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= aTemp;
@@ -93,8 +92,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b
aRet.append(aTemp);
}
- if (bQuote)
- aRet.append("'");
+ aRet.append("'");
break;
case DataType::REAL:
case DataType::DOUBLE:
@@ -133,11 +131,9 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b
// check if this is really a timestamp or only a date
if ( bOk )
{
- if (bQuote)
- aRet.append("{ts '");
+ aRet.append("{ts '");
aRet.append(DBTypeConversion::toDateTimeString(aDateTime));
- if (bQuote)
- aRet.append("'}");
+ aRet.append("'}");
break;
}
break;
@@ -163,11 +159,9 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b
else
bOk = _rVal >>= aDate;
OSL_ENSURE( bOk, "DBTypeConversion::toSQLString: _rVal is not date!");
- if (bQuote)
- aRet.append("{d '");
+ aRet.append("{d '");
aRet.append(DBTypeConversion::toDateString(aDate));
- if (bQuote)
- aRet.append("'}");
+ aRet.append("'}");
} break;
case DataType::TIME:
{
@@ -190,11 +184,9 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b
else
bOk = _rVal >>= aTime;
OSL_ENSURE( bOk,"DBTypeConversion::toSQLString: _rVal is not time!");
- if (bQuote)
- aRet.append("{t '");
+ aRet.append("{t '");
aRet.append(DBTypeConversion::toTimeString(aTime));
- if (bQuote)
- aRet.append("'}");
+ aRet.append("'}");
} break;
}
}