User: rt Date: 05/09/05 02:00:07 Modified: /dba/dbaccess/source/ui/misc/ indexcollection.cxx
Log: INTEGRATION: CWS hr18 (1.5.424); FILE MERGED 2005/08/10 16:53:17 hr 1.5.424.1: #i51878#,#i53108#: cleanup STL iterator usage File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: indexcollection.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/indexcollection.cxx?r1=1.5&r2=1.6 Delta lines: +23 -23 --------------------- --- indexcollection.cxx 19 Mar 2003 17:52:53 -0000 1.5 +++ indexcollection.cxx 5 Sep 2005 09:00:04 -0000 1.6 @@ -141,12 +141,12 @@ } //------------------------------------------------------------------ - OIndexCollection::const_iterator OIndexCollection::find(const String& _rName) const + Indexes::const_iterator OIndexCollection::find(const String& _rName) const { ::rtl::OUString sNameCompare(_rName); // loop'n'compare - const_iterator aSearch = m_aIndexes.begin(); + Indexes::const_iterator aSearch = m_aIndexes.begin(); for (; aSearch != m_aIndexes.end(); ++aSearch) if (aSearch->sName == sNameCompare) break; @@ -155,12 +155,12 @@ } //------------------------------------------------------------------ - OIndexCollection::iterator OIndexCollection::find(const String& _rName) + Indexes::iterator OIndexCollection::find(const String& _rName) { ::rtl::OUString sNameCompare(_rName); // loop'n'compare - iterator aSearch = m_aIndexes.begin(); + Indexes::iterator aSearch = m_aIndexes.begin(); for (; aSearch != m_aIndexes.end(); ++aSearch) if (aSearch->sName == sNameCompare) break; @@ -169,12 +169,12 @@ } //------------------------------------------------------------------ - OIndexCollection::const_iterator OIndexCollection::findOriginal(const String& _rName) const + Indexes::const_iterator OIndexCollection::findOriginal(const String& _rName) const { ::rtl::OUString sNameCompare(_rName); // loop'n'compare - const_iterator aSearch = m_aIndexes.begin(); + Indexes::const_iterator aSearch = m_aIndexes.begin(); for (; aSearch != m_aIndexes.end(); ++aSearch) if (aSearch->getOriginalName() == sNameCompare) break; @@ -183,12 +183,12 @@ } //------------------------------------------------------------------ - OIndexCollection::iterator OIndexCollection::findOriginal(const String& _rName) + Indexes::iterator OIndexCollection::findOriginal(const String& _rName) { ::rtl::OUString sNameCompare(_rName); // loop'n'compare - iterator aSearch = m_aIndexes.begin(); + Indexes::iterator aSearch = m_aIndexes.begin(); for (; aSearch != m_aIndexes.end(); ++aSearch) if (aSearch->getOriginalName() == sNameCompare) break; @@ -197,7 +197,7 @@ } //------------------------------------------------------------------ - void OIndexCollection::commitNewIndex(const iterator& _rPos) SAL_THROW((SQLException)) + void OIndexCollection::commitNewIndex(const Indexes::iterator& _rPos) SAL_THROW((SQLException)) { OSL_ENSURE(_rPos->isNew(), "OIndexCollection::commitNewIndex: index must be new!"); @@ -268,7 +268,7 @@ } //------------------------------------------------------------------ - sal_Bool OIndexCollection::dropNoRemove(const iterator& _rPos) SAL_THROW((SQLException)) + sal_Bool OIndexCollection::dropNoRemove(const Indexes::iterator& _rPos) SAL_THROW((SQLException)) { try { @@ -294,7 +294,7 @@ } // adjust the OIndex structure - iterator aDropped = findOriginal(_rPos->getOriginalName()); + Indexes::iterator aDropped = findOriginal(_rPos->getOriginalName()); OSL_ENSURE(aDropped != m_aIndexes.end(), "OIndexCollection::drop: invalid original name, but successfull commit?!"); aDropped->flagAsNew(GrantIndexAccess()); @@ -302,7 +302,7 @@ } //------------------------------------------------------------------ - sal_Bool OIndexCollection::drop(const iterator& _rPos) SAL_THROW((SQLException)) + sal_Bool OIndexCollection::drop(const Indexes::iterator& _rPos) SAL_THROW((SQLException)) { OSL_ENSURE((_rPos >= m_aIndexes.begin()) && (_rPos < m_aIndexes.end()), "OIndexCollection::drop: invalid position (fasten your seatbelt .... this will crash)!"); @@ -355,10 +355,10 @@ const ::rtl::OUString* pFieldNames = aFieldNames.getConstArray(); const ::rtl::OUString* pFieldNamesEnd = pFieldNames + aFieldNames.getLength(); - OIndexField* pCopyTo = _rIndex.aFields.begin(); + IndexFields::iterator aCopyTo = _rIndex.aFields.begin(); Reference< XPropertySet > xIndexColumn; - for (;pFieldNames < pFieldNamesEnd; ++pFieldNames, ++pCopyTo) + for (;pFieldNames < pFieldNamesEnd; ++pFieldNames, ++aCopyTo) { // extract the column xIndexColumn.clear(); @@ -366,22 +366,22 @@ if (!xIndexColumn.is()) { OSL_ENSURE(sal_False, "OIndexCollection::implFillIndexInfo: invalid index column!"); - --pCopyTo; + --aCopyTo; continue; } // get the relevant properties - pCopyTo->sFieldName = *pFieldNames; - pCopyTo->bSortAscending = ::cppu::any2bool(xIndexColumn->getPropertyValue(s_sSortPropertyName)); + aCopyTo->sFieldName = *pFieldNames; + aCopyTo->bSortAscending = ::cppu::any2bool(xIndexColumn->getPropertyValue(s_sSortPropertyName)); } - _rIndex.aFields.resize(pCopyTo - _rIndex.aFields.begin()); + _rIndex.aFields.resize(aCopyTo - _rIndex.aFields.begin()); // (just in case some fields were invalid ...) } } //------------------------------------------------------------------ - void OIndexCollection::resetIndex(const iterator& _rPos) SAL_THROW((SQLException)) + void OIndexCollection::resetIndex(const Indexes::iterator& _rPos) SAL_THROW((SQLException)) { OSL_ENSURE(_rPos >= m_aIndexes.begin() && _rPos < m_aIndexes.end(), "OIndexCollection::resetIndex: invalid position!"); @@ -405,7 +405,7 @@ } //------------------------------------------------------------------ - OIndexCollection::iterator OIndexCollection::insert(const String& _rName) + Indexes::iterator OIndexCollection::insert(const String& _rName) { OSL_ENSURE(end() == find(_rName), "OIndexCollection::insert: invalid new name!"); String tmpName; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
