summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-03-02 11:34:46 +0000
committerRüdiger Timm <rt@openoffice.org>2004-03-02 11:34:46 +0000
commit82e42239266021fc0acd79df9b9c0894ab5985ff (patch)
tree3371e27c00d07f46b0b2febab6cd77f4a5aaa17b /connectivity
parentfa56e8beb3cc91acd16faa14dbe6f43615736fd8 (diff)
INTEGRATION: CWS oj07 (1.29.104); FILE MERGED
2003/08/21 15:32:33 oj 1.29.104.1: #i17363# some refactoring and defense programming
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index 6a689d01a67c..48a355ddc77b 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODatabaseMetaDataResultSet.cxx,v $
*
- * $Revision: 1.29 $
+ * $Revision: 1.30 $
*
- * last change: $Author: oj $ $Date: 2002-11-21 15:45:09 $
+ * last change: $Author: rt $ $Date: 2004-03-02 12:34:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -135,6 +135,7 @@ ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet(OConnection* _pConnection
,m_bFreeHandle(sal_False)
,m_pConnection(_pConnection)
,m_nDriverColumnCount(0)
+ ,m_bWasNull(sal_True)
{
OSL_ENSURE(m_pConnection,"ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet: No parent set!");
osl_incrementInterlockedCount( &m_refCount );
@@ -282,8 +283,9 @@ sal_Int8 SAL_CALL ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex ) t
{
OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_TINYINT,m_bWasNull,**this,&nVal,sizeof nVal);
- if(m_aValueRange.size() && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
- return sal_Int8((*m_aValueRangeIter).second[(sal_Int32)nVal]);
+ ::std::map<sal_Int32, ::connectivity::TInt2IntMap >::iterator aValueRangeIter;
+ if ( !m_aValueRange.empty() && (aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
+ return sal_Int8((*aValueRangeIter).second[(sal_Int32)nVal]);
}
else
m_bWasNull = sal_True;
@@ -389,8 +391,9 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex ) t
{
OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_LONG,m_bWasNull,**this,&nVal,sizeof nVal);
- if(m_aValueRange.size() && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
- return (*m_aValueRangeIter).second[(sal_Int32)nVal];
+ ::std::map<sal_Int32, ::connectivity::TInt2IntMap >::iterator aValueRangeIter;
+ if ( !m_aValueRange.empty() && (aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
+ return (*aValueRangeIter).second[(sal_Int32)nVal];
}
else
m_bWasNull = sal_True;
@@ -459,8 +462,9 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
{
OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_SHORT,m_bWasNull,**this,&nVal,sizeof nVal);
- if(m_aValueRange.size() && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
- return sal_Int16((*m_aValueRangeIter).second[(sal_Int32)nVal]);
+ ::std::map<sal_Int32, ::connectivity::TInt2IntMap >::iterator aValueRangeIter;
+ if ( !m_aValueRange.empty() && (aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
+ return sal_Int16((*aValueRangeIter).second[(sal_Int32)nVal]);
}
else
m_bWasNull = sal_True;