summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/mozab/MResultSet.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/mozab/MResultSet.cxx')
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.cxx80
1 files changed, 40 insertions, 40 deletions
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
index ffdc5bb894..8ca4e57b81 100644
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ b/connectivity/source/drivers/mozab/MResultSet.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -79,10 +79,10 @@ using namespace com::sun::star::util;
// -------------------------------------------------------------------------
Sequence< ::rtl::OUString > SAL_CALL OResultSet::getSupportedServiceNames( ) throw( RuntimeException)
{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(2);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(2);
aSupported[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ResultSet"));
aSupported[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ResultSet"));
- return aSupported;
+ return aSupported;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
@@ -122,7 +122,7 @@ OResultSet::OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< conne
,m_RowStates(0)
,m_bIsReadOnly(-1)
{
-
+
m_aQuery.setMaxNrOfReturns(pStmt->getOwnConnection()->getMaxResultRecords());
}
// -------------------------------------------------------------------------
@@ -275,7 +275,7 @@ Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLEx
ResultSetEntryGuard aGuard( *this );
if(!m_xMetaData.is())
- m_xMetaData = new OResultSetMetaData(
+ m_xMetaData = new OResultSetMetaData(
m_pSQLIterator->getSelectColumns(), m_pSQLIterator->getTables().begin()->first ,m_pTable,determineReadOnly());
return m_xMetaData;
}
@@ -335,7 +335,7 @@ sal_Bool OResultSet::fetchCurrentRow( ) throw(SQLException, RuntimeException)
{
OSL_TRACE("fetchCurrentRow, m_nRowPos = %u", m_nRowPos );
return fetchRow(getCurrentCardNumber());
-}
+}
// -------------------------------------------------------------------------
sal_Bool OResultSet::pushCard(sal_uInt32 cardNumber) throw(SQLException, RuntimeException)
@@ -362,7 +362,7 @@ sal_Bool OResultSet::pushCard(sal_uInt32 cardNumber) throw(SQLException, Runtime
}
}
return sal_True;
-
+
}
// -------------------------------------------------------------------------
sal_Bool OResultSet::fetchRow(sal_Int32 cardNumber,sal_Bool bForceReload) throw(SQLException, RuntimeException)
@@ -383,7 +383,7 @@ sal_Bool OResultSet::fetchRow(sal_Int32 cardNumber,sal_Bool bForceReload) throw(
}
else
m_aQuery.resyncRow(cardNumber);
-
+
if ( validRow( cardNumber ) == sal_False )
return sal_False;
@@ -427,7 +427,7 @@ const ORowSetValue& OResultSet::getValue(sal_Int32 cardNumber, sal_Int32 columnI
{
ResultSetEntryGuard aGuard( *this );
- OSL_ENSURE(m_xColumns.isValid(), "Need the Columns!!");
+ OSL_ENSURE(m_xColumns.is(), "Need the Columns!!");
OSL_ENSURE(columnIndex <= (sal_Int32)m_xColumns->get().size(), "Trying to access invalid columns number");
checkIndex( columnIndex );
@@ -626,7 +626,7 @@ IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
-
+
return new OPropertyArrayHelper(aProps);
}
// -------------------------------------------------------------------------
@@ -722,7 +722,7 @@ void SAL_CALL OResultSet::release() throw()
// -----------------------------------------------------------------------------
void OResultSet::initializeRow(OValueRow& _rRow,sal_Int32 _nColumnCount)
{
- if(!_rRow.isValid())
+ if(!_rRow.is())
{
_rRow = new OValueVector(_nColumnCount);
(_rRow->get())[0].setBound(sal_True);
@@ -750,7 +750,7 @@ void OResultSet::parseParameter( const OSQLParseNode* pNode, rtl::OUString& rMat
m_nParamIndex ++;
OSL_TRACE("Parameter name [%d]: %s\n", m_nParamIndex,OUtoCStr(aParameterName) );
- if ( m_aParameterRow.isValid() ) {
+ if ( m_aParameterRow.is() ) {
OSL_ENSURE( m_nParamIndex < (sal_Int32)m_aParameterRow->get().size() + 1, "More parameters than values found" );
rMatchString = (m_aParameterRow->get())[(sal_uInt16)m_nParamIndex];
#if OSL_DEBUG_LEVEL > 0
@@ -775,8 +775,8 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
return;
if ( m_pSQLIterator->getParseTree() != NULL ) {
- ::vos::ORef<OSQLColumns> xColumns = m_pSQLIterator->getParameters();
- if(xColumns.isValid())
+ ::rtl::Reference<OSQLColumns> xColumns = m_pSQLIterator->getParameters();
+ if(xColumns.is())
{
::rtl::OUString aTabName,aColName,aParameterName,aParameterValue;
OSQLColumns::Vector::iterator aIter = xColumns->get().begin();
@@ -785,7 +785,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
{
(*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
OSL_TRACE("Prop Column Name : %s\n", OUtoCStr( aColName ) );
- if ( m_aParameterRow.isValid() ) {
+ if ( m_aParameterRow.is() ) {
aParameterValue = (m_aParameterRow->get())[(sal_uInt16)i];
#if OSL_DEBUG_LEVEL > 0
OSL_TRACE("Prop Value : %s\n", OUtoCStr( aParameterValue ) );
@@ -896,7 +896,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
OSQLParseNode *pColumn;
OSQLParseNode *pAtom;
OSQLParseNode *pOptEscape;
- const OSQLParseNode* pPart2 = parseTree->getChild(1);
+ const OSQLParseNode* pPart2 = parseTree->getChild(1);
pColumn = parseTree->getChild(0); // Match Item
pAtom = pPart2->getChild(parseTree->count()-2); // Match String
pOptEscape = pPart2->getChild(parseTree->count()-1); // Opt Escape Rule
@@ -1024,7 +1024,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
else if (SQL_ISRULE(parseTree,test_for_null))
{
OSL_ENSURE(parseTree->count() == 2,"Error in ParseTree");
- const OSQLParseNode* pPart2 = parseTree->getChild(1);
+ const OSQLParseNode* pPart2 = parseTree->getChild(1);
OSL_ENSURE(SQL_ISTOKEN(pPart2->getChild(0),IS),"Error in ParseTree");
if (!SQL_ISRULE(parseTree->getChild(0),column_ref))
@@ -1065,7 +1065,7 @@ void OResultSet::fillRowData()
OConnection* xConnection = static_cast<OConnection*>(m_pStatement->getConnection().get());
m_xColumns = m_pSQLIterator->getSelectColumns();
- OSL_ENSURE(m_xColumns.isValid(), "Need the Columns!!");
+ OSL_ENSURE(m_xColumns.is(), "Need the Columns!!");
OSQLColumns::Vector::const_iterator aIter = m_xColumns->get().begin();
const ::rtl::OUString sProprtyName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME);
@@ -1166,7 +1166,7 @@ sal_Int32 OResultSet::getRowForCardNumber(sal_Int32 nCardNum)
{
OSL_TRACE("In/Out: OResultSet::getRowForCardNumber, nCardNum = %u", nCardNum );
- if ( m_pKeySet.isValid() )
+ if ( m_pKeySet.is() )
{
sal_Int32 nPos;
for(nPos=0;nPos < (sal_Int32)m_pKeySet->get().size();nPos++)
@@ -1204,7 +1204,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
fillRowData();
- OSL_ENSURE(m_xColumns.isValid(), "Need the Columns!!");
+ OSL_ENSURE(m_xColumns.is(), "Need the Columns!!");
// sal_Int32 nColumnCount = m_xColumns->size();
// initializeRow(m_aRow,nColumnCount);
@@ -1329,7 +1329,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
m_pKeySet = new OKeySet();
// Handle the DISTINCT case
- if ( bDistinct && m_pKeySet.isValid() )
+ if ( bDistinct && m_pKeySet.is() )
{
OValueRow aSearchRow = new OValueVector( m_aRow->get().size() );
@@ -1369,7 +1369,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
// -----------------------------------------------------------------------------
void OResultSet::setBoundedColumns(const OValueRow& _rRow,
- const ::vos::ORef<connectivity::OSQLColumns>& _rxColumns,
+ const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
const Reference<XIndexAccess>& _xNames,
sal_Bool _bSetColumnMapping,
const Reference<XDatabaseMetaData>& _xMetaData,
@@ -1510,13 +1510,13 @@ sal_Int32 OResultSet::deletedCount()
{
impl_ensureKeySet();
return m_CurrentRowCount - m_pKeySet->get().size();
-
+
}
// -----------------------------------------------------------------------------
sal_Bool OResultSet::seekRow( eRowPosition pos, sal_Int32 nOffset )
{
ResultSetEntryGuard aGuard( *this );
- if ( !m_pKeySet.isValid() )
+ if ( !m_pKeySet.is() )
m_pStatement->getOwnConnection()->throwSQLException( STR_ILLEGAL_MOVEMENT, *this );
sal_Int32 nNumberOfRecords = m_aQuery.getRealRowCount();
@@ -1566,7 +1566,7 @@ sal_Bool OResultSet::seekRow( eRowPosition pos, sal_Int32 nOffset )
}
else //The requested row has not been retrived until now. We should get the right card for it.
nCurCard = nCurPos + deletedCount();
-
+
while ( nCurCard > nNumberOfRecords && !m_aQuery.queryComplete() ) {
m_aQuery.checkRowAvailable( nCurCard );
if ( m_aQuery.hadError() )
@@ -1606,7 +1606,7 @@ void OResultSet::setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMappin
ResultSetEntryGuard aGuard( *this );
if ( fetchCurrentRow() == sal_False )
m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this );
-
+
OSL_ENSURE((!m_aRow->isDeleted()),"getBookmark called for deleted row");
return makeAny((sal_Int32)(m_aRow->get())[0]);
}
@@ -1644,7 +1644,7 @@ sal_Int32 OResultSet::compareBookmarks( const ::com::sun::star::uno::Any& lhs, c
nResult = 1;
else
nResult = 0;
-
+
return nResult;
}
sal_Bool OResultSet::hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
@@ -1662,7 +1662,7 @@ sal_Int32 OResultSet::hashBookmark( const ::com::sun::star::uno::Any& bookmark )
sal_Int32 OResultSet::getCurrentCardNumber()
{
- if ( ( m_nRowPos == 0 ) || !m_pKeySet.isValid() )
+ if ( ( m_nRowPos == 0 ) || !m_pKeySet.is() )
return 0;
if (m_pKeySet->get().size() < m_nRowPos)
return 0;
@@ -1672,7 +1672,7 @@ void OResultSet::checkPendingUpdate() throw(SQLException, RuntimeException)
{
OSL_TRACE("checkPendingUpdate, m_nRowPos = %u", m_nRowPos );
const sal_Int32 nCurrentRow = getCurrentCardNumber();
-
+
if ((m_nNewRow && nCurrentRow != m_nNewRow)
|| ( m_nUpdatedRow && m_nUpdatedRow != nCurrentRow))
{
@@ -1682,7 +1682,7 @@ void OResultSet::checkPendingUpdate() throw(SQLException, RuntimeException)
) );
::dbtools::throwGenericSQLException(sError,*this);
}
-
+
}
void OResultSet::updateValue(sal_Int32 columnIndex ,const ORowSetValue& x) throw(SQLException, RuntimeException)
{
@@ -1859,14 +1859,14 @@ void SAL_CALL OResultSet::updateRow( ) throw(::com::sun::star::sdbc::SQLExcepti
m_RowStates = RowStates_Error;
m_pStatement->getOwnConnection()->throwSQLException( STR_ROW_CAN_NOT_SAVE, *this );
}
-
+
if (!m_aQuery.commitRow(nCurrentCard))
{
m_RowStates = RowStates_Error;
m_nUpdatedRow = 0;
m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
}
-
+
m_nUpdatedRow = 0;
fetchCurrentRow();
OSL_TRACE("updateRow out, m_nRowPos = %u", m_nRowPos );
@@ -1878,7 +1878,7 @@ void SAL_CALL OResultSet::deleteRow( ) throw(::com::sun::star::sdbc::SQLExcepti
ResultSetEntryGuard aGuard( *this );
if (rowDeleted())
m_pStatement->getOwnConnection()->throwSQLException( STR_ROW_ALREADY_DELETED, *this );
-
+
const sal_Int32 nCurrentRow = getCurrentCardNumber();
//fetchRow(nCurrentRow);
if (!nCurrentRow)
@@ -1907,7 +1907,7 @@ void SAL_CALL OResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLE
OSL_TRACE("moveToInsertRow in, m_nRowPos = %u", m_nRowPos );
ResultSetEntryGuard aGuard( *this );
m_nOldRowPos = m_nRowPos;
-
+
if (!m_nNewRow) //no new row now, insert one
{
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
@@ -1920,7 +1920,7 @@ void SAL_CALL OResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLE
m_nNewRow = m_aQuery.createNewCard();
if (!m_nNewRow)
m_pStatement->getOwnConnection()->throwSQLException( STR_CAN_NOT_CREATE_ROW, *this );
-
+
m_RowStates = RowStates_Normal;
fillKeySet(m_nNewRow);
}
@@ -1954,10 +1954,10 @@ sal_Bool OResultSet::determineReadOnly()
return m_bIsReadOnly != 0;
}
-void OResultSet::setTable(OTable* _rTable)
-{
+void OResultSet::setTable(OTable* _rTable)
+{
OSL_TRACE("In : setTable");
- m_pTable = _rTable;
+ m_pTable = _rTable;
m_pTable->acquire();
m_xTableColumns = m_pTable->getColumns();
if(m_xTableColumns.is())
@@ -1965,9 +1965,9 @@ void OResultSet::setTable(OTable* _rTable)
OSL_TRACE("Out : setTable");
}
-void OResultSet::setOrderByColumns(const ::std::vector<sal_Int32>& _aColumnOrderBy)
+void OResultSet::setOrderByColumns(const ::std::vector<sal_Int32>& _aColumnOrderBy)
{
- m_aOrderbyColumnNumber = _aColumnOrderBy;
+ m_aOrderbyColumnNumber = _aColumnOrderBy;
}
void OResultSet::setOrderByAscending(const ::std::vector<TAscendingOrder>& _aOrderbyAsc)