summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/file/FResultSet.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/file/FResultSet.cxx')
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx194
1 files changed, 81 insertions, 113 deletions
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index b9b7180eb65e..b0e774d9f9a5 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
-#include <limits> // included here to prevent problems if compiling with C52
#ifdef GCC
#include <iostream>
@@ -74,7 +74,7 @@ using namespace com::sun::star::sdbc;
using namespace com::sun::star::sdbcx;
using namespace com::sun::star::container;
-// Maximale Anzahl von Rows, die mit ORDER BY sortiert durchlaufen werden koennen:
+// Maximal number of Rows, that can be processed being sorted with ORDER BY:
#define MAX_KEYSET_SIZE 0x40000 // 256K
namespace
@@ -191,7 +191,7 @@ void OResultSet::clear()
m_pFileSet = NULL;
DELETEZ(m_pSortIndex);
- if(m_aInsertRow.isValid())
+ if(m_aInsertRow.is())
m_aInsertRow->get().clear();
m_aSkipDeletedSet.clear();
@@ -240,7 +240,6 @@ const ORowSetValue& OResultSet::getValue(sal_Int32 columnIndex ) throw(::com::su
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- //columnIndex = mapColumn(columnIndex);
checkIndex(columnIndex );
@@ -252,8 +251,7 @@ void OResultSet::checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc
{
//RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::checkIndex" );
if ( columnIndex <= 0
- // || columnIndex > (sal_Int32)m_xColumns->size()
- || columnIndex >= m_nColumnCount )
+ || columnIndex >= m_nColumnCount )
::dbtools::throwInvalidIndexException(*this);
}
// -------------------------------------------------------------------------
@@ -583,12 +581,12 @@ sal_Bool OResultSet::evaluate()
{
if(m_pEvaluationKeySet)
{
- bRet = m_pTable->fetchRow(m_aEvaluateRow,m_pTable->getTableColumns().getBody(),sal_True,sal_True);
+ bRet = m_pTable->fetchRow(m_aEvaluateRow,*(m_pTable->getTableColumns()),sal_True,sal_True);
evaluate();
}
else
- bRet = m_pTable->fetchRow(m_aRow,m_xColumns.getBody(),sal_False,sal_True);
+ bRet = m_pTable->fetchRow(m_aRow,*m_xColumns,sal_False,sal_True);
}
}
@@ -645,8 +643,8 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
// we know that we append new rows at the end
// so we have to know where the end is
m_aSkipDeletedSet.skipDeleted(IResultSetHelper::LAST,1,sal_False);
- m_bRowInserted = m_pTable->InsertRow(m_aInsertRow.getBody(), sal_True,m_xColsIdx);
- if(m_bRowInserted && m_pFileSet.isValid())
+ m_bRowInserted = m_pTable->InsertRow(*m_aInsertRow, sal_True, m_xColsIdx);
+ if(m_bRowInserted && m_pFileSet.is())
{
sal_Int32 nPos = (m_aInsertRow->get())[0]->getValue();
m_pFileSet->get().push_back(nPos);
@@ -666,7 +664,7 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
if(!m_pTable || m_pTable->isReadOnly())
lcl_throwError(STR_TABLE_READONLY,*this);
- m_bRowUpdated = m_pTable->UpdateRow(m_aInsertRow.getBody(), m_aRow,m_xColsIdx);
+ m_bRowUpdated = m_pTable->UpdateRow(*m_aInsertRow, m_aRow,m_xColsIdx);
*(m_aInsertRow->get())[0] = (sal_Int32)(m_aRow->get())[0]->getValue();
clearInsertRow();
@@ -687,8 +685,8 @@ void SAL_CALL OResultSet::deleteRow() throw(SQLException, RuntimeException)
lcl_throwError(STR_ROW_ALREADY_DELETED,*this);
sal_Int32 nPos = (sal_Int32)(m_aRow->get())[0]->getValue();
- m_bRowDeleted = m_pTable->DeleteRow(m_xColumns.getBody());
- if(m_bRowDeleted && m_pFileSet.isValid())
+ m_bRowDeleted = m_pTable->DeleteRow(*m_xColumns);
+ if(m_bRowDeleted && m_pFileSet.is())
{
m_aRow->setDeleted(sal_True);
// don't touch the m_pFileSet member here
@@ -708,7 +706,7 @@ void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeExcept
m_bRowInserted = sal_False;
m_bRowDeleted = sal_False;
- if(m_aInsertRow.isValid())
+ if(m_aInsertRow.is())
{
OValueRefVector::Vector::iterator aIter = m_aInsertRow->get().begin()+1;
for(;aIter != m_aInsertRow->get().end();++aIter)
@@ -909,11 +907,11 @@ sal_Bool OResultSet::ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition,
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::ExecuteRow" );
OSL_ENSURE(m_pSQLAnalyzer,"OResultSet::ExecuteRow: Analyzer isn't set!");
- // Fuer weitere Fetch-Operationen werden diese Angaben ggf. veraendert ...
+ // For further Fetch-Operations this information may possibly be changed ...
IResultSetHelper::Movement eCursorPosition = eFirstCursorPosition;
sal_Int32 nOffset = nFirstOffset;
- const OSQLColumns & rTableCols = m_pTable->getTableColumns().getBody();
+ const OSQLColumns & rTableCols = *(m_pTable->getTableColumns());
sal_Bool bHasRestriction = m_pSQLAnalyzer->hasRestriction();
again:
@@ -929,7 +927,7 @@ again:
return sal_False;
}
- if (!bEvaluate) // Laeuft keine Auswertung, dann nur Ergebniszeile fuellen
+ if (!bEvaluate) // If no evaluation runs, then just fill the results-row
{
m_pTable->fetchRow(m_aRow,rTableCols, sal_True,bRetrieveData);
}
@@ -944,8 +942,8 @@ again:
&& !m_pSQLAnalyzer->evaluateRestriction()
)
)
- { // naechsten Satz auswerten
- // aktuelle Zeile loeschen im Keyset
+ { // Evaluate the next record
+ // delete current row in Keyset
if (m_pEvaluationKeySet)
{
++m_aEvaluateIter;
@@ -956,10 +954,9 @@ again:
return sal_False;
}
}
- else if (m_pFileSet.isValid())
+ else if (m_pFileSet.is())
{
- OSL_ENSURE(//!m_pFileSet->IsFrozen() &&
- eCursorPosition == IResultSetHelper::NEXT, "Falsche CursorPosition!");
+ OSL_ENSURE(eCursorPosition == IResultSetHelper::NEXT, "Falsche CursorPosition!");
eCursorPosition = IResultSetHelper::NEXT;
nOffset = 1;
}
@@ -982,16 +979,15 @@ again:
}
else
{
- // aStatus.Set(SQL_STAT_NO_DATA_FOUND);
return sal_False;
}
- // Nochmal probieren ...
+ // Try again ...
goto again;
}
}
- // Evaluate darf nur gesetzt sein,
- // wenn der Keyset weiter aufgebaut werden soll
+ // Evaluate may only be set,
+ // if the Keyset will be constructed further
if ( ( m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT )
&& !isCount()
&& bEvaluate
@@ -1002,9 +998,8 @@ again:
OKeyValue* pKeyValue = GetOrderbyKeyValue( m_aSelectRow );
m_pSortIndex->AddKeyValue(pKeyValue);
}
- else if (m_pFileSet.isValid())
+ else if (m_pFileSet.is())
{
- // OSL_ENSURE(!m_pFileSet->IsFrozen() , "Falsche CursorPosition!");
sal_uInt32 nBookmarkValue = Abs((sal_Int32)(m_aEvaluateRow->get())[0]->getValue());
m_pFileSet->get().push_back(nBookmarkValue);
}
@@ -1014,14 +1009,14 @@ again:
sal_Bool bOK = sal_True;
if (bEvaluate)
{
- // jetzt die eigentliche Ergebniszeile Lesen
- bOK = m_pTable->fetchRow(m_aEvaluateRow, m_pTable->getTableColumns().getBody(), sal_True,sal_True);
+ // read the actual result-row
+ bOK = m_pTable->fetchRow(m_aEvaluateRow, *(m_pTable->getTableColumns()), sal_True,sal_True);
}
if (bOK)
{
- // Nur die zu aendernden Werte uebergeben:
- if(!m_pTable->UpdateRow(m_aAssignValues.getBody(),m_aEvaluateRow,m_xColsIdx))
+ // just give the values to be changed:
+ if(!m_pTable->UpdateRow(*m_aAssignValues,m_aEvaluateRow, m_xColsIdx))
return sal_False;
}
}
@@ -1030,11 +1025,11 @@ again:
sal_Bool bOK = sal_True;
if (bEvaluate)
{
- bOK = m_pTable->fetchRow(m_aEvaluateRow, m_pTable->getTableColumns().getBody(), sal_True,sal_True);
+ bOK = m_pTable->fetchRow(m_aEvaluateRow, *(m_pTable->getTableColumns()), sal_True,sal_True);
}
if (bOK)
{
- if(!m_pTable->DeleteRow(m_xColumns.getBody()))
+ if(!m_pTable->DeleteRow(*m_xColumns))
return sal_False;
}
}
@@ -1049,15 +1044,13 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
//IgnoreDeletedRows:
//
sal_Int32 nTempPos = m_nRowPos;
- // exclusiver zugriff auf die Tabelle
- // vos::OGuard* pGuard = m_pTable->Lock();
if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT &&
!isCount())
{
- if (!m_pFileSet.isValid()) // kein Index verfuegbar
+ if (!m_pFileSet.is()) //no Index available
{
- // Normales FETCH
+ // Normal FETCH
ExecuteRow(eCursorPosition,nOffset,sal_False,bRetrieveData);
// now set the bookmark for outside this is the logical pos and not the file pos
@@ -1078,7 +1071,6 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
m_nRowPos = 0;
break;
case IResultSetHelper::LAST:
- // OSL_ENSURE(IsRowCountFinal(), "Fehler im Keyset!"); // muss eingefroren sein, sonst Fehler beim SQLCursor
m_nRowPos = m_pFileSet->get().size() - 1;
break;
case IResultSetHelper::RELATIVE:
@@ -1093,19 +1085,18 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
}
// OffRange?
- // Der FileCursor ist ausserhalb des gueltigen Bereichs, wenn
+ // The FileCursor is outside of the valid range, if:
// a.) m_nRowPos < 1
- // b.) Ein KeySet besteht und m_nRowPos > m_pFileSet->size()
+ // b.) a KeySet exists and m_nRowPos > m_pFileSet->size()
if (m_nRowPos < 0 || (m_pFileSet->isFrozen() && eCursorPosition != IResultSetHelper::BOOKMARK && m_nRowPos >= (sal_Int32)m_pFileSet->get().size() )) // && m_pFileSet->IsFrozen()
{
- // aStatus.Set(SQL_STAT_NO_DATA_FOUND);
goto Error;
}
else
{
if (m_nRowPos < (sal_Int32)m_pFileSet->get().size())
{
- // Fetch ueber Index
+ // Fetch via Index
ExecuteRow(IResultSetHelper::BOOKMARK,(m_pFileSet->get())[m_nRowPos],sal_False,bRetrieveData);
// now set the bookmark for outside
@@ -1115,24 +1106,22 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
m_pSQLAnalyzer->setSelectionEvaluationResult(m_aSelectRow,m_aColMapping);
}
}
- else // Index muss weiter aufgebaut werden
+ else // Index must be further constructed
{
- // Zunaechst auf die letzte bekannte Zeile setzen
+ // set first on the last known row
if (!m_pFileSet->get().empty())
{
m_aFileSetIter = m_pFileSet->get().end()-1;
- // m_pFileSet->SeekPos(m_pFileSet->size()-1);
m_pTable->seekRow(IResultSetHelper::BOOKMARK, *m_aFileSetIter, m_nFilePos);
}
sal_Bool bOK = sal_True;
- // Ermitteln der Anzahl weiterer Fetches
+ // Determine the number of further Fetches
while (bOK && m_nRowPos >= (sal_Int32)m_pFileSet->get().size())
{
if (m_pEvaluationKeySet)
{
if (m_nRowPos >= (sal_Int32)m_pEvaluationKeySet->size())
return sal_False;
- // aStatus.Set(SQL_STAT_NO_DATA_FOUND);
else if (m_nRowPos == 0)
{
m_aEvaluateIter = m_pEvaluationKeySet->begin();
@@ -1150,8 +1139,8 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
if (bOK)
{
- // jetzt nochmal die Ergebnisse lesen
- m_pTable->fetchRow(m_aRow, m_pTable->getTableColumns().getBody(), sal_True,bRetrieveData);
+ // read the results again
+ m_pTable->fetchRow(m_aRow, *(m_pTable->getTableColumns()), sal_True,bRetrieveData);
// now set the bookmark for outside
*(*m_aRow->get().begin()) = sal_Int32(m_nRowPos + 1);
@@ -1161,14 +1150,10 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
m_pSQLAnalyzer->setSelectionEvaluationResult(m_aSelectRow,m_aColMapping);
}
}
- else if (!m_pFileSet->isFrozen()) // keinen gueltigen Satz gefunden
+ else if (!m_pFileSet->isFrozen()) // no valid record found
{
- //m_pFileSet->Freeze();
m_pFileSet->setFrozen();
-
- // DELETEZ(m_pEvaluationKeySet);
m_pEvaluationKeySet = NULL;
- // aStatus.Set(SQL_STAT_NO_DATA_FOUND);
goto Error;
}
}
@@ -1177,7 +1162,7 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
}
else if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT && isCount())
{
- // Fetch des COUNT(*)
+ // Fetch the COUNT(*)
switch (eCursorPosition)
{
case IResultSetHelper::NEXT:
@@ -1205,8 +1190,8 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
goto Error;
else if (m_nRowPos == 0)
{
- // COUNT(*) in Ergebnisrow packen
- // (muss die erste und einzige Variable in der Row sein)
+ // put COUNT(*) in result-row
+ // (must be the first and only variable in the row)
if (m_aRow->get().size() >= 2)
{
*(m_aRow->get())[1] = m_nRowCountResult;
@@ -1223,14 +1208,14 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
}
}
else
- // Fetch nur bei SELECT moeglich!
+ // Fetch only possible at SELECT!
return sal_False;
return sal_True;
Error:
- // steht der Cursor vor dem ersten Satz
- // dann wird die position beibehalten
+ // is the Cursor positioned before the first row
+ // then the position will be maintained
if (nTempPos == -1)
m_nRowPos = nTempPos;
else
@@ -1246,17 +1231,14 @@ Error:
case IResultSetHelper::ABSOLUTE:
case IResultSetHelper::RELATIVE:
if (nOffset > 0)
- m_nRowPos = m_pFileSet.isValid() ? (sal_Int32)m_pFileSet->get().size() : -1;
+ m_nRowPos = m_pFileSet.is() ? (sal_Int32)m_pFileSet->get().size() : -1;
else if (nOffset < 0)
m_nRowPos = -1;
break;
case IResultSetHelper::BOOKMARK:
- m_nRowPos = nTempPos; // vorherige Position
+ m_nRowPos = nTempPos; // last Position
}
}
- // delete pGuard;
- // rMode = (!bShowDeleted && aStatus.IsSuccessful() && m_aRow->isDeleted()) ? // keine Anzeige von geloeschten Saetzen
- // OCursor::SQL_MOD_INVALID : OCursor::SQL_MOD_NONE;
return sal_False;
}
// -------------------------------------------------------------------------
@@ -1265,11 +1247,11 @@ void OResultSet::sortRows()
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::sortRows" );
if (!m_pSQLAnalyzer->hasRestriction() && m_aOrderbyColumnNumber.size() == 1)
{
- // Ist nur ein Feld fuer die Sortierung angegeben
- // Und diese Feld ist indiziert, dann den Index ausnutzen
+ // is just one field given for sorting
+ // and this field is indexed, then the Index will be used
Reference<XIndexesSupplier> xIndexSup;
m_pTable->queryInterface(::getCppuType((const Reference<XIndexesSupplier>*)0)) >>= xIndexSup;
- // Reference<XIndexesSupplier> xIndexSup(m_pTable,UNO_QUERY);
+
Reference<XIndexAccess> xIndexes;
if(xIndexSup.is())
{
@@ -1324,10 +1306,10 @@ void OResultSet::sortRows()
eKeyType[i] = SQL_ORDERBYKEY_DOUBLE;
break;
- // Andere Typen sind nicht implementiert (und damit immer sal_False)
+ // Other types aren't implemented (so they are always FALSE)
default:
eKeyType[i] = SQL_ORDERBYKEY_NONE;
- OSL_ASSERT("OFILECursor::Execute: Datentyp nicht implementiert");
+ OSL_FAIL("OFILECursor::Execute: Datentyp nicht implementiert");
break;
}
(m_aSelectRow->get())[*aOrderByIter]->setBound(sal_True);
@@ -1357,15 +1339,12 @@ void OResultSet::sortRows()
}
}
- // Sortiertes Keyset erzeugen
- // DELETEZ(m_pEvaluationKeySet);
+ // create sorted Keyset
m_pEvaluationKeySet = NULL;
m_pFileSet = NULL;
m_pFileSet = m_pSortIndex->CreateKeySet();
- // if(!bDistinct)
- // SetRowCount(pFileSet->count());
DELETEZ(m_pSortIndex);
- // Nun kann ueber den Index sortiert zugegriffen werden.
+ // now access to a sorted set is possible via Index
}
@@ -1405,17 +1384,14 @@ sal_Bool OResultSet::OpenImpl()
m_nResultSetConcurrency = (m_pTable->isReadOnly() || isCount()) ? ResultSetConcurrency::READ_ONLY : ResultSetConcurrency::UPDATABLE;
- // Neuen Index aufbauen:
+ // create new Index:
m_pFileSet = NULL;
- // DELETEZ(m_pEvaluationKeySet);
- // An den Anfang positionieren
+ // position at the beginning
m_nRowPos = -1;
m_nFilePos = 0;
m_nRowCountResult = -1;
- // exclusiver zugriff auf die Tabelle
- // vos::OGuard* pGuard = pTable->Lock();
m_nLastVisitedPos = m_pTable->getCurrentLastPos();
switch(m_aSQLIterator.getStatementType())
@@ -1428,8 +1404,8 @@ sal_Bool OResultSet::OpenImpl()
lcl_throwError(STR_QUERY_COMPLEX_COUNT,*this);
m_nRowCountResult = 0;
- // Vorlaeufig einfach ueber alle Datensaetze iterieren und
- // dabei die Aktionen bearbeiten (bzw. einfach nur zaehlen):
+ // for now simply iterate over all rows and
+ // do all actions (or just count)
{
sal_Bool bOK = sal_True;
if (m_pEvaluationKeySet)
@@ -1456,11 +1432,9 @@ sal_Bool OResultSet::OpenImpl()
}
}
- // Ergebnis von COUNT(*) in m_nRowCountResult merken.
- // nRowCount, also die Anzahl der Rows in der Ergebnismenge, ist bei dieser
- // Anfrage = 1!
+ // save result of COUNT(*) in m_nRowCountResult.
+ // nRowCount (number of Rows in the result) = 1 for this request!
m_pEvaluationKeySet = NULL;
- // DELETEZ(m_pEvaluationKeySet);
}
}
else
@@ -1476,7 +1450,7 @@ sal_Bool OResultSet::OpenImpl()
// Sort on all columns, saving original order for later
if(IsSorted())
{
- aOrderbyColumnNumberSave = m_aOrderbyColumnNumber;// .assign(m_aOrderbyColumnNumber.begin(), m_aOrderbyColumnNumber.end());
+ aOrderbyColumnNumberSave = m_aOrderbyColumnNumber;
m_aOrderbyColumnNumber.clear();
aOrderbyAscendingSave.assign(m_aOrderbyAscending.begin(), m_aOrderbyAscending.end());
bWasSorted = sal_True;
@@ -1485,7 +1459,6 @@ sal_Bool OResultSet::OpenImpl()
// the first column is the bookmark column
::std::vector<sal_Int32>::iterator aColStart = (m_aColMapping.begin()+1);
::std::copy(aColStart, m_aColMapping.end(),::std::back_inserter(m_aOrderbyColumnNumber));
-// m_aOrderbyColumnNumber.assign(aColStart, m_aColMapping.end());
m_aOrderbyAscending.assign(m_aColMapping.size()-1, SQL_ASC);
bDistinct = sal_True;
}
@@ -1493,14 +1466,13 @@ sal_Bool OResultSet::OpenImpl()
if (IsSorted())
sortRows();
- if (!m_pFileSet.isValid())
+ if (!m_pFileSet.is())
{
m_pFileSet = new OKeySet();
if (!m_pSQLAnalyzer->hasRestriction())
- // jetzt kann das Keyset schon gefuellt werden!
- // Aber Achtung: es wird davon ausgegangen, das die FilePositionen als Folge 1..n
- // abgelegt werden!
+ // now the Keyset can be filled!
+ // But be careful: It is assumed, that the FilePositions will be stored as sequence 1..n
{
if ( m_nLastVisitedPos > 0)
m_pFileSet->get().reserve( m_nLastVisitedPos );
@@ -1508,9 +1480,9 @@ sal_Bool OResultSet::OpenImpl()
m_pFileSet->get().push_back(i + 1);
}
}
- OSL_ENSURE(m_pFileSet.isValid(),"Kein KeySet vorhanden! :-(");
+ OSL_ENSURE(m_pFileSet.is(),"Kein KeySet vorhanden! :-(");
- if(bDistinct && m_pFileSet.isValid()) // sicher ist sicher
+ if(bDistinct && m_pFileSet.is())
{
OValueRow aSearchRow = new OValueVector(m_aRow->get().size());
OValueRefVector::Vector::iterator aRowIter = m_aRow->get().begin();
@@ -1542,7 +1514,6 @@ sal_Bool OResultSet::OpenImpl()
copyFrom != m_aSelectRow->get().end();
++copyFrom,++copyTo)
*copyTo = *(*copyFrom);
- // *aSearchRow = *m_aRow;
}
// compare with next row
@@ -1588,17 +1559,16 @@ sal_Bool OResultSet::OpenImpl()
::std::sort(m_pFileSet->get().begin(),m_pFileSet->get().end());
}
}
- // SetRowCount(m_pFileSet->count());
}
}
} break;
case SQL_STATEMENT_UPDATE:
case SQL_STATEMENT_DELETE:
- // waehrend der Bearbeitung die Anzahl der bearbeiteten Rows zaehlen:
+ // during processing count the number of processed Rows
m_nRowCountResult = 0;
- // Vorlaeufig einfach ueber alle Datensaetze iterieren und
- // dabei die Aktionen bearbeiten (bzw. einfach nur zaehlen):
+ // for now simply iterate over all rows and
+ // run the actions (or simply count):
{
sal_Bool bOK = sal_True;
@@ -1626,19 +1596,16 @@ sal_Bool OResultSet::OpenImpl()
}
}
- // Ergebnis von COUNT(*) in nRowCountResult merken.
- // nRowCount, also die Anzahl der Rows in der Ergebnismenge, ist bei dieser
- // Anfrage = 1!
- // DELETEZ(m_pEvaluationKeySet);
+ // save result of COUNT(*) in nRowCountResult.
+ // nRowCount (number of rows in the result-set) = 1 for this request!
m_pEvaluationKeySet = NULL;
}
- // SetRowCount(1);
break;
case SQL_STATEMENT_INSERT:
m_nRowCountResult = 0;
- OSL_ENSURE(m_aAssignValues.isValid(),"No assign values set!");
- if(!m_pTable->InsertRow(m_aAssignValues.getBody(), sal_True,m_xColsIdx))
+ OSL_ENSURE(m_aAssignValues.is(),"No assign values set!");
+ if(!m_pTable->InsertRow(*m_aAssignValues, sal_True,m_xColsIdx))
{
m_nFilePos = 0;
return sal_False;
@@ -1647,11 +1614,11 @@ sal_Bool OResultSet::OpenImpl()
m_nRowCountResult = 1;
break;
default:
- OSL_ENSURE( false, "OResultSet::OpenImpl: unsupported statement type!" );
+ OSL_FAIL( "OResultSet::OpenImpl: unsupported statement type!" );
break;
}
- // FilePos zuruecksetzen
+ // reset FilePos
m_nFilePos = 0;
return sal_True;
@@ -1685,7 +1652,7 @@ sal_Int64 OResultSet::getSomething( const Sequence< sal_Int8 > & rId ) throw (Ru
// -----------------------------------------------------------------------------
void OResultSet::setBoundedColumns(const OValueRefRow& _rRow,
const OValueRefRow& _rSelectRow,
- const ::vos::ORef<connectivity::OSQLColumns>& _rxColumns,
+ const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
const Reference<XIndexAccess>& _xNames,
sal_Bool _bSetColumnMapping,
const Reference<XDatabaseMetaData>& _xMetaData,
@@ -1757,7 +1724,7 @@ void OResultSet::setBoundedColumns(const OValueRefRow& _rRow,
}
catch (Exception&)
{
- OSL_ENSURE(sal_False, "OResultSet::setBoundedColumns: caught an Exception!");
+ OSL_FAIL("OResultSet::setBoundedColumns: caught an Exception!");
}
}
// in this case we got more select columns as columns exist in the table
@@ -1852,7 +1819,7 @@ void OResultSet::clearInsertRow()
void OResultSet::initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::initializeRow" );
- if(!_rRow.isValid())
+ if(!_rRow.is())
{
_rRow = new OValueRefVector(_nColumnCount);
(_rRow->get())[0]->setBound(sal_True);
@@ -1893,7 +1860,6 @@ sal_Bool OResultSet::isRowDeleted() const
void SAL_CALL OResultSet::disposing( const EventObject& Source ) throw (RuntimeException)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::disposing" );
- // Reference<XInterface> xInt = m_pTable;
Reference<XPropertySet> xProp = m_pTable;
if(m_pTable && Source.Source == xProp)
{
@@ -1902,3 +1868,5 @@ void SAL_CALL OResultSet::disposing( const EventObject& Source ) throw (RuntimeE
}
}
// -----------------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */