diff options
Diffstat (limited to 'connectivity/source/drivers/file/fanalyzer.cxx')
-rwxr-xr-x[-rw-r--r--] | connectivity/source/drivers/file/fanalyzer.cxx | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx index 04df24ab379e..a69f521aff67 100644..100755 --- a/connectivity/source/drivers/file/fanalyzer.cxx +++ b/connectivity/source/drivers/file/fanalyzer.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. @@ -92,9 +93,9 @@ void OSQLAnalyzer::start(OSQLParseNode* pSQLParseNode) || SQL_ISRULE(pColumnRef,factor) || SQL_ISRULE(pColumnRef,set_fct_spec) ) { - ::vos::ORef<OPredicateCompiler> pCompiler = new OPredicateCompiler(this); + ::rtl::Reference<OPredicateCompiler> pCompiler = new OPredicateCompiler(this); pCompiler->setOrigColumns(m_aCompiler->getOrigColumns()); - ::vos::ORef<OPredicateInterpreter> pInterpreter = new OPredicateInterpreter(pCompiler); + ::rtl::Reference<OPredicateInterpreter> pInterpreter = new OPredicateInterpreter(pCompiler); pCompiler->execute( pColumnRef ); m_aSelectionEvaluations.push_back( TPredicates(pCompiler,pInterpreter) ); } @@ -133,10 +134,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) @@ -171,7 +171,7 @@ void OSQLAnalyzer::bindSelectRow(const OValueRefRow& _pRow) OEvaluateSetList aEvaluateSetList; for ( ::std::vector< TPredicates >::iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end();++aIter) { - if ( aIter->first.isValid() ) + if ( aIter->first.is() ) bindRow( aIter->first->m_aCodeList,_pRow,aEvaluateSetList); } } @@ -184,10 +184,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) @@ -206,7 +206,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); } @@ -215,26 +215,26 @@ void OSQLAnalyzer::bindSelectRow(const OValueRefRow& _pRow) } //------------------------------------------------------------------ -void OSQLAnalyzer::describeParam(::vos::ORef<OSQLColumns> rParameterColumns) +void OSQLAnalyzer::describeParam(::rtl::Reference<OSQLColumns> rParameterColumns) { OCodeList& rCodeList = m_aCompiler->m_aCodeList; 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 - ::vos::ORef<OSQLColumns> aNewParamColumns = new OSQLColumns(*rParameterColumns); + // 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) { @@ -244,10 +244,10 @@ void OSQLAnalyzer::describeParam(::vos::ORef<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) @@ -273,7 +273,6 @@ void OSQLAnalyzer::describeParam(::vos::ORef<OSQLColumns> rParameterColumns) OSL_ENSURE(0,"Illegal here!"); rParameterColumns = aNewParamColumns; - // m_aCompiler->setParameterColumns(rParameterColumns); } // ----------------------------------------------------------------------------- @@ -296,7 +295,7 @@ sal_Bool OSQLAnalyzer::hasFunctions() const m_bSelectionFirstTime = sal_False; for ( ::std::vector< TPredicates >::const_iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end() && !m_bHasSelectionCode ;++aIter) { - if ( aIter->first.isValid() ) + if ( aIter->first.is() ) m_bHasSelectionCode = aIter->first->hasCode(); } } @@ -308,7 +307,7 @@ void OSQLAnalyzer::setSelectionEvaluationResult(OValueRefRow& _pRow,const ::std: sal_Int32 nPos = 1; for ( ::std::vector< TPredicates >::iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end();++aIter,++nPos) { - if ( aIter->second.isValid() ) + if ( aIter->second.is() ) { // the first column (index 0) is for convenience only. The first real select column is no 1. sal_Int32 map = nPos; @@ -325,7 +324,7 @@ void OSQLAnalyzer::dispose() m_aCompiler->dispose(); for ( ::std::vector< TPredicates >::iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end();++aIter) { - if ( aIter->first.isValid() ) + if ( aIter->first.is() ) aIter->first->dispose(); } } @@ -335,8 +334,10 @@ void OSQLAnalyzer::setOrigColumns(const OFileColumns& rCols) m_aCompiler->setOrigColumns(rCols); for ( ::std::vector< TPredicates >::iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end();++aIter) { - if ( aIter->first.isValid() ) + if ( aIter->first.is() ) aIter->first->setOrigColumns(rCols); } } // ----------------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |