#92339# type corrected from LTRIM function

This commit is contained in:
Ocke Janssen
2001-09-27 08:47:43 +00:00
parent 2dd7736134
commit c5793c12ee
2 changed files with 38 additions and 26 deletions

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: OResultSet.cxx,v $ * $RCSfile: OResultSet.cxx,v $
* *
* $Revision: 1.42 $ * $Revision: 1.43 $
* *
* last change: $Author: oj $ $Date: 2001-09-20 12:51:55 $ * last change: $Author: oj $ $Date: 2001-09-27 09:47:43 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -158,16 +158,23 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :
,m_pStatement(pStmt) ,m_pStatement(pStmt)
{ {
osl_incrementInterlockedCount( &m_refCount ); osl_incrementInterlockedCount( &m_refCount );
m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value try
N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_STATUS_PTR,m_pRowStatusArray,SQL_IS_POINTER); {
m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value
N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_STATUS_PTR,m_pRowStatusArray,SQL_IS_POINTER);
SQLUINTEGER nValueLen = 0; SQLUINTEGER nValueLen = 0;
OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_GETDATA_EXTENSIONS,nValueLen,*(Reference< XInterface >*)this); OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_GETDATA_EXTENSIONS,nValueLen,*(Reference< XInterface >*)this);
SQLINTEGER nCurType = 0; SQLINTEGER nCurType = 0;
N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nCurType,SQL_IS_UINTEGER,0); N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nCurType,SQL_IS_UINTEGER,0);
m_bFetchData = !((SQL_GD_ANY_ORDER & nValueLen) == SQL_GD_ANY_ORDER && nCurType != SQL_CURSOR_FORWARD_ONLY); m_bFetchData = !((SQL_GD_ANY_ORDER & nValueLen) == SQL_GD_ANY_ORDER && nCurType != SQL_CURSOR_FORWARD_ONLY);
}
catch(Exception&)
{ // we don't want our result destroy here
m_bFetchData = sal_True;
}
osl_decrementInterlockedCount( &m_refCount ); osl_decrementInterlockedCount( &m_refCount );
} }

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: sqlnode.cxx,v $ * $RCSfile: sqlnode.cxx,v $
* *
* $Revision: 1.22 $ * $Revision: 1.23 $
* *
* last change: $Author: oj $ $Date: 2001-09-24 11:34:51 $ * last change: $Author: oj $ $Date: 2001-09-27 09:47:41 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -181,8 +181,8 @@ OSQLParseNode::SQLParseNodeParameter::SQLParseNodeParameter(const ::rtl::OUStrin
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
sal_uInt16 nYear = (sal_uInt16)rString.getToken(0,sDateSep,nIndex).toInt32(); sal_uInt16 nYear = (sal_uInt16)rString.getToken(0,sDateSep,nIndex).toInt32();
sal_uInt16 nMonth = (sal_uInt16)rString.getToken(1,sDateSep,nIndex).toInt32(); sal_uInt16 nMonth = (sal_uInt16)rString.getToken(0,sDateSep,nIndex).toInt32();
sal_uInt16 nDay = (sal_uInt16)rString.getToken(2,sDateSep,nIndex).toInt32(); sal_uInt16 nDay = (sal_uInt16)rString.getToken(0,sDateSep,nIndex).toInt32();
Date aDate(nDay,nMonth,nYear); Date aDate(nDay,nMonth,nYear);
Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier()); Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier());
@@ -201,11 +201,11 @@ OSQLParseNode::SQLParseNodeParameter::SQLParseNodeParameter(const ::rtl::OUStrin
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
sal_uInt16 nYear = (sal_uInt16)rString.getToken(0,sDateSep,nIndex).toInt32(); sal_uInt16 nYear = (sal_uInt16)rString.getToken(0,sDateSep,nIndex).toInt32();
sal_uInt16 nMonth = (sal_uInt16)rString.getToken(1,sDateSep,nIndex).toInt32(); sal_uInt16 nMonth = (sal_uInt16)rString.getToken(0,sDateSep,nIndex).toInt32();
sal_uInt16 nDay = (sal_uInt16)rString.getToken(2,sDateSep,nIndex).toInt32(); sal_uInt16 nDay = (sal_uInt16)rString.getToken(0,sDateSep,nIndex).toInt32();
sal_uInt16 nHour = (sal_uInt16)rString.getToken(0,sTimeSep,nIndex).toInt32(); sal_uInt16 nHour = (sal_uInt16)rString.getToken(0,sTimeSep,nIndex).toInt32();
sal_uInt16 nMinute = (sal_uInt16)rString.getToken(1,sTimeSep,nIndex).toInt32(); sal_uInt16 nMinute = (sal_uInt16)rString.getToken(0,sTimeSep,nIndex).toInt32();
sal_uInt16 nSecond = (sal_uInt16)rString.getToken(2,sTimeSep,nIndex).toInt32(); sal_uInt16 nSecond = (sal_uInt16)rString.getToken(0,sTimeSep,nIndex).toInt32();
DateTime aDate(0,nSecond,nMinute,nHour,nDay,nMonth,nYear); DateTime aDate(0,nSecond,nMinute,nHour,nDay,nMonth,nYear);
Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier()); Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier());
@@ -223,8 +223,8 @@ OSQLParseNode::SQLParseNodeParameter::SQLParseNodeParameter(const ::rtl::OUStrin
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
sal_uInt16 nHour = (sal_uInt16)rString.getToken(0,sTimeSep,nIndex).toInt32(); sal_uInt16 nHour = (sal_uInt16)rString.getToken(0,sTimeSep,nIndex).toInt32();
sal_uInt16 nMinute = (sal_uInt16)rString.getToken(1,sTimeSep,nIndex).toInt32(); sal_uInt16 nMinute = (sal_uInt16)rString.getToken(0,sTimeSep,nIndex).toInt32();
sal_uInt16 nSecond = (sal_uInt16)rString.getToken(2,sTimeSep,nIndex).toInt32(); sal_uInt16 nSecond = (sal_uInt16)rString.getToken(0,sTimeSep,nIndex).toInt32();
Time aTime(0,nHour,nMinute,nSecond); Time aTime(0,nHour,nMinute,nSecond);
Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier()); Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier());
@@ -353,13 +353,15 @@ void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString, const SQLParseNodeP
aNewParam.bQuote = sal_False; aNewParam.bQuote = sal_False;
m_aChilds[0]->parseNodeToStr(rString, aNewParam); m_aChilds[0]->parseNodeToStr(rString, aNewParam);
aNewParam.bQuote = rParam.bQuote;
aNewParam.bPredicate = sal_False; // disable [ ] around names
::rtl::OUString aStringPara; ::rtl::OUString aStringPara;
for (sal_uInt32 i=1; i<nCount; i++) for (sal_uInt32 i=1; i<nCount; i++)
{ {
const OSQLParseNode * pSubTree = m_aChilds[i]; const OSQLParseNode * pSubTree = m_aChilds[i];
if (pSubTree) if (pSubTree)
{ {
pSubTree->parseNodeToStr(aStringPara, rParam); pSubTree->parseNodeToStr(aStringPara, aNewParam);
// bei den CommaListen zwischen alle Subtrees Commas setzen // bei den CommaListen zwischen alle Subtrees Commas setzen
if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i < (nCount - 1))) if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i < (nCount - 1)))
@@ -384,7 +386,7 @@ void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString, const SQLParseNodeP
if (rParam.xField.is() && SQL_ISRULE(pSubTree,subquery)) if (rParam.xField.is() && SQL_ISRULE(pSubTree,subquery))
aNewParam.xField = NULL; aNewParam.xField = NULL;
// if there is a field given we don't display the fieldname, if there are any // if there is a field given we don't display the fieldname, if there is any
if (rParam.xField.is() && SQL_ISRULE(pSubTree,column_ref)) if (rParam.xField.is() && SQL_ISRULE(pSubTree,column_ref))
{ {
sal_Bool bFilter = sal_False; sal_Bool bFilter = sal_False;
@@ -399,10 +401,13 @@ void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString, const SQLParseNodeP
{ {
} }
const OSQLParseNode* pCol = pSubTree->m_aChilds[pSubTree->count()-1]; if(pSubTree->count())
if ((SQL_ISRULE(pCol,column_val) && pCol->getChild(0)->getTokenValue().equalsIgnoreAsciiCase(aFieldName)) || {
pCol->getTokenValue().equalsIgnoreAsciiCase(aFieldName)) const OSQLParseNode* pCol = pSubTree->m_aChilds[pSubTree->count()-1];
bFilter = sal_True; if ((SQL_ISRULE(pCol,column_val) && pCol->getChild(0)->getTokenValue().equalsIgnoreAsciiCase(aFieldName)) ||
pCol->getTokenValue().equalsIgnoreAsciiCase(aFieldName))
bFilter = sal_True;
}
// ok we found the field, if the following node is the // ok we found the field, if the following node is the
// comparision operator '=' we filter it as well // comparision operator '=' we filter it as well
@@ -1129,7 +1134,7 @@ Any getNumberFormatProperty(const Reference< ::com::sun::star::util::XNumberForm
Reference< XPropertySet > xProperties(xFormats->getByKey(nKey)); Reference< XPropertySet > xProperties(xFormats->getByKey(nKey));
return xProperties->getPropertyValue(aPropertyName); return xProperties->getPropertyValue(aPropertyName);
} }
catch( ... ) catch( Exception& )
{ {
} }
} }