diff options
author | Kate Goss <katherine.goss@gmail.com> | 2012-02-13 21:53:08 +0000 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2012-02-14 19:55:23 +0100 |
commit | c8d91a8f2f6780cd187c65660ebf18e5eea568bc (patch) | |
tree | 9ca5e0a70b472518d8cdae0d6a9c535bc05795a3 /connectivity | |
parent | cdb2d21c550d18c5565a4ade7aeca4594a836f94 (diff) |
Remove unused code from connectivity::odbc::OPreparedStatement
Remove methods getDataBuf(int), getParamLength(int), getPrecision(int).
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/odbcbase/OPreparedStatement.cxx | 77 | ||||
-rw-r--r-- | connectivity/source/inc/odbc/OPreparedStatement.hxx | 4 |
2 files changed, 0 insertions, 81 deletions
diff --git a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx index 63401f57bc84..d1288f997366 100644 --- a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx +++ b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx @@ -674,27 +674,6 @@ sal_Int8* OPreparedStatement::allocBindBuf( sal_Int32 index,sal_Int32 bufLen) // ------------------------------------------------------------------------- //-------------------------------------------------------------------- -// getDataBuf -// Gets the data buffer for the given parameter index -//-------------------------------------------------------------------- - -sal_Int8* OPreparedStatement::getDataBuf (sal_Int32 index) -{ - sal_Int8* b = NULL; - - // Sanity check the parameter number - - if ((index >= 1) && - (index <= numParams)) - { - b = boundParams[index - 1].getBindDataBuffer (); - } - - return b; -} -// ------------------------------------------------------------------------- - -//-------------------------------------------------------------------- // getLengthBuf // Gets the length buffer for the given parameter index //-------------------------------------------------------------------- @@ -716,34 +695,6 @@ sal_Int8* OPreparedStatement::getLengthBuf (sal_Int32 index) // ------------------------------------------------------------------------- //-------------------------------------------------------------------- -// getParamLength -// Returns the length of the given parameter number. When each -// parameter was bound, a 4-sal_Int8 buffer was given to hold the -// length (stored in native format). Get the buffer, convert the -// buffer from native format, and return it. If the length is -1, -// the column is considered to be NULL. -//-------------------------------------------------------------------- - -sal_Int32 OPreparedStatement::getParamLength ( sal_Int32 index) -{ - sal_Int32 paramLen = SQL_NULL_DATA; - - // Sanity check the parameter number - - if ((index >= 1) && - (index <= numParams)) { - - // Now get the length of the parameter from the - // bound param array. -1 is returned if it is NULL. - long n = 0; - memcpy (&n, boundParams[index -1].getBindLengthBuffer (), sizeof (n)); - paramLen = n; - } - return paramLen; -} -// ------------------------------------------------------------------------- - -//-------------------------------------------------------------------- // putParamData // Puts parameter data from a previously bound input stream. The // input stream was bound using SQL_LEN_DATA_AT_EXEC. @@ -810,34 +761,6 @@ void OPreparedStatement::putParamData (sal_Int32 index) throw(SQLException) } } // ------------------------------------------------------------------------- -//-------------------------------------------------------------------- -// getPrecision -// Given a SQL type, return the maximum precision for the column. -// Returns -1 if not known -//-------------------------------------------------------------------- - -sal_Int32 OPreparedStatement::getPrecision ( sal_Int32 sqlType) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - - sal_Int32 prec = -1; - const TTypeInfoVector& rTypeInfo = m_pConnection->getTypeInfo(); - if ( !rTypeInfo.empty() ) - { - m_pConnection->buildTypeInfo(); - } - - if ( !rTypeInfo.empty() ) - { - OTypeInfo aInfo; - aInfo.nType = (sal_Int16)sqlType; - TTypeInfoVector::const_iterator aIter = ::std::find(rTypeInfo.begin(),rTypeInfo.end(),aInfo); - if(aIter != rTypeInfo.end()) - prec = (*aIter).nPrecision; - } - return prec; -} //-------------------------------------------------------------------- // setStream diff --git a/connectivity/source/inc/odbc/OPreparedStatement.hxx b/connectivity/source/inc/odbc/OPreparedStatement.hxx index 8c413555b17a..076c9e0566bf 100644 --- a/connectivity/source/inc/odbc/OPreparedStatement.hxx +++ b/connectivity/source/inc/odbc/OPreparedStatement.hxx @@ -88,15 +88,11 @@ namespace connectivity void putParamData (sal_Int32 index) throw(::com::sun::star::sdbc::SQLException); void setStream (sal_Int32 ParameterIndex,const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, SQLLEN length,sal_Int32 SQLtype) throw(::com::sun::star::sdbc::SQLException); - sal_Int32 getParamLength ( sal_Int32 index); sal_Int8* getLengthBuf (sal_Int32 index); - sal_Int8* getDataBuf (sal_Int32 index); sal_Int8* allocBindBuf ( sal_Int32 index, sal_Int32 bufLen); void initBoundParam () throw(::com::sun::star::sdbc::SQLException); void setParameter(sal_Int32 parameterIndex,sal_Int32 _nType,sal_Int32 _nSize,void* _pData); - sal_Int32 getPrecision ( sal_Int32 sqlType); - sal_Bool isPrepared() const { return m_bPrepared;} void prepareStatement(); void checkParameterIndex(sal_Int32 _parameterIndex); |