diff options
author | Rob Snelders <programming@ertai.nl> | 2011-02-18 21:46:25 +0100 |
---|---|---|
committer | Christina Rossmanith <ChrRossmanith@web.de> | 2011-02-18 21:46:25 +0100 |
commit | 55bc287b63bc70e7ffe2defabd65e1ce8be0d7fe (patch) | |
tree | bcd8c0c96488c6a52a6a159c31ef550f59ef6f12 /connectivity | |
parent | f59d6cfdba99b225119d505fdd36cbdcb6dcd20b (diff) |
translated comments (25-29/54)
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/file/FResultSet.cxx | 108 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FStatement.cxx | 50 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fanalyzer.cxx | 29 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fcode.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fcomp.cxx | 37 |
5 files changed, 114 insertions, 122 deletions
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 054fe31424b8..c503b5ecdda8 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -75,10 +75,9 @@ 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: #if defined (WIN) -#define MAX_KEYSET_SIZE 0x3ff0 // Etwas weniger als ein Segment, damit - // noch Platz fuer Memory Debug-Informationen +#define MAX_KEYSET_SIZE 0x3ff0 // Somewhat less than a Segment, so there is still room for Memory-Debug-Information #else #define MAX_KEYSET_SIZE 0x40000 // 256K #endif @@ -915,7 +914,7 @@ 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; INT32 nOffset = nFirstOffset; @@ -935,7 +934,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,10 +943,10 @@ again: m_pTable->fetchRow(m_aEvaluateRow, rTableCols, sal_True,bRetrieveData || bHasRestriction); if ( (!m_bShowDeleted && m_aEvaluateRow->isDeleted()) - || (bHasRestriction && //!bShowDeleted && m_aEvaluateRow->isDeleted() ||// keine Anzeige von geloeschten Saetzen - !m_pSQLAnalyzer->evaluateRestriction())) // Auswerten der Bedingungen - { // naechsten Satz auswerten - // aktuelle Zeile loeschen im Keyset + || (bHasRestriction && //!bShowDeleted && m_aEvaluateRow->isDeleted() ||// no display of deleted records + !m_pSQLAnalyzer->evaluateRestriction())) + { // Evaluate the next record + // delete current row in Keyset if (m_pEvaluationKeySet) { ++m_aEvaluateIter; @@ -987,13 +986,13 @@ again: // 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() && (m_pFileSet.is() || m_pSortIndex) && bEvaluate) { @@ -1014,13 +1013,13 @@ again: sal_Bool bOK = sal_True; if (bEvaluate) { - // jetzt die eigentliche Ergebniszeile Lesen + // read the actual result-row bOK = m_pTable->fetchRow(m_aEvaluateRow, *(m_pTable->getTableColumns()), sal_True,TRUE); } if (bOK) { - // Nur die zu aendernden Werte uebergeben: + // just give the values to be changed: if(!m_pTable->UpdateRow(*m_aAssignValues,m_aEvaluateRow, m_xColsIdx)) return sal_False; } @@ -1053,9 +1052,9 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT && !isCount()) { - if (!m_pFileSet.is()) // kein Index verfuegbar + if (!m_pFileSet.is()) //no Index available { - // Normales FETCH + // Normal FETCH ExecuteRow(eCursorPosition,nOffset,FALSE,bRetrieveData); // now set the bookmark for outside this is the logical pos and not the file pos @@ -1076,7 +1075,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, m_nRowPos = 0; break; case IResultSetHelper::LAST: - // OSL_ENSURE(IsRowCountFinal(), "Fehler im Keyset!"); // muss eingefroren sein, sonst Fehler beim SQLCursor + // OSL_ENSURE(IsRowCountFinal(), "Error in Keyset!"); // must be frozen, otherwise error at SQLCursor m_nRowPos = m_pFileSet->get().size() - 1; break; case IResultSetHelper::RELATIVE: @@ -1091,9 +1090,9 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, } // 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 >= (INT32)m_pFileSet->get().size() )) // && m_pFileSet->IsFrozen() { // aStatus.Set(SQL_STAT_NO_DATA_FOUND); @@ -1103,7 +1102,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, { if (m_nRowPos < (INT32)m_pFileSet->get().size()) { - // Fetch ueber Index + // Fetch via Index ExecuteRow(IResultSetHelper::BOOKMARK,(m_pFileSet->get())[m_nRowPos],FALSE,bRetrieveData); // now set the bookmark for outside @@ -1113,9 +1112,9 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, 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; @@ -1123,7 +1122,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, 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 >= (INT32)m_pFileSet->get().size()) { if (m_pEvaluationKeySet) @@ -1148,7 +1147,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, if (bOK) { - // jetzt nochmal die Ergebnisse lesen + // read the results again m_pTable->fetchRow(m_aRow, *(m_pTable->getTableColumns()), sal_True,bRetrieveData); // now set the bookmark for outside @@ -1159,7 +1158,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, 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(); @@ -1175,7 +1174,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, } else if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT && isCount()) { - // Fetch des COUNT(*) + // Fetch the COUNT(*) switch (eCursorPosition) { case IResultSetHelper::NEXT: @@ -1203,8 +1202,8 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, 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; @@ -1221,14 +1220,14 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, } } 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 @@ -1249,11 +1248,11 @@ Error: 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 + // rMode = (!bShowDeleted && aStatus.IsSuccessful() && m_aRow->isDeleted()) ? // no display of deleted records // OCursor::SQL_MOD_INVALID : OCursor::SQL_MOD_NONE; return sal_False; } @@ -1263,8 +1262,8 @@ 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); @@ -1322,7 +1321,7 @@ void OResultSet::sortRows() eKeyType[i] = SQL_ORDERBYKEY_DOUBLE; break; - // Andere Typen sind nicht implementiert (und damit immer FALSE) + // Other types aren't implemented (so they are always FALSE) default: eKeyType[i] = SQL_ORDERBYKEY_NONE; OSL_ASSERT("OFILECursor::Execute: Datentyp nicht implementiert"); @@ -1350,7 +1349,7 @@ void OResultSet::sortRows() } } - // Sortiertes Keyset erzeugen + // create sorted Keyset // DELETEZ(m_pEvaluationKeySet); m_pEvaluationKeySet = NULL; m_pFileSet = NULL; @@ -1358,7 +1357,7 @@ void OResultSet::sortRows() // 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 } @@ -1398,11 +1397,11 @@ 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; @@ -1419,8 +1418,8 @@ 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) @@ -1447,9 +1446,8 @@ 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); } @@ -1489,9 +1487,8 @@ BOOL OResultSet::OpenImpl() 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 ); @@ -1501,7 +1498,7 @@ BOOL OResultSet::OpenImpl() } OSL_ENSURE(m_pFileSet.is(),"Kein KeySet vorhanden! :-("); - if(bDistinct && m_pFileSet.is()) // sicher ist sicher + if(bDistinct && m_pFileSet.is()) { OValueRow aSearchRow = new OValueVector(m_aRow->get().size()); OValueRefVector::Vector::iterator aRowIter = m_aRow->get().begin(); @@ -1586,10 +1583,10 @@ BOOL OResultSet::OpenImpl() 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; @@ -1617,9 +1614,8 @@ BOOL OResultSet::OpenImpl() } } - // Ergebnis von COUNT(*) in nRowCountResult merken. - // nRowCount, also die Anzahl der Rows in der Ergebnismenge, ist bei dieser - // Anfrage = 1! + // save result of COUNT(*) in nRowCountResult. + // nRowCount (number of rows in the result-set) = 1 for this request! // DELETEZ(m_pEvaluationKeySet); m_pEvaluationKeySet = NULL; } @@ -1642,7 +1638,7 @@ BOOL OResultSet::OpenImpl() break; } - // FilePos zuruecksetzen + // reset FilePos m_nFilePos = 0; return sal_True; diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index 0d504a71d2be..e821ec63114b 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -430,7 +430,7 @@ void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef, aColumnName = pColumnRef->getChild(0)->getTokenValue(); else if (pColumnRef->count() == 3) { - // Nur die Table Range-Variable darf hier vorkommen: + // Just the Table Range-variable may appear here: // if (!(pColumnRef->getChild(0)->getTokenValue() == aTableRange)) // { // aStatus.Set(SQL_STAT_ERROR, @@ -450,8 +450,8 @@ void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef, Reference<XColumnLocate> xColLocate(m_xColNames,UNO_QUERY); if(!xColLocate.is()) return; - // Alles geprueft und wir haben den Namen der Column. - // Die wievielte Column ist das? + // Everything tested and we have the name of the Column. + // What number is the Column? try { m_aOrderbyColumnNumber.push_back(xColLocate->findColumn(aColumnName)); @@ -579,7 +579,7 @@ void OStatement_Base::initializeResultSet(OResultSet* _pResult) _pResult->setSelectRow(m_aSelectRow); m_pSQLAnalyzer->bindSelectRow(m_aRow); - m_pEvaluationKeySet = m_pSQLAnalyzer->bindEvaluationRow(m_aEvaluateRow); // Werte im Code des Compilers setzen + m_pEvaluationKeySet = m_pSQLAnalyzer->bindEvaluationRow(m_aEvaluateRow); // Set values in the code of the Compiler _pResult->setEvaluationKeySet(m_pEvaluationKeySet); } // ----------------------------------------------------------------------------- @@ -593,11 +593,11 @@ void OStatement_Base::GetAssignValues() } if (SQL_ISRULE(m_pParseTree,select_statement)) - // Keine zu setzenden Werte bei SELECT + // no values have to be set for SELECT return; else if (SQL_ISRULE(m_pParseTree,insert_statement)) { - // Row fuer die zu setzenden Werte anlegen (Referenz durch new) + // Create Row for the values to be set (Reference trough new) if(m_aAssignValues.is()) m_aAssignValues->get().clear(); sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount(); @@ -607,7 +607,7 @@ void OStatement_Base::GetAssignValues() m_aParameterIndexes.resize(nCount+1,SQL_NO_PARAMETER); - // Liste der Columns-Namen, die in der column_commalist vorkommen (mit ; getrennt): + // List of Column-Names, that exist in the column_commalist (seperated by ;): ::std::vector<String> aColumnNameList; OSL_ENSURE(m_pParseTree->count() >= 4,"OResultSet: Fehler im Parse Tree"); @@ -632,7 +632,7 @@ void OStatement_Base::GetAssignValues() OSL_ENSURE(SQL_ISRULE(pColumnCommalist,column_commalist),"OResultSet: Fehler im Parse Tree"); OSL_ENSURE(pColumnCommalist->count() > 0,"OResultSet: Fehler im Parse Tree"); - // Alle Columns in der column_commalist ... + // All Columns in the column_commalist ... for (sal_uInt32 i = 0; i < pColumnCommalist->count(); i++) { OSQLParseNode * pCol = pColumnCommalist->getChild(i); @@ -643,19 +643,19 @@ void OStatement_Base::GetAssignValues() if ( aColumnNameList.empty() ) throwFunctionSequenceException(*this); - // Werte ... + // Values ... OSQLParseNode * pValuesOrQuerySpec = m_pParseTree->getChild(4); OSL_ENSURE(pValuesOrQuerySpec != NULL,"OResultSet: pValuesOrQuerySpec darf nicht NULL sein!"); OSL_ENSURE(SQL_ISRULE(pValuesOrQuerySpec,values_or_query_spec),"OResultSet: ! SQL_ISRULE(pValuesOrQuerySpec,values_or_query_spec)"); OSL_ENSURE(pValuesOrQuerySpec->count() > 0,"OResultSet: pValuesOrQuerySpec->count() <= 0"); - // nur "VALUES" ist erlaubt ... + // just "VALUES" is allowed ... if (! SQL_ISTOKEN(pValuesOrQuerySpec->getChild(0),VALUES)) throwFunctionSequenceException(*this); OSL_ENSURE(pValuesOrQuerySpec->count() == 4,"OResultSet: pValuesOrQuerySpec->count() != 4"); - // Liste von Werten + // Liste of values OSQLParseNode * pInsertAtomCommalist = pValuesOrQuerySpec->getChild(2); OSL_ENSURE(pInsertAtomCommalist != NULL,"OResultSet: pInsertAtomCommalist darf nicht NULL sein!"); OSL_ENSURE(pInsertAtomCommalist->count() > 0,"OResultSet: pInsertAtomCommalist <= 0"); @@ -669,7 +669,7 @@ void OStatement_Base::GetAssignValues() OSL_ENSURE(pRow_Value_Const != NULL,"OResultSet: pRow_Value_Const darf nicht NULL sein!"); if(SQL_ISRULE(pRow_Value_Const,parameter)) { - ParseAssignValues(aColumnNameList,pRow_Value_Const,nIndex++); // kann nur ein Columnname vorhanden sein pro Schleife + ParseAssignValues(aColumnNameList,pRow_Value_Const,nIndex++); // only one Columnname allowed per loop } else if(pRow_Value_Const->isToken()) ParseAssignValues(aColumnNameList,pRow_Value_Const,static_cast<xub_StrLen>(i)); @@ -703,7 +703,7 @@ void OStatement_Base::GetAssignValues() OSL_ENSURE(SQL_ISRULE(pAssignmentCommalist,assignment_commalist),"OResultSet: Fehler im Parse Tree"); OSL_ENSURE(pAssignmentCommalist->count() > 0,"OResultSet: pAssignmentCommalist->count() <= 0"); - // Alle Zuweisungen (Kommaliste) bearbeiten ... + // work on all assignments (commalist) ... ::std::vector< String> aList(1); for (sal_uInt32 i = 0; i < pAssignmentCommalist->count(); i++) { @@ -745,12 +745,12 @@ void OStatement_Base::ParseAssignValues(const ::std::vector< String>& aColumnNam pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_INTNUM || pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_APPROXNUM) { - // Wert setzen: + // set value: SetAssignValue(aColumnName, pRow_Value_Constructor_Elem->getTokenValue()); } else if (SQL_ISTOKEN(pRow_Value_Constructor_Elem,NULL)) { - // NULL setzen + // set NULL SetAssignValue(aColumnName, String(), TRUE); } else if (SQL_ISRULE(pRow_Value_Constructor_Elem,parameter)) @@ -771,11 +771,11 @@ void OStatement_Base::SetAssignValue(const String& aColumnName, Reference<XPropertySet> xCol; m_xColNames->getByName(aColumnName) >>= xCol; sal_Int32 nId = Reference<XColumnLocate>(m_xColNames,UNO_QUERY)->findColumn(aColumnName); - // Kommt diese Column ueberhaupt in der Datei vor? + // does this column actually exist in the file? if (!xCol.is()) { - // Diese Column gibt es nicht! + // This Column doesn't exist! // aStatus.Set(SQL_STAT_ERROR, // String::CreateFromAscii("S0022"), // aStatus.CreateErrorMessage(String(SdbResId(STR_STAT_COLUMN_NOT_FOUND))), @@ -783,23 +783,23 @@ void OStatement_Base::SetAssignValue(const String& aColumnName, throwFunctionSequenceException(*this); } - // Value an die Row mit den zuzuweisenden Werten binden: + // tie Value to the Row with values that shall be assigned: // const ODbVariantRef& xValue = (*aAssignValues)[pFileColumn->GetId()]; - // Alles geprueft und wir haben den Namen der Column. - // Jetzt eine Value allozieren, den Wert setzen und die Value an die Row binden. + // Everything tested and we have the names of the Column. + // Now allocate one Value, set the value and tie the value to the Row. if (bSetNull) (m_aAssignValues->get())[nId]->setNull(); else { switch (::comphelper::getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)))) { - // Kriterium je nach Typ als String oder double in die Variable packen ... + // put criteria depending on the Type as String or double in the variable case DataType::CHAR: case DataType::VARCHAR: case DataType::LONGVARCHAR: *(m_aAssignValues->get())[nId] = ORowSetValue(aValue); - // Zeichensatz ist bereits konvertiert, da ja das gesamte Statement konvertiert wurde + //Characterset is already converted, since the entire statement was converted break; case DataType::BIT: @@ -810,7 +810,7 @@ void OStatement_Base::SetAssignValue(const String& aColumnName, *(m_aAssignValues->get())[nId] = sal_False; else { - // aStatus.Set(SQL_STAT_ERROR); // nyi: genauer! + // aStatus.Set(SQL_STAT_ERROR); // nyi: more accurate! throwFunctionSequenceException(*this); } } @@ -842,8 +842,8 @@ void OStatement_Base::SetAssignValue(const String& aColumnName, } } - // Parameter-Nr. merken (als User Data) - // SQL_NO_PARAMETER = kein Parameter. + // save Parameter-No. (as User Data) + // SQL_NO_PARAMETER = no Parameter. m_aAssignValues->setParameterIndex(nId,nParameter); if(nParameter != SQL_NO_PARAMETER) m_aParameterIndexes[nParameter] = nId; diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx index f55d609daf51..faef2d96d4a5 100644 --- a/connectivity/source/drivers/file/fanalyzer.cxx +++ b/connectivity/source/drivers/file/fanalyzer.cxx @@ -115,10 +115,9 @@ void OSQLAnalyzer::start(OSQLParseNode* pSQLParseNode) //------------------------------------------------------------------ void OSQLAnalyzer::bindRow(OCodeList& rCodeList,const OValueRefRow& _pRow,OEvaluateSetList& _rEvaluateSetList) { - // Zaehlen, wieviele Kriterien - // wenn nur ein Kriterium, und das entsprechende Feld ist indiziert - // dann wird der Index verwendet - + // count criteria + // if only one criterion, and the corresponding field is indexed + // then the index will be used OEvaluateSet* pEvaluateSet = NULL; for (OCodeList::iterator aIter = rCodeList.begin(); aIter != rCodeList.end(); ++aIter) @@ -166,10 +165,10 @@ void OSQLAnalyzer::bindSelectRow(const OValueRefRow& _pRow) ::std::vector<sal_Int32>* pKeySet = NULL; OEvaluateSet* pEvaluateSet = NULL; - // Keyset erzeugen mit kleinster Liste + // create Keyset with smallest list if(!aEvaluateSetList.empty()) { - // welche Liste hat den kleinsten count ? + // which list has the smallest count? OEvaluateSetList::iterator i = aEvaluateSetList.begin(); pEvaluateSet = *(i); for(++i; i != aEvaluateSetList.end();++i) @@ -188,7 +187,7 @@ void OSQLAnalyzer::bindSelectRow(const OValueRefRow& _pRow) (*pKeySet)[k] = j->second; } - // alle loeschen + // delete all for(i = aEvaluateSetList.begin(); i != aEvaluateSetList.end();++i) delete (*i); } @@ -203,20 +202,20 @@ void OSQLAnalyzer::describeParam(::rtl::Reference<OSQLColumns> rParameterColumns OCodeStack aCodeStack; if (!rCodeList.size()) - return; // kein Praedikat + return; // no predicate if (!rParameterColumns->get().size()) - return; // keine Parameter + return; // no parameters - // Anlegen von Columns, die eine genauere Beschreibung fuer die enthalten + // Create columns, that have a more precise description for the included ::rtl::Reference<OSQLColumns> aNewParamColumns = new OSQLColumns(*rParameterColumns); - // Anlegen einer Testzeile, wird benoetigt um die Parameter zu beschreiben + // Create a Test-row, is needed to describe the parameters OValueRefRow aParameterRow = new OValueRefVector(rParameterColumns->get().size()); bindParameterRow(aParameterRow); OValueRefRow aTestRow = new OValueRefVector(Reference< XIndexAccess>(m_aCompiler->getOrigColumns(),UNO_QUERY)->getCount()); - delete bindEvaluationRow(aTestRow); // Binden der Attribute an die Values + delete bindEvaluationRow(aTestRow); // Bind the attributes to the values for(OCodeList::iterator aIter = rCodeList.begin(); aIter != rCodeList.end(); ++aIter) { @@ -226,10 +225,10 @@ void OSQLAnalyzer::describeParam(::rtl::Reference<OSQLColumns> rParameterColumns aCodeStack.push(pOperand); else { - if (pOperator->getRequestedOperands() == 2) // bei zwei Operatoren ist es moeglich - { // einen Parameter weiter zu spezifizieren + if (pOperator->getRequestedOperands() == 2) // with two Operands it is possible + { // to specify one parameter better OOperandParam *pParam = PTR_CAST(OOperandParam,aCodeStack.top()); - if (pParam) // Anpassen des ParameterTyps, wenn der linke Operand ein Attribut ist + if (pParam) // adjust the Parameter-types, if the left Operand is an attribute { OOperandAttr *pLeft = PTR_CAST(OOperandAttr,*(rCodeList.end() - 2)); if (pLeft) diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx index b53226c98fdd..7c30f41b44ff 100644 --- a/connectivity/source/drivers/file/fcode.cxx +++ b/connectivity/source/drivers/file/fcode.cxx @@ -130,7 +130,7 @@ sal_Bool OOperandAttr::isIndexed() const } //------------------------------------------------------------------ OOperandParam::OOperandParam(OSQLParseNode* pNode, sal_Int32 _nPos) - : OOperandRow(static_cast<sal_uInt16>(_nPos), DataType::VARCHAR) // Standard-Typ + : OOperandRow(static_cast<sal_uInt16>(_nPos), DataType::VARCHAR) // Standard-Type { OSL_ENSURE(SQL_ISRULE(pNode,parameter),"Argument ist kein Parameter"); OSL_ENSURE(pNode->count() > 0,"Fehler im Parse Tree"); @@ -146,17 +146,15 @@ OOperandParam::OOperandParam(OSQLParseNode* pNode, sal_Int32 _nPos) OSL_ASSERT("Fehler im Parse Tree"); } - // Parameter-Column aufsetzen mit defult typ, kann zu einem spaeteren Zeitpunkt ueber DescribeParameter - // genauer spezifiziert werden + // set up Parameter-Column with default type, can be specified more precisely later using Describe-Parameter - // Identitaet merken (hier eigentlich nicht erforderlich, aber aus - // Symmetriegruenden ...) + // save Identity (not escpecially necessary here, just for the sake of symmetry) // todo // OColumn* pColumn = new OFILEColumn(aParameterName,eDBType,255,0,SQL_FLAGS_NULLALLOWED); // rParamColumns->AddColumn(pColumn); - // der Wert wird erst kurz vor der Auswertung gesetzt + // the value will be set just before the evaluation } @@ -343,7 +341,7 @@ sal_Bool OOp_COMPARE::operate(const OOperand* pLeft, const OOperand* pRight) con sal_Bool bResult = sal_False; sal_Int32 eDBType = pLeft->getDBType(); - // Vergleich (je nach Datentyp): + // Comparison (depending on Data-type): switch (eDBType) { case DataType::CHAR: diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx index c3456f178e68..af4f0c32eca7 100644 --- a/connectivity/source/drivers/file/fcomp.cxx +++ b/connectivity/source/drivers/file/fcomp.cxx @@ -88,8 +88,8 @@ void OPredicateCompiler::start(OSQLParseNode* pSQLParseNode) return; m_nParamCounter = 0; - // Parse Tree analysieren (je nach Statement-Typ) - // und Zeiger auf WHERE-Klausel setzen: + // analyse Parse Tree (depending on Statement-type) + // and set pointer on WHERE-clause: OSQLParseNode * pWhereClause = NULL; OSQLParseNode * pOrderbyClause = NULL; @@ -132,12 +132,12 @@ void OPredicateCompiler::start(OSQLParseNode* pSQLParseNode) pWhereClause = pSQLParseNode->getChild(3); } else - // Anderes Statement. Keine Selektionskriterien. + // Other Statement. no selection-criteria return; if (SQL_ISRULE(pWhereClause,where_clause)) { - // Wenn es aber eine where_clause ist, dann darf sie nicht leer sein: + // a where-clause is not allowed to be empty: DBG_ASSERT(pWhereClause->count() == 2,"OFILECursor: Fehler im Parse Tree"); OSQLParseNode * pComparisonPredicate = pWhereClause->getChild(1); @@ -147,8 +147,7 @@ void OPredicateCompiler::start(OSQLParseNode* pSQLParseNode) } else { - // Die Where Clause ist meistens optional, d. h. es koennte sich auch - // um "optional_where_clause" handeln. + // The where-clause is optionally in the majority of cases, i.e. it might be an "optional-where-clause". DBG_ASSERT(SQL_ISRULE(pWhereClause,opt_where_clause),"OPredicateCompiler: Fehler im Parse Tree"); } } @@ -157,18 +156,18 @@ void OPredicateCompiler::start(OSQLParseNode* pSQLParseNode) OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode) { OOperand* pOperand = NULL; - if (pPredicateNode->count() == 3 && // Ausdruck is geklammert + if (pPredicateNode->count() == 3 && // Expression is bracketed SQL_ISPUNCTUATION(pPredicateNode->getChild(0),"(") && SQL_ISPUNCTUATION(pPredicateNode->getChild(2),")")) { execute(pPredicateNode->getChild(1)); } else if ((SQL_ISRULE(pPredicateNode,search_condition) || (SQL_ISRULE(pPredicateNode,boolean_term))) - && // AND/OR-Verknuepfung: + && // AND/OR-linkage: pPredicateNode->count() == 3) { - execute(pPredicateNode->getChild(0)); // Bearbeiten des linken Zweigs - execute(pPredicateNode->getChild(2)); // Bearbeiten des rechten Zweigs + execute(pPredicateNode->getChild(0)); // process the left branch + execute(pPredicateNode->getChild(2)); // process the right branch if (SQL_ISTOKEN(pPredicateNode->getChild(1),OR)) // OR-Operator { @@ -205,8 +204,8 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode) } else if(SQL_ISRULE(pPredicateNode,num_value_exp)) { - execute(pPredicateNode->getChild(0)); // Bearbeiten des linken Zweigs - execute(pPredicateNode->getChild(2)); // Bearbeiten des rechten Zweigs + execute(pPredicateNode->getChild(0)); // process the left branch + execute(pPredicateNode->getChild(2)); // process the right branch if (SQL_ISPUNCTUATION(pPredicateNode->getChild(1),"+")) { m_aCodeList.push_back(new OOp_ADD()); @@ -220,8 +219,8 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode) } else if(SQL_ISRULE(pPredicateNode,term)) { - execute(pPredicateNode->getChild(0)); // Bearbeiten des linken Zweigs - execute(pPredicateNode->getChild(2)); // Bearbeiten des rechten Zweigs + execute(pPredicateNode->getChild(0)); // process the left branch + execute(pPredicateNode->getChild(2)); // process the right branch if (SQL_ISPUNCTUATION(pPredicateNode->getChild(1),"*")) { m_aCodeList.push_back(new OOp_MUL()); @@ -234,7 +233,7 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode) } } else - pOperand = execute_Operand(pPredicateNode); // jetzt werden nur einfache Operanden verarbeitet + pOperand = execute_Operand(pPredicateNode); // now only simple operands will be processed return pOperand; } @@ -465,7 +464,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode* pPredicateNode) thr pOperand = m_pAnalyzer->createOperandAttr(Reference< XColumnLocate>(m_orgColumns,UNO_QUERY)->findColumn(aColumnName),xCol,m_xIndexes); } else - {// Column existiert nicht im Resultset + {// Column doesn't exist in the Result-set const ::rtl::OUString sError( m_pAnalyzer->getConnection()->getResources().getResourceStringWithSubstitution( STR_INVALID_COLUMNNAME, "$columnname$", aColumnName @@ -495,7 +494,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode* pPredicateNode) thr else if((pPredicateNode->count() == 2) && (SQL_ISPUNCTUATION(pPredicateNode->getChild(0),"+") || SQL_ISPUNCTUATION(pPredicateNode->getChild(0),"-")) && pPredicateNode->getChild(1)->getNodeType() == SQL_NODE_INTNUM) - { // falls -1 bzw. +1 vorhanden ist + { // if -1 or +1 is there ::rtl::OUString aValue(pPredicateNode->getChild(0)->getTokenValue()); aValue += pPredicateNode->getChild(1)->getTokenValue(); pOperand = new OOperandConst(*pPredicateNode->getChild(1), aValue); @@ -561,7 +560,7 @@ sal_Bool OPredicateInterpreter::evaluate(OCodeList& rCodeList) OCodeList::iterator aIter = rCodeList.begin(); if (!(*aIter)) - return sal_True; // kein Praedikat + return sal_True; // no Predicate for(;aIter != rCodeList.end();++aIter) { @@ -588,7 +587,7 @@ void OPredicateInterpreter::evaluateSelection(OCodeList& rCodeList,ORowSetValueD { OCodeList::iterator aIter = rCodeList.begin(); if (!(*aIter)) - return ; // kein Praedikat + return ; // no Predicate for(;aIter != rCodeList.end();++aIter) { |